the cost/distance matrix, where aA value of zero implies no connection. If the actual distance is zero, use a very small number instead.
the single-source vertex
Determine the shortest path from vertex 's' to each vertex 'j' returning the vector 'd' giving the distance from 's' to all other vertices and the vector 'p' of predecessor vertices.
Determine the shortest path from vertex 's' to each vertex 'j' returning the vector 'd' giving the distance from 's' to all other vertices and the vector 'p' of predecessor vertices. The path from 's' to each vertex can be deduced from the 'p' vector.
The
SSShortestPath
class is used to solve shortest path problems for graphs stored in matrices. It solves the Single-Source Shortest Path (SSSP) problem for directed graphs. The edge cost/distance (must be non-negative) can be stored in either a dense or sparse matrix. Dijkstra's Algorithm is used.http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm