
A CLI-based program to solve the Bin Packing Problem with Next Fit & Best Fit Decreasing algorithm
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
This program aims to demonstrate the use of algorithms to solve the bin packing problem and choose the optimal solution.
The bin packing problem is defined by 2 properties, which are the item sizes and the bin container. In this case, a delivery processing facility is used to simulate a scenario.
- bin capacity = Truck load
- item size = Package weight
In each delivery batch, the algorithm would determine which PACKAGE should be loaded into which TRUCK.
The program will require the user to input:
- Truck capacity / load
- The weight of the packages
Or conversely, use data from the existing data files:
- Make changes accordingly in
Main.java
, under Method B2 -getDataFromFile()
The program will then generate the solutions based on the 2 algorithms:
- Next Fit Algorithm (Feasible solution)
- Best Fit Decreasing Algorithm (Optimal solution)
- Weight ----> Measured only in KG (only in Integer)
- Num of Packages ----> Any number of packages is acceptable
- Size --->
- Assume that company has estimated that the load limit for each truck has taken into account the size of parcel (regardless of how big or small)
- Hence, physical size is disregarded in the calculation of the two following approximation algorithms
- Install Extension Pack for Java
- Import Project Folder in VS Code
-
Right click on
App.java
-
Click "Run Java"
- Download & install JRE-15 and above according to your OS
-
Import Project Folder in Eclipse IDE
-
Right click on Project Folder in Project Folder View
-
Click "Build Path"
-
Click "Configure Build Path"
-
Under the "Libraries" Tab, click JRE System Library
-
Click "Edit"
-
Under "Execution Environment", choose "JavaSE-15 (jre)" from the dropdown
-
Click "Finish" then "Apply and Close"
-
Right click on Project Folder in Project Folder View
-
Click "Run As"
-
Click "Java Application"
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Project Link: https://github.com/greydelta/bin-packing-problem