Class BellmanFordRouting
java.lang.Object
com.graphhopper.routing.AbstractRoutingAlgorithm
org.eclipse.mosaic.lib.routing.graphhopper.algorithm.BellmanFordRouting
- All Implemented Interfaces:
com.graphhopper.routing.RoutingAlgorithm
public class BellmanFordRouting
extends com.graphhopper.routing.AbstractRoutingAlgorithm
Implementation of the Bellman-Ford algorithm which supports negative edge costs.
This algorithm visits all edges of the network several times, thus it gets very slow
on large networks. Be careful with this! :)
-
Field Summary
Fields inherited from class com.graphhopper.routing.AbstractRoutingAlgorithm
edgeExplorer, graph, maxVisitedNodes, nodeAccess, timeoutMillis, traversalMode, weighting
-
Constructor Summary
ConstructorsConstructorDescriptionBellmanFordRouting
(com.graphhopper.storage.Graph graph, com.graphhopper.routing.weighting.Weighting weighting, com.graphhopper.util.PMap hints) Creates a newBellmanFordRouting
object based on theAbstractRoutingAlgorithm
. -
Method Summary
Modifier and TypeMethodDescriptioncom.graphhopper.routing.Path
calcPath
(int from, int to) Calculates a path between two nodes dependent on the edge costs.int
Methods inherited from class com.graphhopper.routing.AbstractRoutingAlgorithm
accept, calcPaths, checkAlreadyRun, createEmptyPath, getName, isMaxVisitedNodesExceeded, isTimeoutExceeded, setMaxVisitedNodes, setTimeoutMillis, setupFinishTime, toString
-
Constructor Details
-
BellmanFordRouting
public BellmanFordRouting(com.graphhopper.storage.Graph graph, com.graphhopper.routing.weighting.Weighting weighting, com.graphhopper.util.PMap hints) Creates a newBellmanFordRouting
object based on theAbstractRoutingAlgorithm
.- Parameters:
graph
- specifies the graph where this algorithm will run on.weighting
- set the used weight calculation (e.g. fastest, shortest).
-
-
Method Details
-
calcPath
public com.graphhopper.routing.Path calcPath(int from, int to) Calculates a path between two nodes dependent on the edge costs.- Parameters:
from
- The start node of the path.to
- The end node of the path- Returns:
- The ideal path.
-
getVisitedNodes
public int getVisitedNodes()
-