scalation.database.graph_pm.ShortestPath
See theShortestPath companion object
The ShortestPath
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 ShortestPath
companion object is used to form a matrix from a Graph
.
The edge cost/distance (must be non-negative) is stored in a dense matrix. Dijkstra's Algorithm is used: @see en.wikipedia.org/wiki/Dijkstra%27s_algorithm
To extend to multi-digraphs, each multi-edge between a pair vertices has it own edge weight. Take the minimum when forming the corresponding matrix.
Value parameters
- c
-
the cost/distance matrix, where a value of zero implies no connection. If the actual distance is zero, use a very small number instead.
- s
-
the single-source vertex
Attributes
- See also
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article