Camargue
abc_nodesel.hpp
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
9 #ifndef CMR_ABC_NODESEL_H
10 #define CMR_ABC_NODESEL_H
11 
12 #include "datagroups.hpp"
13 #include "active_tour.hpp"
14 #include "branch_node.hpp"
15 #include "base_brancher.hpp"
16 #include "qpref_brancher.hpp"
17 
18 #include <vector>
19 
20 namespace CMR {
21 namespace ABC {
22 
26 class DFSbrancher : public BaseBrancher {
27 public:
28  DFSbrancher(const Data::Instance &inst, const Data::BestGroup &best_data,
29  const Graph::CoreGraph &core_graph, LP::CoreLP &core_lp);
30 
31  BranchHistory::iterator next_prob();
32 
33 protected:
34  void fetch_next();
35 
36  void enqueue_split(BranchNode::Split prob_array);
37 };
38 
42 
46 
50 class InterBrancher : public BaseBrancher {
51 public:
52  InterBrancher(const Data::Instance &inst, const Data::BestGroup &best_data,
53  const Graph::CoreGraph &core_graph, LP::CoreLP &core_lp);
54 
55  BranchHistory::iterator next_prob();
56 
57 protected:
58  void fetch_next();
59  void enqueue_split(BranchNode::Split prob_array);
60 
61 private:
62  static constexpr int BestFreq = 10;
63  int node_num = 1;
64 
72 
74  static void heap_push(std::vector<BranchHistory::iterator> &target_q,
75  BranchHistory::iterator itr);
76 
77  static void heap_make(std::vector<BranchHistory::iterator> &target_q);
78 
79  static void heap_pop(std::vector<BranchHistory::iterator> &target_q);
80 
83  static bool better_bound(const BranchHistory::iterator &A,
84  const BranchHistory::iterator &B)
85  { return A->estimate < B->estimate; }
86 
88 
89  std::vector<BranchHistory::iterator> prob_q;
90 };
91 
92 }
93 }
94 
95 #endif
BranchHistory::iterator next_prob()
Return the next subproblem to be examined.
Definition: dfs_brancher.cpp:63
Information about the current best tour.
Definition: datagroups.hpp:154
Depth-first search branching.
Definition: abc_nodesel.hpp:26
Data group structures.
ABC search nodes.
Graph structures for the edges currently in a CoreLP::Relaxation.
Definition: datagroups.hpp:100
Storing TSP instance data.
Definition: datagroups.hpp:36
static bool better_bound(const BranchHistory::iterator &A, const BranchHistory::iterator &B)
returns true iff A has a better (i.e., lower )estimate than B.
Definition: abc_nodesel.hpp:83
Abstract base class for implementing a branching node selection rule.
Definition: base_brancher.hpp:20
void fetch_next()
Set next_itr to the next subproblem to be examined.
Definition: dfs_brancher.cpp:81
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
void enqueue_split(BranchNode::Split prob_array)
If applicable, this method will swap the position of nodes in prob_array to ensure that the node agre...
Definition: dfs_brancher.cpp:36
Interleaved best-estimate and best-first search branching.
Definition: abc_nodesel.hpp:50
Class for storing the core lp associated to a TSP instance and pivoting.
Definition: core_lp.hpp:33
Abstract branching control.
Monitoring the active tour in the solution process.
Template classes/methods for branching by priority queue.