Interface ShortestPathAllPairs.Result<V,​E>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      double distance​(V source, V target)
      Get the distance of the shortest path between two vertices.
      Path<V,​E> getPath​(V source, V target)
      Get the shortest path between vertices.
    • Method Detail

      • distance

        double distance​(V source,
                        V 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
      • getPath

        Path<V,​E> getPath​(V source,
                                V 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