8 #ifndef CMR_QPREF_BRANCHER_H 9 #define CMR_QPREF_BRANCHER_H 27 template <BranchNode::Pref q_pref>
40 std::priority_queue<BranchHistory::iterator,
41 std::vector<BranchHistory::iterator>,
42 BranchNode::Pref> prob_q;
45 template<BranchNode::Pref q_pref>
53 prob_q.push(branch_history.begin());
54 }
catch (
const std::exception &e) {
55 std::cerr << e.what() << std::endl;
56 throw std::runtime_error(
"QprefBrancher constructor failed.");
59 template <BranchNode::Pref q_pref>
63 branch_history.emplace_front(std::move(B));
64 prob_q.push(branch_history.begin());
66 }
catch (
const std::exception &e) {
67 std::cerr << e.what() <<
" putting nodes in history" << std::endl;
68 throw std::runtime_error(
"QprefBrancher::enqueue_split failed.");
71 template <BranchNode::Pref q_pref>
78 cout <<
"Calling QprefBrancher::next_prob...." << endl;
80 if (next_itr == branch_history.end())
83 cout <<
"....already set." << endl;
85 BranchHistory::iterator result = next_itr;
87 next_itr = branch_history.end();
91 template <BranchNode::Pref q_pref>
98 cout <<
"Calling QprefBrancher::fetch_next..." << endl;
99 if (branch_history.empty() || prob_q.empty()) {
101 cout <<
"set to END" << endl;
102 next_itr = branch_history.end();
106 next_itr = prob_q.top();
void fetch_next()
Set next_itr to the next subproblem to be examined.
Definition: qpref_brancher.hpp:92
Information about the current best tour.
Definition: datagroups.hpp:154
void enqueue_split(BranchNode::Split prob_array)
Adding child subproblems to branch_history.
Definition: qpref_brancher.hpp:60
Graph structures for the edges currently in a CoreLP::Relaxation.
Definition: datagroups.hpp:100
Storing TSP instance data.
Definition: datagroups.hpp:36
ERROR HANDLING CLASSES AND ROUTINES.
Abstract base class for implementing a branching node selection rule.
Definition: base_brancher.hpp:20
std::array< BranchNode, 2 > Split
Alias declaration for returning two split child problems.
Definition: branch_node.hpp:50
Class template for branching with priority queue via some preference rule.
Definition: qpref_brancher.hpp:28
The namespace for this project.
Definition: abc_nodesel.hpp:20
Class for storing the core lp associated to a TSP instance and pivoting.
Definition: core_lp.hpp:33
Abstract branching control.
Definition: branch_node.hpp:25
Monitoring the active tour in the solution process.
BranchHistory::iterator next_prob()
Return the next subproblem to be examined.
Definition: qpref_brancher.hpp:72