Closed MarvinWalther closed 1 year ago
The Bin Completion algorithm is suppose to be optimal. However, in the following case, the implementation of this package does not give the optimal solution:
import prtpy items = [44, 6, 24, 6, 24, 8, 22, 8, 17, 21] print(prtpy.pack(algorithm=prtpy.packing.bin_completion, binsize=60, items=items))
output:
[[44, 8, 6], [24, 24, 8], [22, 21, 17], [6]]
But the optimal solution is:
[[44, 8, 8], [24, 24, 6, 6], [22, 21, 17]]
This solution can be obtained by using First-Fit-Decreasing:
print(prtpy.pack(algorithm=prtpy.packing.first_fit_decreasing, binsize=60, items=items))
@MarvinWalther can you confirm that the issue is solved?
Yes, that solves the problem.
The Bin Completion algorithm is suppose to be optimal. However, in the following case, the implementation of this package does not give the optimal solution:
output:
But the optimal solution is:
This solution can be obtained by using First-Fit-Decreasing: