40 return (list == NULL || list->
size == 0);
55 return (list != NULL) ? list->
size : 0;
85 for (
size_t i = 0; i < index; ++i)
88 if (supp == list->
head) {
119 oldElem = list->
head;
121 for (
size_t i = 0; i < index; ++i)
122 oldElem = oldElem->
next;
125 if (oldElem != list->
head) {
127 if (oldElem->
next != NULL) {
154 for (
size_t i = 0; i < index; ++i)
164 new_iterator->
list = list;
166 new_iterator->
index = 0;
void add_elem_SubProblemList_index(SubProblemsList *list, SubProblem *element, size_t index)
Add a SubProblem at a specific index of a SubProblem List.
SubProblemElem * build_list_elem(SubProblem *value, SubProblemElem *next, SubProblemElem *prev)
void list_openSubProblemList_next(SubProblemsListIterator *iterator)
bool is_SubProblemList_iterator_valid(SubProblemsListIterator *iterator)
Check if a SubProblem List iterator is valid.
SubProblem * get_SubProblemList_elem_index(SubProblemsList *list, size_t index)
Get a SubProblem from a specific index of a SubProblem List.
void delete_SubProblemList_iterator(SubProblemsListIterator *iterator)
Delete a SubProblem List iterator.
size_t get_SubProblemList_size(SubProblemsList *list)
Get the size 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.
void add_elem_SubProblemList_bottom(SubProblemsList *list, SubProblem *element)
Add a SubProblem to the bottom of a SubProblem List.
SubProblemsListIterator * create_SubProblemList_iterator(SubProblemsList *list)
Create a new SubProblem List iterator on a SubProblem List.
void new_SubProblemList(SubProblemsList *list)
Create a new SubProblem List.
bool is_SubProblemList_empty(SubProblemsList *list)
Check if a SubProblem List is empty.
void delete_SubProblemList(SubProblemsList *list)
Delete a SubProblem List.
SubProblem * get_current_openSubProblemList_iterator_element(SubProblemsListIterator *iterator)
SubProblem * SubProblemList_iterator_get_next(SubProblemsListIterator *iterator)
Get the next element of a SubProblem List iterator.
The data structures used in the Branch and Bound algorithm.
The element of the list of SubProblems.
SubProblem subProblem
The SubProblem.
struct SubProblemElem * next
The next element of the list.
struct SubProblemElem * prev
The previous element of the list.
The struct used to represent a SubProblem or node of the Branch and Bound tree.
The iterator of the list of SubProblems.
size_t index
The index of the current element of the list.
SubProblemsList * list
The list to iterate.
SubProblemElem * curr
The current element of the list.
The list of open SubProblems.
SubProblemElem * tail
The tail of the list.
SubProblemElem * head
The head of the list.
size_t size
The size of the list.