Interface ShortestPathAlgorithm<V,E>

Type Parameters:
V - the graph vertex type
E - the graph edge type
All Known Subinterfaces:
ManyToManyShortestPathsAlgorithm<V,E>
All Known Implementing Classes:
AStarShortestPath, BaseBidirectionalShortestPathAlgorithm, BellmanFordShortestPath, BFSShortestPath, BidirectionalAStarShortestPath, BidirectionalDijkstraShortestPath, CHManyToManyShortestPaths, ContractionHierarchyBidirectionalDijkstra, DefaultManyToManyShortestPaths, DeltaSteppingShortestPath, DijkstraManyToManyShortestPaths, DijkstraShortestPath, FloydWarshallShortestPaths, IntVertexDijkstraShortestPath, JohnsonShortestPaths, TransitNodeRoutingShortestPath

public interface ShortestPathAlgorithm<V,E>
An algorithm which computes shortest paths between vertices.
Author:
Dimitrios Michail
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A set of paths starting from a single source vertex.
  • Method Summary

    Modifier and Type
    Method
    Description
    getPath(V source, V sink)
    Get a shortest path from a source vertex to a sink vertex.
    getPaths(V source)
    Compute all shortest paths starting from a single source vertex.
    double
    getPathWeight(V source, V sink)
    Get the weight of the shortest path from a source vertex to a sink vertex.
  • Method Details

    • getPath

      GraphPath<V,E> getPath(V source, V sink)
      Get a shortest path from a source vertex to a sink vertex.
      Parameters:
      source - the source vertex
      sink - the target vertex
      Returns:
      a shortest path or null if no path exists
    • getPathWeight

      double getPathWeight(V source, V sink)
      Get the weight of the shortest path from a source vertex to a sink vertex. Returns Double.POSITIVE_INFINITY if no path exists.
      Parameters:
      source - the source vertex
      sink - the sink vertex
      Returns:
      the weight of the shortest path from a source vertex to a sink vertex, or Double.POSITIVE_INFINITY if no path exists
    • getPaths

      Compute all shortest paths starting from a single source vertex.
      Parameters:
      source - the source vertex
      Returns:
      the shortest paths