50 template<
typename TCost>
53 bfs_SPSS(v, G, distance[v], edgeCosts);
64 template<
typename TCost>
71 distanceArray[s] = TCost(0);
72 while (!bfs.
empty()) {
74 TCost d = distanceArray[w] + edgeCosts;
95 template<
typename TCost>
102 avgCosts += edgeCosts[e];
115 template<
typename TCost>
135 template<
typename TCost>
144 sssp.
call(G, edgeCosts, s, predecessor, shortestPathMatrix);
155 template<
typename TCost>
160 Math::updateMin(shortestPathMatrix[v][w], shortestPathMatrix[u][v] + shortestPathMatrix[u][w]);
Declaration of singly linked lists and iterators.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Dijkstra's single source shortest path algorithm.
bool empty() const
Returns true iff the list is empty.
Data type for general directed graphs (adjacency list representation).
void call(const Graph &G, const EdgeArray< T > &weight, const List< node > &sources, NodeArray< edge > &predecessor, NodeArray< T > &distance, bool directed=false)
Calculates, based on the graph G with corresponding edge costs and source nodes, the shortest paths a...
void dijkstra_SPSS(node s, const Graph &G, NodeArray< TCost > &shortestPathMatrix, const EdgeArray< TCost > &edgeCosts)
Computes single-source shortest paths from node s in G using Disjkstra's algorithm.
Declaration and implementation of Array class and Array algorithms.
void updateMin(T &min, const T &newValue)
Stores the minimum of min and newValue in min.
internal::GraphObjectContainer< EdgeElement > edges
The container containing all edge objects.
int numberOfEdges() const
Returns the number of edges in the graph.
Dynamic arrays indexed with nodes.
Implementation of Dijkstra's single source shortest path algorithm.
iterator pushBack(const E &x)
Adds element x at the end of the list.
Stores additional attributes of a graph (like layout information).
node twinNode() const
Returns the associated node of the corresponding adjacency entry (shorthand for twin()->theNode()).
Class for the representation of edges.
Class for the representation of nodes.
const Graph & constGraph() const
Returns a reference to the associated graph.
Declaration and implementation of NodeArray class.
void bfs_SPSS(node s, const Graph &G, NodeArray< TCost > &distanceArray, TCost edgeCosts)
Computes single-source shortest paths from s in G using breadth-first search (BFS).
void floydWarshall_SPAP(NodeArray< NodeArray< TCost >> &shortestPathMatrix, const Graph &G)
Computes all-pairs shortest paths in graph G using Floyd-Warshall's algorithm.
double dijkstra_SPAP(const GraphAttributes &GA, NodeArray< NodeArray< TCost >> &shortestPathMatrix)
Computes all-pairs shortest paths in GA using Dijkstra's algorithm.
Pure declaration header, find template implementation in Graph.h.
E popFrontRet()
Removes the first element from the list and returns it.
double doubleWeight(edge e) const
Returns the (real number) weight of edge e.
The namespace for all OGDF objects.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
Class for adjacency list elements.
void bfs_SPAP(const Graph &G, NodeArray< NodeArray< TCost >> &distance, TCost edgeCosts)
Computes all-pairs shortest paths in G using breadth-first serach (BFS).
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.