Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

Shortest Paths

Algorithms for computing shortest paths in graphs (including single-source and all-pairs). More...

Classes

class  ogdf::Dijkstra< T, H >
 Dijkstra's single source shortest path algorithm. More...
 
class  ogdf::ShortestPathWithBFM
 Computes single-source shortest-paths with Bellman-Ford-Moore's algorithm. More...
 

Functions

void ogdf::bfs_SPAP (const Graph &G, NodeArray< NodeArray< double > > &distance, double edgeCosts)
 Computes all-pairs shortest paths in G using breadth-first serach (BFS). More...
 
void ogdf::bfs_SPSS (node s, const Graph &G, NodeArray< double > &distanceArray, double edgeCosts)
 Computes single-source shortest paths from s in G using breadth-first search (BFS). More...
 
double ogdf::dijkstra_SPAP (const GraphAttributes &GA, NodeArray< NodeArray< double > > &shortestPathMatrix)
 Computes all-pairs shortest paths in GA using Dijkstra's algorithm. More...
 
void ogdf::dijkstra_SPAP (const Graph &G, NodeArray< NodeArray< double > > &shortestPathMatrix, const EdgeArray< double > &edgeCosts)
 Computes all-pairs shortest paths in graph G using Dijkstra's algorithm. More...
 
void ogdf::dijkstra_SPSS (node s, const Graph &G, NodeArray< double > &shortestPathMatrix, const EdgeArray< double > &edgeCosts)
 Computes single-source shortest paths from node s in G using Disjkstra's algorithm. More...
 
void ogdf::floydWarshall_SPAP (NodeArray< NodeArray< double > > &shortestPathMatrix, const Graph &G)
 Computes all-pairs shortest paths in graph G using Floyd-Warshall's algorithm. More...
 

Detailed Description

Algorithms for computing shortest paths in graphs (including single-source and all-pairs).

Function Documentation

◆ bfs_SPAP()

void ogdf::bfs_SPAP ( const Graph &  G,
NodeArray< NodeArray< double > > &  distance,
double  edgeCosts 
)

Computes all-pairs shortest paths in G using breadth-first serach (BFS).

The cost of each edge are edgeCost and the result is stored in distance.

◆ bfs_SPSS()

void ogdf::bfs_SPSS ( node  s,
const Graph &  G,
NodeArray< double > &  distanceArray,
double  edgeCosts 
)

Computes single-source shortest paths from s in G using breadth-first search (BFS).

The cost of each edge are edgeCost and the result is stored in distanceArray.

◆ dijkstra_SPAP() [1/2]

double ogdf::dijkstra_SPAP ( const GraphAttributes &  GA,
NodeArray< NodeArray< double > > &  shortestPathMatrix 
)

Computes all-pairs shortest paths in GA using Dijkstra's algorithm.

The cost of an edge e are given by GA.doubleWeight(e) and the result is stored in shortestPathMatrix.

Returns
returns the average edge cost

◆ dijkstra_SPAP() [2/2]

void ogdf::dijkstra_SPAP ( const Graph &  G,
NodeArray< NodeArray< double > > &  shortestPathMatrix,
const EdgeArray< double > &  edgeCosts 
)

Computes all-pairs shortest paths in graph G using Dijkstra's algorithm.

The cost of an edge are given by edgeCosts and the result is stored in shortestPathMatrix.

◆ dijkstra_SPSS()

void ogdf::dijkstra_SPSS ( node  s,
const Graph &  G,
NodeArray< double > &  shortestPathMatrix,
const EdgeArray< double > &  edgeCosts 
)

Computes single-source shortest paths from node s in G using Disjkstra's algorithm.

The cost of an edge are given by edgeCosts and the result is stored in shortestPathMatrix. Note this algorithm equals Dijkstra<T>::call, though it does not compute the predecessors on the path and is not inlined.

◆ floydWarshall_SPAP()

void ogdf::floydWarshall_SPAP ( NodeArray< NodeArray< double > > &  shortestPathMatrix,
const Graph &  G 
)

Computes all-pairs shortest paths in graph G using Floyd-Warshall's algorithm.

Note that the shortestPathMatrix has to be initialized and all entries must be positive. The costs of non-adjacent nodes should be set to std::numeric_limits<double>::infinity().