Camargue
branch_tour.hpp
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
5 
6 #ifndef CMR_BRANCH_TOUR_H
7 #define CMR_BRANCH_TOUR_H
8 
9 #include "branch_node.hpp"
10 #include "datagroups.hpp"
11 #include "graph.hpp"
12 #include "core_lp.hpp"
13 #include "edgehash.hpp"
14 
15 #include <utility>
16 #include <vector>
17 
18 
19 namespace CMR {
20 namespace ABC {
21 
24 public:
25  BranchTourFind(const Data::Instance &inst, const Data::BestGroup &bestdata,
26  const Graph::CoreGraph &coregraph, LP::CoreLP &corelp);
27 
29  void instate_branch_tour(const BranchNode &B, bool &found_tour,
30  std::vector<int> &tour);
31 
33  void estimate_tour(const std::vector<EndsDir> &constraints,
34  bool &feas, double &tour_val);
35 
36  void prune_edges();
37 
39  bool tour_compliant(const std::vector<int> &tour,
40  const std::vector<EndsDir> &constraints);
41 
43  bool obvious_infeas(const std::vector<EndsDir> &constraints);
44 
46  void compute_tour(const std::vector<EndsDir> &edge_stats,
47  bool &found_tour, bool &feas,
48  std::vector<int> &tour, double &tour_val,
49  bool for_use);
50 
52  std::vector<EndsDir> common_constraints(const BranchNode &parent,
53  const EndPts &branch_edge);
54 
56  std::vector<EndsDir> branch_constraints(const BranchNode &N);
57 
58  int verbose = 0;
59 
60 private:
62  Graph::AdjList get_fixed_adj(const std::vector<EndsDir> &constraints);
63 
64 
65  const Data::Instance &tsp_inst;
66  const Data::BestGroup &best_data;
67  const Graph::CoreGraph &core_graph;
68  LP::CoreLP &core_lp;
69 
70  std::vector<int> fix_degrees;
71 
74  enum EdgeStats : int {
75  Core = 0,
76  Supply = 1,
77  Added = 2,
78  };
79 
81  std::vector<Graph::Edge> extra_edges;
82 
85 
90 };
91 
92 }
93 }
94 
95 #endif
EdgeStats
Values to be assigned in the BranchTourFind::tour_edge_tracker.
Definition: branch_tour.hpp:74
void prune_edges()
Prune edges which were added by branch tours.
Definition: branch_tour.cpp:194
std::vector< Graph::Edge > extra_edges
Extra edges for tour finding.
Definition: branch_tour.hpp:81
util::EdgeHash tour_edge_tracker
Tracking edges added by branch tours.
Definition: branch_tour.hpp:80
int large_length
Large length for sparse instances.
Definition: branch_tour.hpp:89
Header for classes/structures/functions to work with graphs.
Information about the current best tour.
Definition: datagroups.hpp:154
Hash map for node pairs representing edges.
Definition: edgehash.hpp:24
void instate_branch_tour(const BranchNode &B, bool &found_tour, std::vector< int > &tour)
Compute a tour to be instated at B, modifying the core LP if needed.
Definition: branch_tour.cpp:109
Edge added to the core LP from starting set or pricing.
Definition: branch_tour.hpp:75
std::vector< EndsDir > common_constraints(const BranchNode &parent, const EndPts &branch_edge)
Compute a list of common constraints for splitting on parent.
Definition: branch_tour.cpp:243
Data group structures.
Compute branch tours for estimation and instatement, managing their edges.
Definition: branch_tour.hpp:23
ABC search nodes.
Graph structures for the edges currently in a CoreLP::Relaxation.
Definition: datagroups.hpp:100
void estimate_tour(const std::vector< EndsDir > &constraints, bool &feas, double &tour_val)
Compute a branch tour estimate, returning feasibility and tour length.
Definition: branch_tour.cpp:173
Storing TSP instance data.
Definition: datagroups.hpp:36
An edge added by chained LK in finding a branch tour.
Definition: branch_tour.hpp:77
std::vector< EndsDir > branch_constraints(const BranchNode &N)
Compute a list of branch constraints for N and all its ancestors.
Definition: branch_tour.cpp:272
void compute_tour(const std::vector< EndsDir > &edge_stats, bool &found_tour, bool &feas, std::vector< int > &tour, double &tour_val, bool for_use)
Call chained Lin-Kernighan to compute a branch tour.
Definition: branch_tour.cpp:396
std::vector< int > fix_degrees
Tracking degrees for fixed up edges.
Definition: branch_tour.hpp:70
An edge from BranchTourFind::extra_edges.
Definition: branch_tour.hpp:76
bool obvious_infeas(const std::vector< EndsDir > &constraints)
Does constraints have obvious over-fixing infeasibilities.
Definition: branch_tour.cpp:368
The namespace for this project.
Definition: abc_nodesel.hpp:20
Hash map for graph edges.
Class for storing the core lp associated to a TSP instance and pivoting.
Definition: core_lp.hpp:33
Representation of a graph as an adjacency list.
Definition: graph.hpp:80
bool tour_compliant(const std::vector< int > &tour, const std::vector< EndsDir > &constraints)
Is the tour compliant with constraints.
Definition: branch_tour.cpp:316
Definition: branch_node.hpp:25
Simple base class for storing edge of a graph as a sorted pair of nodes.
Definition: util.hpp:239
Managing Core LP relaxations of TSP instances.
Graph::AdjList get_fixed_adj(const std::vector< EndsDir > &constraints)
Construct a Graph::AdjList recording constraints.
Definition: branch_tour.cpp:289
int default_length
Default length assigned to edges not explictly in sparse instances.
Definition: branch_tour.hpp:84