Class ShortestPathSingleSourceDijkstra
- All Implemented Interfaces:
ShortestPathSingleSource
Compute the shortest paths from a single source to all other vertices in \(O(m + n \log n)\) time, using a heap with
\(O(1)\) time for decreaseKey()
operations.
Only positive edge weights are supported. This implementation should be the first choice for
ShortestPathSingleSource
with positive weights. For negative weights use
ShortestPathSingleSourceBellmanFord
for floating points or ShortestPathSingleSourceGoldberg
for
integers.
Based on 'A note on two problems in connexion with graphs' by E. W. Dijkstra (1959). A 'note'??!! this guy changed the world, and he publish it as a 'note'.
- Author:
- Barak Ugav
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jgalgo.alg.shortestpath.ShortestPathSingleSource
ShortestPathSingleSource.Builder, ShortestPathSingleSource.IResult, ShortestPathSingleSource.Result<V,
E> -
Constructor Summary
-
Method Summary
Methods inherited from class com.jgalgo.alg.shortestpath.ShortestPathSingleSourceAbstract
computeShortestPaths
-
Constructor Details
-
ShortestPathSingleSourceDijkstra
public ShortestPathSingleSourceDijkstra()Create a Dijkstra's SSSP algorithm.Please prefer using
ShortestPathSingleSource.newInstance()
to get a default implementation for theShortestPathSingleSource
interface, orShortestPathSingleSource.builder()
for more customization options.
-