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

All the functions needed to manage the list of open subproblems. More...

#include "b_and_b_data.h"

Go to the source code of this file.

Functions

void new_SubProblemList (SubProblemsList *list)
 Create a new SubProblem List.
 
void delete_SubProblemList (SubProblemsList *list)
 Delete a SubProblem List.
 
bool is_SubProblemList_empty (SubProblemsList *list)
 Check if a SubProblem List is empty.
 
SubProblemElembuild_list_elem (SubProblem *value, SubProblemElem *next, SubProblemElem *prev)
 
size_t get_SubProblemList_size (SubProblemsList *list)
 Get the size of a SubProblem List.
 
void add_elem_SubProblemList_bottom (SubProblemsList *list, SubProblem *element)
 Add a SubProblem to the bottom of a SubProblem List.
 
void add_elem_SubProblemList_index (SubProblemsList *list, SubProblem *element, size_t index)
 Add a SubProblem at a specific index of a SubProblem List.
 
void delete_SubProblemList_elem_index (SubProblemsList *list, size_t index)
 Remove a SubProblem from a specific index of a SubProblem List.
 
SubProblemget_SubProblemList_elem_index (SubProblemsList *list, size_t index)
 Get a SubProblem from a specific index of a SubProblem List.
 
SubProblemsListIteratorcreate_SubProblemList_iterator (SubProblemsList *list)
 Create a new SubProblem List iterator on a SubProblem List.
 
bool is_SubProblemList_iterator_valid (SubProblemsListIterator *iterator)
 Check if a SubProblem List iterator is valid.
 
SubProblemget_current_openSubProblemList_iterator_element (SubProblemsListIterator *iterator)
 
void list_openSubProblemList_next (SubProblemsListIterator *iterator)
 
SubProblemSubProblemList_iterator_get_next (SubProblemsListIterator *iterator)
 Get the next element of a SubProblem List iterator.
 
void delete_SubProblemList_iterator (SubProblemsListIterator *iterator)
 Delete a SubProblem List iterator.
 

Detailed Description

All the functions needed to manage the list of open subproblems.

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

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

Definition in file b_and_b_data.c.

Function Documentation

◆ add_elem_SubProblemList_bottom()

void add_elem_SubProblemList_bottom ( SubProblemsList list,
SubProblem element 
)

Add a SubProblem to the bottom of a SubProblem List.

Parameters
listThe SubProblem List to modify.
elementThe SubProblem to add.

Definition at line 59 of file b_and_b_data.c.

◆ add_elem_SubProblemList_index()

void add_elem_SubProblemList_index ( SubProblemsList list,
SubProblem element,
size_t  index 
)

Add a SubProblem at a specific index of a SubProblem List.

Parameters
listThe SubProblem List to modify.
elementThe SubProblem to add.
indexThe index where to add the SubProblem.

list is clearer way but it is already checked inside get_list_size

Definition at line 75 of file b_and_b_data.c.

◆ build_list_elem()

SubProblemElem * build_list_elem ( SubProblem value,
SubProblemElem next,
SubProblemElem prev 
)

Definition at line 44 of file b_and_b_data.c.

◆ create_SubProblemList_iterator()

SubProblemsListIterator * create_SubProblemList_iterator ( SubProblemsList list)

Create a new SubProblem List iterator on a SubProblem List.

Parameters
listThe SubProblem List to iterate.
Returns
the SubProblem List iterator.

Definition at line 159 of file b_and_b_data.c.

◆ delete_SubProblemList()

void delete_SubProblemList ( SubProblemsList list)

Delete a SubProblem List.

Parameters
listThe SubProblem List to delete.

Definition at line 23 of file b_and_b_data.c.

◆ delete_SubProblemList_elem_index()

void delete_SubProblemList_elem_index ( SubProblemsList list,
size_t  index 
)

Remove a SubProblem from a specific index of a SubProblem List.

Parameters
listThe SubProblem List to modify.
indexThe index of the SubProblem to remove.

Definition at line 113 of file b_and_b_data.c.

◆ delete_SubProblemList_iterator()

void delete_SubProblemList_iterator ( SubProblemsListIterator iterator)

Delete a SubProblem List iterator.

Parameters
iteratorThe SubProblem List iterator.

Definition at line 198 of file b_and_b_data.c.

◆ get_current_openSubProblemList_iterator_element()

SubProblem * get_current_openSubProblemList_iterator_element ( SubProblemsListIterator iterator)

Definition at line 174 of file b_and_b_data.c.

◆ get_SubProblemList_elem_index()

SubProblem * get_SubProblemList_elem_index ( SubProblemsList list,
size_t  index 
)

Get a SubProblem from a specific index of a SubProblem List.

Parameters
listThe SubProblem List to inspect.
indexThe index of the SubProblem to get.
Returns
The SubProblem at the specified index.

Definition at line 146 of file b_and_b_data.c.

◆ get_SubProblemList_size()

size_t get_SubProblemList_size ( SubProblemsList list)

Get the size of a SubProblem List.

Parameters
listThe SubProblem List to inspect.
Returns
The size of the SubProblem List.

Definition at line 54 of file b_and_b_data.c.

◆ is_SubProblemList_empty()

bool is_SubProblemList_empty ( SubProblemsList list)

Check if a SubProblem List is empty.

Parameters
listThe SubProblem List to check.
Returns
True if the SubProblem List is empty, false otherwise.

Definition at line 39 of file b_and_b_data.c.

◆ is_SubProblemList_iterator_valid()

bool is_SubProblemList_iterator_valid ( SubProblemsListIterator iterator)

Check if a SubProblem List iterator is valid.

An iterator is valid if it is not NULL and if the current element is not NULL.

Parameters
iteratorThe SubProblem List iterator to check.
Returns
True if the SubProblem List iterator is valid, false otherwise.

Definition at line 170 of file b_and_b_data.c.

◆ list_openSubProblemList_next()

void list_openSubProblemList_next ( SubProblemsListIterator iterator)

Definition at line 178 of file b_and_b_data.c.

◆ new_SubProblemList()

void new_SubProblemList ( SubProblemsList list)

Create a new SubProblem List.

Parameters
listThe SubProblem List to create.

Definition at line 17 of file b_and_b_data.c.

◆ SubProblemList_iterator_get_next()

SubProblem * SubProblemList_iterator_get_next ( SubProblemsListIterator iterator)

Get the next element of a SubProblem List iterator.

Parameters
iteratorThe SubProblem List iterator.
Returns
The next element of the List pointed by the iterator.

Definition at line 188 of file b_and_b_data.c.