rectangleguillotine: fix column_generation_strips max1cut budget bug and add max1cut tests#429
Merged
Merged
Conversation
…and add max1cut tests first_stage_available_width() capped a single strip's width by maximum_distance_1_cuts, but five pricing call sites then subtracted the width already used by previously fixed strips from that per-strip cap instead of from the bin's total width budget. Once enough strips were fixed to exceed maximum_distance_1_cuts, the computed remaining width went negative, silently preventing pricing from ever proposing the column needed to fill the genuinely available leftover space. Fixed by giving the function an explicit filled_width parameter so the cap is applied after subtracting from the total budget, not folded into a value filled_width is later subtracted from. Add 16 knapsack_<code>_max1cut test instances (all [23][ehnr]v[or] configurations) to the tree_search and column_generation_strips test suites, each verified to be feasible, genuinely require the stated stage count and cut-type behavior (and genuine rotation for rotatable variants), and produce a different optimum than the corresponding base/min1cut instance.
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.
first_stage_available_width() capped a single strip's width by maximum_distance_1_cuts, but five pricing call sites then subtracted the width already used by previously fixed strips from that per-strip cap instead of from the bin's total width budget. Once enough strips were fixed to exceed maximum_distance_1_cuts, the computed remaining width went negative, silently preventing pricing from ever proposing the column needed to fill the genuinely available leftover space. Fixed by giving the function an explicit filled_width parameter so the cap is applied after subtracting from the total budget, not folded into a value filled_width is later subtracted from.
Add 16 knapsack_
_max1cut test instances (all [23][ehnr]v[or] configurations) to the tree_search and column_generation_strips test suites, each verified to be feasible, genuinely require the stated stage count and cut-type behavior (and genuine rotation for rotatable variants), and produce a different optimum than the corresponding base/min1cut instance.