Fibonacci heap implementation.
More...
#include <ogdf/basic/heap/FibonacciHeap.h>
template<typename T, typename C = std::less<T>>
class ogdf::FibonacciHeap< T, C >
Fibonacci heap implementation.
This implementation is based on Wikipedia article, original paper by Fredman and Tarjan and borrows some ideas from: http://www.cs.princeton.edu/~wayne/cs423/fibonacci/FibonacciHeapAlgorithm.html
- Template Parameters
-
T | Denotes value type of inserted elements. |
C | Denotes comparison functor determining value ordering. |
Definition at line 89 of file FibonacciHeap.h.
◆ base_type
template<typename T , typename C = std::less<T>>
◆ FibonacciHeap()
template<typename T , typename C >
Creates empty Fibonacci heap.
- Parameters
-
cmp | Comparison functor determining value ordering. |
initialSize | ignored by this implementation. |
Definition at line 185 of file FibonacciHeap.h.
◆ ~FibonacciHeap()
template<typename T , typename C >
Destructs the heap.
If the heap is not empty, destructors of contained elements are called and used storage is deallocated.
Definition at line 191 of file FibonacciHeap.h.
◆ compress()
template<typename T , typename C >
Reduces number of trees inside a heap by linking ones with same degree.
Definition at line 294 of file FibonacciHeap.h.
◆ decrease()
template<typename T , typename C >
Decreases value of the given heapNode
to value
.
Behaviour of this function is undefined if node does not belong to a the heap or new value is greater than old one.
- Parameters
-
heapNode | A node for which the value is to be decreased. |
value | A new value for the node. |
Definition at line 252 of file FibonacciHeap.h.
◆ detach()
template<typename T , typename C >
Detaches given heapNode
from its list and makes it self-circulate.
Definition at line 338 of file FibonacciHeap.h.
◆ link()
template<typename T , typename C >
◆ merge() [1/2]
template<typename T , typename C >
Merges in values of other
heap.
After merge other
heap becomes empty and is valid for further usage.
- Parameters
-
other | A heap to be merged in. |
Definition at line 262 of file FibonacciHeap.h.
◆ merge() [2/2]
template<typename T , typename C >
◆ pop()
template<typename T , typename C >
◆ push()
template<typename T , typename C >
◆ release()
template<typename T , typename C >
Recursively releases memory starting at heapNode
.
Definition at line 196 of file FibonacciHeap.h.
◆ remove()
template<typename T , typename C >
Removes minimal tree and moves its children to tree list.
Definition at line 278 of file FibonacciHeap.h.
◆ restore()
template<typename T , typename C >
Restores heap ordering in heapNode
by making (cascade) cut.
Definition at line 363 of file FibonacciHeap.h.
◆ splice()
template<typename T , typename C >
Moves heapNode
from its list to the target
list.
Definition at line 354 of file FibonacciHeap.h.
◆ top()
template<typename T , typename C >
Returns reference to the top element in the heap.
Definition at line 212 of file FibonacciHeap.h.
◆ value()
template<typename T , typename C = std::less<T>>
Returns the value of the node.
- Parameters
-
- Returns
- the value of the node
Definition at line 153 of file FibonacciHeap.h.
◆ m_knot
template<typename T , typename C = std::less<T>>
Used for efficient tree list manipulation.
Definition at line 159 of file FibonacciHeap.h.
◆ m_minimal
template<typename T , typename C = std::less<T>>
Handle to the tree with lowest root priority.
Definition at line 157 of file FibonacciHeap.h.
◆ m_ranked
template<typename T , typename C = std::less<T>>
The documentation for this class was generated from the following file: