|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
42 template<
typename Graph,
typename Flags = datastructure::TimestampFlags>
45 using Node =
typename Graph::Node;
46 using Edge =
typename Graph::Edge;
60 static bool expand_all(
typename Graph::Node,
typename Graph::Edge) {
return true; }
77 template<
typename Range,
typename FWeight,
typename FSettle,
typename FExpand,
typename FTraverse>
78 bool traverse(
const Range& sources, FWeight&& weight, FSettle&& settle, FExpand&& expand,
79 FTraverse&& f_traverse) {
83 for (
auto v : sources) {
91 const double current_weight =
distances[v->index()];
94 settle(v, current_weight);
96 const Node w = e->opposite(v);
98 if (!
visited.is_set(w->index())) {
100 distances[w->index()] = current_weight + weight(v, e);
103 }
else if (current_weight + weight(v, e) <
distances[w->index()]) {
104 distances[w->index()] = current_weight + weight(v, e);
120 template<
typename FWeight,
typename FSettle,
typename FExpand,
typename FTraverse>
122 FTraverse&& f_traverse) {
123 return traverse(std::vector<Node>(1, source), weight, settle, expand, f_traverse);
The namespace for all OGDF objects.
static void settle_nothing(typename Graph::Node, double weight)
Priority queue interface wrapping various heaps.
bool traverse_single(const Node &source, FWeight &&weight, FSettle &&settle, FExpand &&expand, FTraverse &&f_traverse)
void decrease(Handle pos, const P &priority)
Defines a queue for handling prioritized elements.
void clear()
Removes all the entries from the queue.
typename Heap::Handle Element
void pop()
Removes the top element from the heap.
static bool expand_all(typename Graph::Node, typename Graph::Edge)
bool empty() const
Checks whether the queue is empty.
Handle push(const E &element, const P &priority)
Pushes a new element with the respective priority to the queue.
static void traverse_nothing(typename Graph::Node, typename Graph::Edge)
typename Graph::Edge Edge
bool traverse(const Range &sources, FWeight &&weight, FSettle &&settle, FExpand &&expand, FTraverse &&f_traverse)
Data type for general directed graphs (adjacency list representation).
Simple before-C++20 version for std::ranges::ref_view.
const E & topElement() const
Returns the topmost element in the queue.
internal::GraphObjectContainer< EdgeElement > edges
The container containing all edge objects.
Dijkstra(const Graph &_graph)
typename Graph::Node Node
typename SuperQueue::handle Handle
The type of handle for accessing the elements of this queue.
std::vector< Element > reference
std::vector< double > distances