Skip to content

Commit

Permalink
Improve minknap sub-instance capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanf committed Nov 14, 2024
1 parent 5115e4d commit c4eddb0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ const DynamicProgrammingPrimalDualOutput knapsacksolver::knapsack::dynamic_progr
// Build new instance.
InstanceBuilder sub_instance_builder;
std::vector<ItemId> sub2original;
Weight sub_capacity = instance.capacity() - solution.weight();
Weight sub_capacity = data.best_state.weight - solution.weight();
sub_instance_builder.set_capacity(sub_capacity);
for (ItemPos item_pos = data.s + 1;
item_pos <= data.partial_sort.last_sorted_item_pos();
Expand Down

0 comments on commit c4eddb0

Please sign in to comment.