Class Dijkstra

All Implemented Interfaces:
RoutingAlgorithm

public class Dijkstra extends AbstractRoutingAlgorithm
Implements a single source shortest path algorithm http://en.wikipedia.org/wiki/Dijkstra's_algorithm

Author:
Peter Karich
  • Field Details

  • Constructor Details

  • Method Details

    • initCollections

      protected void initCollections(int size)
    • calcPath

      public Path calcPath(int from, int to)
      Description copied from interface: RoutingAlgorithm
      Calculates 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: RoutingAlgorithm
      Returns the visited nodes after searching. Useful for debugging.
    • updateBestPath

      protected void updateBestPath(EdgeIteratorState edgeState, SPTEntry bestSPTEntry, int traversalId)
    • getName

      public String getName()
      Specified by:
      getName in interface RoutingAlgorithm
      Overrides:
      getName in class AbstractRoutingAlgorithm
      Returns:
      name of this algorithm