Class ShortestPathSingleSourceDijkstra

java.lang.Object
com.jgalgo.alg.shortestpath.ShortestPathSingleSourceAbstract
com.jgalgo.alg.shortestpath.ShortestPathSingleSourceDijkstra
All Implemented Interfaces:
ShortestPathSingleSource

public class ShortestPathSingleSourceDijkstra extends ShortestPathSingleSourceAbstract
Dijkstra's algorithm for Single Source Shortest Path (SSSP).

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: