Graph Convolutional Branch and Bound v1.0.0
A TSP solver that combines a graph convolutional network with a 1-Tree branch-and-bound.
|
The declaration of the functions needed to compute the MST with Kruskal's algorithm. More...
#include "../data_structures/mst.h"
Go to the source code of this file.
Functions | |
static void | swap (Graph *graph, unsigned short swap_1, unsigned short swap_2) |
Swaps two edges in the list of edges in the Graph. | |
static int | pivot_quicksort (Graph *graph, unsigned short first, unsigned short last) |
The core of the quick sort algorithm. | |
static void | quick_sort (Graph *graph, unsigned short first, unsigned short last) |
The quick sort algorithm O(n log n). | |
void | wrap_quick_sort (Graph *graph) |
The wrapper of the quick sort algorithm. | |
void | kruskal (Graph *graph, MST *mst) |
The Kruskal algorithm to find the Minimum Spanning Tree O(|E| log |V|) | |
The declaration of the functions needed to compute the MST with Kruskal's algorithm.
This file contains the declaration of the Kruskal algorithm to find the Minimum Spanning Tree.
Repo: https://github.com/LorenzoSciandra/GraphConvolutionalBranchandBound
Definition in file kruskal.h.
|
static |
The core of the quick sort algorithm.
This function find the pivot position to recursively call the quick sort algorithm. While doing this all the edges with weight less than the pivot are moved to the left of the pivot and to the right otherwise.
graph | The Graph to which we want to sort the edges. |
first | The index of the first Edge to consider in the list of edges. |
last | The index of the last Edge to consider in the list of edges. |
|
static |
The quick sort algorithm O(n log n).
It is used to sort the edges of the Graph in ascending order in O(n log n). It is recursive.
|
static |