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

    Constructors
    Constructor
    Description
    BellmanFordRouting(com.graphhopper.storage.Graph graph, com.graphhopper.routing.weighting.Weighting weighting, com.graphhopper.util.PMap hints)
    Creates a new BellmanFordRouting object based on the AbstractRoutingAlgorithm.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BellmanFordRouting

      public BellmanFordRouting(com.graphhopper.storage.Graph graph, com.graphhopper.routing.weighting.Weighting weighting, com.graphhopper.util.PMap hints)
      Creates a new BellmanFordRouting object based on the AbstractRoutingAlgorithm.
      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()