14 #include "network/type.hpp"
15 #include "fiboheap/fiboheap.h"
48 HeapNodeHandle handle = heap.push({index,value});
49 handle_data.insert({index,handle});
56 handle_data.erase(node.
index);
77 inline unsigned int size(){
86 return handle_data.find(index)!=handle_data.end();
94 HeapNodeHandle handle = handle_data[index];
95 heap.decrease_key(handle,{index,value});
99 typedef FibHeap<HeapNode>::FibNode *HeapNodeHandle;
100 FibHeap<HeapNode> heap;
101 std::unordered_map<NodeIndex,HeapNodeHandle> handle_data;
Heap data structure used in the routing query
bool operator<(const HeapNode &rhs) const
Compare two nodes in the heap.
void decrease_key(NodeIndex index, double value)
Decrease a node in the heap.
HeapNode top()
Get a copy of the top node in the heap.
void push(NodeIndex index, double value)
Push a node into the heap.
Node in the heap structure.
NodeIndex index
Index of a node in the heap.
void pop()
Pop a node from the heap.
bool empty()
Check if the heap is empty.
bool contain_node(NodeIndex index)
Check if the heap contains a node.
unsigned int size()
Get the size of the heap.
unsigned int NodeIndex
Node Index in the network, range from [0,num_vertices-1 ].
double value
Value of a node in the heap.