52template<
typename T,
template<
typename P,
class C>
class H = PairingHeap>
74 distance.
init(G, std::numeric_limits<T>::max());
75 predecessor.
init(G,
nullptr);
87 for (
node v : G.nodes) {
88 queue.push(v, distance[v]);
91 queue.decrease(s, (distance[s] = 0));
100 while (!
queue.empty()) {
108 edge e = adj->theEdge();
109 node w = adj->twinNode();
116 if (
m_eps.
greater(distance[w], distance[v] + weight[e])) {
117 OGDF_ASSERT(std::numeric_limits<T>::max() - weight[e] >= distance[v]);
118 queue.decrease(w, (distance[w] = distance[v] + weight[e]));
142 distance.
init(G, std::numeric_limits<T>::max());
143 predecessor.
init(G,
nullptr);
147 queue.push(s, (distance[s] = 0));
156 while (!
queue.empty()) {
168 edge e = adj->theEdge();
169 node w = adj->twinNode();
182 OGDF_ASSERT(std::numeric_limits<T>::max() - weight[e] >= distance[v]);
184 if (
queue.contains(w)) {
185 queue.decrease(w, distance[w]);
187 queue.push(w, distance[w]);
228 T
maxLength = std::numeric_limits<T>::max()) {
249 T
maxLength = std::numeric_limits<T>::max()) {
250 if (target ==
nullptr &&
maxLength == std::numeric_limits<T>::max()) {
271 node target =
nullptr, T
maxLength = std::numeric_limits<T>::max()) {
272 if (target ==
nullptr &&
maxLength == std::numeric_limits<T>::max()) {
Compare floating point numbers with epsilons and integral numbers with normal compare operators.
Includes declaration of graph class.
Priority queue interface wrapping various heaps.
Class for adjacency list elements.
Dijkstra's single source shortest path algorithm.
void call(const Graph &G, const EdgeArray< T > &weight, const List< node > &sources, NodeArray< edge > &predecessor, NodeArray< T > &distance, bool directed=false, bool arcsReversed=false, node target=nullptr, T maxLength=std::numeric_limits< T >::max())
Calculates, based on the graph G with corresponding edge costs and source nodes, the shortest paths a...
void callUnbound(const Graph &G, const EdgeArray< T > &weight, const List< node > &sources, NodeArray< edge > &predecessor, NodeArray< T > &distance, bool directed=false, bool arcsReversed=false)
Calculates, based on the graph G with corresponding edge costs and source nodes, the shortest paths a...
void callUnbound(const Graph &G, const EdgeArray< T > &weight, node s, NodeArray< edge > &predecessor, NodeArray< T > &distance, bool directed=false, bool arcsReversed=false)
Calculates, based on the graph G with corresponding edge costs and a source node s,...
void call(const Graph &G, const EdgeArray< T > &weight, const node s, NodeArray< edge > &predecessor, NodeArray< T > &distance, bool directed=false, bool arcsReversed=false, node target=nullptr, T maxLength=std::numeric_limits< T >::max())
Calculates, based on the graph G with corresponding edge costs and a source node s,...
void callBound(const Graph &G, const EdgeArray< T > &weight, node s, NodeArray< edge > &predecessor, NodeArray< T > &distance, bool directed, bool arcsReversed, node target, T maxLength=std::numeric_limits< T >::max())
Calculates, based on the graph G with corresponding edge costs and a source node s,...
void callBound(const Graph &G, const EdgeArray< T > &weight, const List< node > &sources, NodeArray< edge > &predecessor, NodeArray< T > &distance, bool directed, bool arcsReversed, node target, T maxLength=std::numeric_limits< T >::max())
Calculates, based on the graph G with corresponding edge costs and source nodes, the shortest paths a...
EpsilonTest m_eps
For floating point comparisons (if floating point is used)
Dynamic arrays indexed with edges.
Class for the representation of edges.
node target() const
Returns the target node of the edge.
std::enable_if< std::is_integral< T >::value, bool >::type greater(const T &x, const T &y) const
Compare if x is GREATER than y for integral types.
Data type for general directed graphs (adjacency list representation).
Doubly linked lists (maintaining the length of the list).
iterator pushBack(const E &x)
Adds element x at the end of the list.
Dynamic arrays indexed with nodes.
void init()
Reinitializes the array. Associates the array with no graph.
Class for the representation of nodes.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
Prioritized queue interface wrapper for heaps.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.