Skip to content

Commit

Permalink
Add optimal attribute in IBS2 output
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanf committed Nov 11, 2024
1 parent 155c3df commit 985b0d8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/treesearchsolver/iterative_beam_search_2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ struct IterativeBeamSearch2Output: Output<BranchingScheme>
/** Maximum size of the queue reached. */
NodeId maximum_size_of_the_queue = 0;

/** True if all nodes have been explored. */
bool optimal = false;


virtual int format_width() const override { return 37; }

Expand Down Expand Up @@ -272,6 +275,11 @@ inline const IterativeBeamSearch2Output<BranchingScheme> iterative_beam_search_2
history[d]->clear();
}

if (stop) {
output.optimal = true;
parameters.new_solution_callback(output);
}

std::stringstream ss;
ss << "q " << output.maximum_size_of_the_queue;
algorithm_formatter.print(ss);
Expand All @@ -295,4 +303,3 @@ inline const IterativeBeamSearch2Output<BranchingScheme> iterative_beam_search_2
}

}

0 comments on commit 985b0d8

Please sign in to comment.