Graph Convolutional Branch and Bound v1.0.0
A TSP solver that combines a graph convolutional network with a 1-Tree branch-and-bound.
Loading...
Searching...
No Matches
branch_and_bound.h
Go to the documentation of this file.
1
14#ifndef BRANCHANDBOUND1TREE_BRANCH_AND_BOUND_H
15#define BRANCHANDBOUND1TREE_BRANCH_AND_BOUND_H
16#include "kruskal.h"
17#include "prim.h"
18#include "../data_structures/b_and_b_data.h"
19
20
23
24
26
30void dfs(SubProblem *subProblem);
31
32
34
40bool check_hamiltonian(SubProblem *subProblem);
41
42
44
50BBNodeType mst_to_one_tree(SubProblem *currentSubproblem, Graph *graph);
51
52
54
58void clean_matrix(SubProblem *subProblem);
59
60
62
68void copy_constraints(SubProblem *subProblem, const SubProblem *otherSubProblem);
69
70
72
78bool compare_subproblems(const SubProblem *a, const SubProblem *b);
79
80
82
88void branch(SubProblemsList *openSubProblems, SubProblem *subProblem);
89
90
92
98int variable_fixing (SubProblem * subProblem);
99
100
102
108bool infer_constraints(SubProblem * subProblem);
109
110
112
117void bound(SubProblem *currentSubProb);
118
119
121
125bool time_limit_reached(void);
126
127
129
135void nearest_prob_neighbour(unsigned short start_node);
136
137
139
144unsigned short find_candidate_node(void);
145
146
148
153void branch_and_bound(Problem * current_problem);
154
155
157
162bool check_feasibility(Graph * graph);
163
164
166
170void set_problem(Problem * current_problem);
171
172
174
178void print_subProblem(const SubProblem *subProblem);
179
180
182
185void print_problem(void);
186
187
188#endif //BRANCHANDBOUND1TREE_BRANCH_AND_BOUND_H
BBNodeType
The labels used to identify the type of a SubProblem.
Definition: b_and_b_data.h:22
BBNodeType mst_to_one_tree(SubProblem *currentSubproblem, Graph *graph)
Transforms a MST into a 1Tree.
void clean_matrix(SubProblem *subProblem)
Clean the matrix of constraints of a SubProblem.
static Problem * problem
The pointer to the problem to solve.
bool compare_subproblems(const SubProblem *a, const SubProblem *b)
Compare two OPEN SubProblems.
bool check_feasibility(Graph *graph)
Check if the Graph associated to the Problem is feasible.
void branch(SubProblemsList *openSubProblems, SubProblem *subProblem)
The Shutler's branching rule.
void branch_and_bound(Problem *current_problem)
The Branch and Bound algorithm.
void nearest_prob_neighbour(unsigned short start_node)
This function is used to find the first feasible tour.
void dfs(SubProblem *subProblem)
A Depth First Search algorithm on a Graph.
int variable_fixing(SubProblem *subProblem)
The function used to fix the edge variables to be mandatory or forbidden.
void copy_constraints(SubProblem *subProblem, const SubProblem *otherSubProblem)
Copy the matrix of constraints of a SubProblem into another.
void print_subProblem(const SubProblem *subProblem)
Get all metrics of a certain SubProblem.
unsigned short find_candidate_node(void)
Select the candidate Node, i.e. the starting vertex of the tour.
bool check_hamiltonian(SubProblem *subProblem)
Function that checks if the 1Tree of a SubProblem is a tour.
bool infer_constraints(SubProblem *subProblem)
Infer the values of some edge variables of a SubProblem.
void set_problem(Problem *current_problem)
Define the problem to solve.
void bound(SubProblem *currentSubProb)
The Held-Karp bound function with the subgradient algorithm.
bool time_limit_reached(void)
Check if the time limit has been reached.
void print_problem(void)
Get all metrics of the problem.
The declaration of the functions needed to compute the MST with Kruskal's algorithm.
The declaration of the functions needed to compute the MST with Prim's algorithm.
Structure of a Graph.
Definition: graph.h:51
The struct used to represent the overall problem.
Definition: b_and_b_data.h:62
The struct used to represent a SubProblem or node of the Branch and Bound tree.
Definition: b_and_b_data.h:42
The list of open SubProblems.
Definition: b_and_b_data.h:87