Interface ShortestPathAllPairs.IResult

All Superinterfaces:
ShortestPathAllPairs.Result<Integer,Integer>
Enclosing interface:
ShortestPathAllPairs

public static interface ShortestPathAllPairs.IResult extends ShortestPathAllPairs.Result<Integer,Integer>
A result object for an ShortestPathAllPairs algorithm for IntGraph.
Author:
Barak Ugav
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    distance(int source, int target)
    Get the distance of the shortest path between two vertices.
    default double
    distance(Integer source, Integer target)
    Deprecated.
    Please use distance(int, int) instead to avoid un/boxing.
    getPath(int source, int target)
    Get the shortest path between vertices.
    default IPath
    getPath(Integer source, Integer target)
    Deprecated.
    Please use getPath(int, int) instead to avoid un/boxing.
  • Method Details

    • distance

      double distance(int source, int target)
      Get the distance of the shortest path between two vertices.
      Parameters:
      source - the source vertex
      target - the target vertex
      Returns:
      the sum of weights of edges in the shortest path from the source to target, or Double.POSITIVE_INFINITY if no such path exists
      Throws:
      NoSuchVertexException - if source or target are not vertices in the graph
      IllegalArgumentException - if the shortest paths were computed on pairs of vertices from a subset of the vertices of the graph (rather than all pairs), and source or target are not in the subset
    • distance

      @Deprecated default double distance(Integer source, Integer target)
      Deprecated.
      Please use distance(int, int) instead to avoid un/boxing.
      Get the distance of the shortest path between two vertices.
      Specified by:
      distance in interface ShortestPathAllPairs.Result<Integer,Integer>
      Parameters:
      source - the source vertex
      target - the target vertex
      Returns:
      the sum of weights of edges in the shortest path from the source to target, or Double.POSITIVE_INFINITY if no such path exists
    • getPath

      IPath getPath(int source, int target)
      Get the shortest path between vertices.
      Parameters:
      source - the source vertex
      target - the target vertex
      Returns:
      the shortest path from the source to target, or null if no such path exists
      Throws:
      NoSuchVertexException - if source or target are not vertices in the graph
      IllegalArgumentException - if the shortest paths were computed on pairs of vertices from a subset of the vertices of the graph (rather than all pairs), and source or target are not in the subset
    • getPath

      @Deprecated default IPath getPath(Integer source, Integer target)
      Deprecated.
      Please use getPath(int, int) instead to avoid un/boxing.
      Get the shortest path between vertices.
      Specified by:
      getPath in interface ShortestPathAllPairs.Result<Integer,Integer>
      Parameters:
      source - the source vertex
      target - the target vertex
      Returns:
      the shortest path from the source to target, or null if no such path exists