Package com.graphhopper.routing
Class Dijkstra
java.lang.Object
com.graphhopper.routing.AbstractRoutingAlgorithm
com.graphhopper.routing.Dijkstra
- All Implemented Interfaces:
RoutingAlgorithm
Implements a single source shortest path algorithm
http://en.wikipedia.org/wiki/Dijkstra's_algorithm
- Author:
- Peter Karich
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SPTEntryprotected PriorityQueue<SPTEntry>protected com.carrotsearch.hppc.IntObjectMap<SPTEntry>Fields inherited from class com.graphhopper.routing.AbstractRoutingAlgorithm
edgeExplorer, graph, maxVisitedNodes, nodeAccess, timeoutMillis, traversalMode, weighting -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalcPath(int from, int to) Calculates the best path between the specified nodes.protected booleanfinished()getName()intReturns the visited nodes after searching.protected voidinitCollections(int size) protected voidrunAlgo()protected voidupdateBestPath(EdgeIteratorState edgeState, SPTEntry bestSPTEntry, int traversalId) Methods inherited from class com.graphhopper.routing.AbstractRoutingAlgorithm
accept, calcPaths, checkAlreadyRun, createEmptyPath, isMaxVisitedNodesExceeded, isTimeoutExceeded, setMaxVisitedNodes, setTimeoutMillis, setupFinishTime, toString
-
Field Details
-
fromMap
-
fromHeap
-
currEdge
-
-
Constructor Details
-
Dijkstra
-
-
Method Details
-
initCollections
protected void initCollections(int size) -
calcPath
Description copied from interface:RoutingAlgorithmCalculates the best path between the specified nodes.- Returns:
- the path. Call the method found() to make sure that the path is valid.
-
runAlgo
protected void runAlgo() -
finished
protected boolean finished() -
getVisitedNodes
public int getVisitedNodes()Description copied from interface:RoutingAlgorithmReturns the visited nodes after searching. Useful for debugging. -
updateBestPath
-
getName
- Specified by:
getNamein interfaceRoutingAlgorithm- Overrides:
getNamein classAbstractRoutingAlgorithm- Returns:
- name of this algorithm
-