Repository navigation
irregular: add a Benders decomposition and a MILP NFP algorithm - #773
Merged
Merged
Conversation
fontanf
force-pushed
the
irregular-benders-decomposition
branch
from
October 31, 2026 21:15
4b2775b to
613750e
Compare
Benders decomposition, for the Knapsack, BinPacking and VariableSizedBinPacking objectives: the master problem assigns the items to the bins by area, as a onedimensional problem, and the subproblems check whether the items of each bin fit. The minimal infeasible subsets of the bins which don't fit give no-good cuts, which are lifted when they are proven. MILP NFP, which proves that a set of items doesn't fit in a bin: for each rotation combination, a MILP selects, for each pair of items, a convex piece of the region outside of their no-fit polygon. Exact fits, symmetries, core widening and the reuse of infeasible sub-combinations. In the Exact mode, the Benders decomposition is selected for the Knapsack objective with a single bin, and the MILP NFP algorithm for the Feasibility objective with a single bin, and the subproblems of the Benders decomposition use the MILP NFP algorithm. The column generation supports the Dual pricing type, solved with the Benders decomposition, and the knapsack goal is added to the irregular instances. Documentation of both algorithms, with figures.
fontanf
force-pushed
the
irregular-benders-decomposition
branch
from
October 31, 2026 22:33
613750e to
cb99a07
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two new exact algorithms for the irregular problem type: a combinatorial Benders decomposition, and a MILP NFP algorithm which proves that a set of items doesn't fit in a bin. Together, they prove the optimality of bin packing instances, and they are used in the
exactoptimization mode.Benders decomposition
New algorithm
benders_decomposition, for theKnapsack,BinPackingandVariableSizedBinPackingobjectives, like the rectangle one:With the MILP NFP algorithm in the subproblems (
--benders-decomposition-use-milp-nfp 1, always on in theexactmode):MILP NFP
New algorithm
milp_nfp: given a bin type and a set of items, it tries to prove that the items don't fit. For each rotation combination, it solves a MILP on the positions of the reference points: each item in its inner-fit rectangle, and for each pair of items, the relative position in a convex piece of the region outside of their no-fit polygon (one binary variable per piece, big-M constraints). The rotation combinations are solved in parallel, with an early stop as soon as one of them is feasible.It also solves the
Feasibilityobjective with a single bin (--use-milp-nfp 1).Integration
exactmode, the Benders decomposition is selected for theKnapsackobjective with a single bin, and the MILP NFP algorithm for theFeasibilityobjective with a single bin.Dualpricing type: the Benders decomposition, with the MILP NFP algorithm, solves the pricing problems when a bound is needed.--use-benders-decomposition,--benders-decomposition-use-milp-nfpand--use-milp-nfp, and the matching Python parametersuse_benders_decomposition,benders_decomposition_use_milp_nfpanduse_milp_nfp.Results
Exact mode, with the tree search, 300 s, on the bin packing instances of
data/irregular/martinez2017:albano_sb,dighe1_sb,dighe2_sb,fu_sb,han_sb,jakobs1_sb,mao_sb,poly1a_sb,shapes0_sb,shapes1_sb,shapes2_sb;jakobs2_sb,poly2a_sbtopoly5b_sb,shirts_sb,swimm_sb,trousers_sb. When more items fit in a bin, the minimal infeasible subsets have 5 items or more, and each one takes seconds to prove.The Benders decomposition alone gives bounds at least as good as the column generation with dual pricing on every instance, better on
jakobs2_sb,poly2b_sbandshirts_sb, and is faster on theshapes*_sbinstances.Tests
milp_nfp_test.cpp: too large squares, exact fits, interlocked steps with and without rotation, crosses, core widening, symmetries, packing from the solution of the relaxation, infeasibility proven byoptimizein theexactmode.benders_decomposition_test.cpp: one test per objective, on 60 x 40 items, two of which can't be side by side in a 100 x 100 bin, so that the area bound is weak; theexactmode; the knapsack goal; the dual pricing of the column generation (fails without it).data/irregular/tests/feasibility_poly*_five_items*.json: five items ofpoly1a_sbandpoly2a_sb, for the analysis of the MILP NFP algorithm.Documentation
New pages
doc/internals/irregular/benders_decomposition.rstanddoc/internals/irregular/milp_nfp.rst, in the layout of the detailed algorithm pages; the irregular summary, the algorithm selection and the column generation pages are updated.The figures of these pages (the iteration of the Benders decomposition, the convex pieces and the exact fit of a no-fit polygon, the core widening) are generated as SVG by
scripts/doc_figures/irregular_benders_decomposition.pyandscripts/doc_figures/irregular_milp_nfp.py, withscripts/doc_figures/figure.py.