Repository navigation
Apply the leftover post-process to the other objectives - #888
Merged
Merged
Conversation
The leftover post-process re-optimizes the bins of the best solution as
single-bin BinPackingWithLeftovers instances, and keeps a re-optimized bin
if its leftovers are better. It was only applied for the
BinPackingWithLeftovers objective. It is now also applied for the
BinPacking, VariableSizedBinPacking, VariableSizedBinPackingWithLeftovers and
Knapsack objectives, in the not-anytime modes:
- The last bin post-process remains specific to BinPackingWithLeftovers.
- For the other objectives, all the bins are re-optimized
('reoptimize_all_bins_leftovers'), whatever 'leftover_all_bins'.
- The post-processed solution has the same value as the best solution: it
replaces it in the solution pool if its leftovers are better
('AlgorithmFormatter::update_solution_leftovers',
'SolutionPool::replace_best', 'Solution::leftovers_better').
- The post-process isn't stopped when the best solution is proven optimal,
since the leftovers are not part of the proven objective.
- Empty bins are not re-optimized.
The re-optimization functions are renamed to make clear that they
re-optimize the leftovers: 'reoptimize_bin_leftovers',
'reoptimize_non_last_bins_leftovers' and 'reoptimize_all_bins_leftovers'.
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.
The leftover post-process re-optimizes the bins of the best solution as single-bin
BinPackingWithLeftoversinstances, and keeps a re-optimized bin if its leftovers are better. It was only applied for theBinPackingWithLeftoversobjective. This PR applies it toBinPacking,VariableSizedBinPacking,VariableSizedBinPackingWithLeftoversandKnapsacktoo, in the not-anytime modes (rectangle, box, boxstacks, irregular).BinPackingWithLeftovers: for the other objectives, no bin plays the role of the last bin.reoptimize_all_bins_leftovers), whateverleftover_all_bins.AlgorithmFormatter::update_solution_leftovers,SolutionPool::replace_best,Solution::leftovers_better).optimize(knapsack/bin packing sub-instances, Benders decomposition, large item first) disable the post-process, so that it only runs once, on the final solution.reoptimize_bin_leftovers,reoptimize_non_last_bins_leftovers,reoptimize_all_bins_leftovers.The PR also contains a small fix of the description of the
VariableSizedBinPackingWithLeftoversobjective incommon.hpp, which was left over from #887.Tests: new rectangle tests (
ReoptimizeAllBinsLeftovers,UpdateSolutionLeftovers,LeftoverPostProcessBinPacking). The whole test suite passes. The only noticeable running time increase is on the irregularfixed_items_several_binstest (0.5 s → 4 s).