Camargue
base_brancher.hpp
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
5 #ifndef CMR_BASE_BRANCHER_H
6 #define CMR_BASE_BRANCHER_H
7 
8 #include "exec_branch.hpp"
9 #include "datagroups.hpp"
10 #include "active_tour.hpp"
11 #include "branch_util.hpp"
12 
13 #include <list>
14 #include <vector>
15 
16 namespace CMR {
17 namespace ABC {
18 
20 class BaseBrancher {
21 public:
22  BaseBrancher(const Data::Instance &inst, const Data::BestGroup &bestdata,
23  const Graph::CoreGraph &coregraph, LP::CoreLP &core);
24 
25  virtual ~BaseBrancher() = default;
26 
28  virtual BranchHistory::iterator next_prob() = 0;
29 
31  void split_prob(BranchHistory::iterator &current);
32 
34  void do_branch(const BranchNode &B);
35 
37  void do_unbranch(const BranchNode &B);
38 
39  const BranchHistory &get_history() { return branch_history; }
40 
41  int verbose = 0;
42 
43 protected:
49  virtual void enqueue_split(BranchNode::Split prob_array) = 0;
50 
52  void common_prep_next(const BranchNode &done, const BranchNode &next);
53 
55  bool prune_btour_edges(const BranchNode &done, const BranchNode &next,
56  const BranchNode &common_anc);
57 
60  virtual void fetch_next() = 0;
61 
62  const Data::Instance &instance;
63  const Data::BestGroup &best_data;
64  const Graph::CoreGraph &core_graph;
65  LP::CoreLP &core_lp;
66 
67  BranchTourFind btour_find;
68 
69  Executor exec;
70  BranchHistory branch_history;
71 
72  BranchHistory::iterator next_itr;
73 };
74 
75 }
76 }
77 #endif
void do_branch(const BranchNode &B)
Branch on B, enforcing its constraint and instating its tour.
Definition: base_brancher.cpp:72
Branching execution.
Information about the current best tour.
Definition: datagroups.hpp:154
virtual BranchHistory::iterator next_prob()=0
Return the next subproblem to be examined.
Data group structures.
Compute branch tours for estimation and instatement, managing their edges.
Definition: branch_tour.hpp:23
Graph structures for the edges currently in a CoreLP::Relaxation.
Definition: datagroups.hpp:100
Definition: exec_branch.hpp:29
Storing TSP instance data.
Definition: datagroups.hpp:36
bool prune_btour_edges(const BranchNode &done, const BranchNode &next, const BranchNode &common_anc)
Should branch tour edges be pruned before going to the next problem.
Definition: base_brancher.cpp:131
Abstract base class for implementing a branching node selection rule.
Definition: base_brancher.hpp:20
void common_prep_next(const BranchNode &done, const BranchNode &next)
Execute variable changes if done was just done and next is next.
Definition: base_brancher.cpp:152
std::array< BranchNode, 2 > Split
Alias declaration for returning two split child problems.
Definition: branch_node.hpp:50
The namespace for this project.
Definition: abc_nodesel.hpp:20
void do_unbranch(const BranchNode &B)
Unbranch on B and all applicable ancestors to prep next problem.
Definition: base_brancher.cpp:97
Class for storing the core lp associated to a TSP instance and pivoting.
Definition: core_lp.hpp:33
Definition: branch_node.hpp:25
void split_prob(BranchHistory::iterator &current)
Split the current problem, adding the subproblems to branch_history.
Definition: base_brancher.cpp:36
Functions, structs/enums, and constants for branching.
virtual void enqueue_split(BranchNode::Split prob_array)=0
Adding child subproblems to branch_history.
Monitoring the active tour in the solution process.
virtual void fetch_next()=0
Set next_itr to the next subproblem to be examined.