Skip to content

Commit c4ee96d

Browse files
committed
Fix bounds from CG in onedimensional
1 parent 5bb0504 commit c4ee96d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/onedimensional/optimize.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,14 @@ void optimize_column_generation(
408408
const columngenerationsolver::LimitedDiscrepancySearchOutput& cgslds_output
409409
= static_cast<const columngenerationsolver::LimitedDiscrepancySearchOutput&>(cgs_output);
410410
if (instance.objective() == Objective::VariableSizedBinPacking) {
411-
algorithm_formatter.update_variable_sized_bin_packing_bound(cgslds_output.bound);
411+
double multiplier_cost = largest_power_of_two_lesser_or_equal(instance.largest_bin_cost());
412+
algorithm_formatter.update_variable_sized_bin_packing_bound(cgslds_output.bound * multiplier_cost);
412413
} else if (instance.objective() == Objective::Knapsack) {
413-
algorithm_formatter.update_knapsack_bound(cgslds_output.bound);
414+
double multiplier_profit = largest_power_of_two_lesser_or_equal(instance.largest_item_profit());
415+
algorithm_formatter.update_knapsack_bound(cgslds_output.bound * multiplier_profit);
414416
} else if (instance.objective() == Objective::BinPacking) {
415-
BinPos bin_packing_bound = std::ceil(cgslds_output.bound / instance.bin_type(0).space() - 0.001);
417+
double multiplier_cost = largest_power_of_two_lesser_or_equal(instance.largest_bin_cost());
418+
BinPos bin_packing_bound = std::ceil(cgslds_output.bound * multiplier_cost / instance.bin_type(0).space() - 0.001);
416419
algorithm_formatter.update_bin_packing_bound(bin_packing_bound);
417420
}
418421
};

0 commit comments

Comments
 (0)