From 34cc3b6b11d6231070046a854547a049837bb7fa Mon Sep 17 00:00:00 2001 From: Florian Fontan Date: Sun, 20 Oct 2024 18:55:33 +0200 Subject: [PATCH] Fix rectangle::BranchingScheme::dominates --- src/rectangle/branching_scheme.cpp | 2 ++ src/rectangle/branching_scheme.hpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/rectangle/branching_scheme.cpp b/src/rectangle/branching_scheme.cpp index aacd7679..0dbf9b5a 100644 --- a/src/rectangle/branching_scheme.cpp +++ b/src/rectangle/branching_scheme.cpp @@ -470,6 +470,8 @@ const std::vector& BranchingScheme::insertions( { //std::cout << "id " << parent->id // << " number_of_items " << parent->number_of_items + // << " number_of_bins " << parent->number_of_bins + // << " waste " << parent->waste // << " group_score " << parent->group_score // << " load " << (double)parent->item_area / parent->guide_area // << " last_bin_middle_axle_weight " << parent->groups.front().last_bin_middle_axle_weight diff --git a/src/rectangle/branching_scheme.hpp b/src/rectangle/branching_scheme.hpp index 71f03568..4bf9ada9 100644 --- a/src/rectangle/branching_scheme.hpp +++ b/src/rectangle/branching_scheme.hpp @@ -381,6 +381,11 @@ class BranchingScheme } } + if (node_1->number_of_bins < node_2->number_of_bins) + return true; + if (node_1->number_of_bins > node_2->number_of_bins) + return false; + //if (unbounded_knapsck_ && node_1->profit < node_2->profit) // return false; ItemPos pos_1 = node_1->uncovered_items.size() - 1;