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
Functions
mst.c File Reference

This file contains the definition of the Minimum Spanning Tree operations. More...

#include "mst.h"

Go to the source code of this file.

Functions

void create_mst (MST *mst, const Node *nodes, unsigned short num_nodes)
 Create a Minimum Spanning Tree from a set of Nodes.
 
void add_edge (MST *tree, const Edge *edge)
 Add an Edge to the MST.
 
void print_mst (const MST *tree)
 Print the MST, printing all the information it contains.
 
void print_mst_original_weight (const MST *tree, const Graph *graph)
 Print the MST, printing all the information it contains.
 

Detailed Description

This file contains the definition of the Minimum Spanning Tree operations.

Author
Lorenzo Sciandra
Version
1.0.0 @data 2024-05-1

Repo: https://github.com/LorenzoSciandra/GraphConvolutionalBranchandBound

Definition in file mst.c.

Function Documentation

◆ add_edge()

void add_edge ( MST tree,
const Edge edge 
)

Add an Edge to the MST.

Parameters
treeThe Minimum Spanning Tree.
edgeThe Edge to add.

Definition at line 38 of file mst.c.

◆ create_mst()

void create_mst ( MST mst,
const Node nodes,
unsigned short  num_nodes 
)

Create a Minimum Spanning Tree from a set of Nodes.

Parameters
mstThe Minimum Spanning Tree to be initialized.
nodesThe set of Nodes.
num_nodesThe number of Nodes.

Definition at line 17 of file mst.c.

◆ print_mst()

void print_mst ( const MST mst)

Print the MST, printing all the information it contains.

Parameters
treeThe Minimum Spanning Tree.

Definition at line 70 of file mst.c.

◆ print_mst_original_weight()

void print_mst_original_weight ( const MST mst,
const Graph graph 
)

Print the MST, printing all the information it contains.

This method is used to print a 1Tree with original. Edge weights, since in the branch and bound algorithm, with the dual procedure the Edge weights are changed.

Parameters
treeThe Minimum Spanning Tree.
graphThe Graph from which the MST was created.

Definition at line 92 of file mst.c.