Graph Convolutional Branch and Bound v1.0.0
A TSP solver that combines a graph convolutional network with a 1-Tree branch-and-bound.
|
This file contains the declaration of the Fibonacci Heap datastructure for the Minimum Spanning Tree problem. More...
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include <assert.h>
#include <stdbool.h>
#include <float.h>
#include <math.h>
Go to the source code of this file.
Classes | |
struct | OrdTreeNode |
A Heap-ordered Tree Node where the key of the parent is <= the key of its children. More... | |
struct | FibonacciHeap |
The Fibonacci Heap datastructure as collection of Heap-ordered Trees. More... | |
Macros | |
#define | BRANCHANDBOUND1TREE_FIBONACCI_HEAP_H |
Typedefs | |
typedef struct OrdTreeNode | OrdTreeNode |
A Heap-ordered Tree Node where the key of the parent is <= the key of its children. | |
typedef struct FibonacciHeap | FibonacciHeap |
The Fibonacci Heap datastructure as collection of Heap-ordered Trees. | |
Functions | |
void | create_fibonacci_heap (FibonacciHeap *heap) |
Create an empty Fibonacci Heap. | |
void | create_node (OrdTreeNode *node, unsigned short key, double value) |
Create a Node with a given key and value. | |
void | insert_node (FibonacciHeap *heap, OrdTreeNode *node) |
Insert a Node in the Fibonacci Heap. | |
void | create_insert_node (FibonacciHeap *heap, OrdTreeNode *node, unsigned short key, double value) |
A wrapper function to create a Node and insert it in the Fibonacci Heap. | |
int | extract_min (FibonacciHeap *heap) |
Extract the minimum Node from the Fibonacci Heap. | |
void | decrease_value (FibonacciHeap *heap, OrdTreeNode *node, double new_value) |
Decrease the value of a Node in the Fibonacci Heap. | |
This file contains the declaration of the Fibonacci Heap datastructure for the Minimum Spanning Tree problem.
Repo: https://github.com/LorenzoSciandra/GraphConvolutionalBranchandBound
Definition in file fibonacci_heap.h.
#define BRANCHANDBOUND1TREE_FIBONACCI_HEAP_H |
Definition at line 22 of file fibonacci_heap.h.
typedef struct FibonacciHeap FibonacciHeap |
The Fibonacci Heap datastructure as collection of Heap-ordered Trees.
typedef struct OrdTreeNode OrdTreeNode |
A Heap-ordered Tree Node where the key of the parent is <= the key of its children.
void create_fibonacci_heap | ( | FibonacciHeap * | heap | ) |
Create an empty Fibonacci Heap.
heap | The Fibonacci Heap to be created. |
Definition at line 16 of file fibonacci_heap.c.
void create_insert_node | ( | FibonacciHeap * | heap, |
OrdTreeNode * | node, | ||
unsigned short | key, | ||
double | value | ||
) |
void create_node | ( | OrdTreeNode * | node, |
unsigned short | key, | ||
double | value | ||
) |
void decrease_value | ( | FibonacciHeap * | heap, |
OrdTreeNode * | node, | ||
double | new_value | ||
) |
Decrease the value of a Node in the Fibonacci Heap.
If the new value is still greater than the parent's value, nothing happens. Otherwise, the Node becomes a root. If the parent is marked, and is not a root, it becomes a root. This process is repeated until a parent is not marked or is a root.
heap | The Fibonacci Heap where the Node is. |
node | The Node whose value has to be decreased. |
new_value | The new value of the Node. |
Definition at line 294 of file fibonacci_heap.c.
int extract_min | ( | FibonacciHeap * | heap | ) |
Extract the minimum Node from the Fibonacci Heap.
All the children of the minimum Node become new roots. The new minimum has to be found and, by doing so, the Heap is re-ordered to maintain the Heap property and minimize the height of the Heap-ordered Trees.
heap | The Fibonacci Heap where the Node will be extracted. |
Definition at line 175 of file fibonacci_heap.c.
void insert_node | ( | FibonacciHeap * | heap, |
OrdTreeNode * | node | ||
) |
Insert a Node in the Fibonacci Heap.
Definition at line 38 of file fibonacci_heap.c.