Interface ShortestPathSt

    • Method Detail

      • computeShortestPath

        default <V,​E> Path<V,​E> computeShortestPath​(Graph<V,​E> g,
                                                                WeightFunction<E> w,
                                                                V source,
                                                                V target)
        Compute the shortest path from a source vertex to a target vertex.

        If g is an IntGraph, a IPath object will be returned. In that case, its better to pass a IWeightFunction as w to avoid boxing/unboxing.

        Type Parameters:
        V - the vertices type
        E - the edges type
        Parameters:
        g - the graph
        w - an edge weight function
        source - the source vertex
        target - the target vertex
        Returns:
        the shortest path from the source to the target, or null if there is no path
      • computeShortestPathAndWeight

        <V,​E> ObjectDoublePair<Path<V,​E>> computeShortestPathAndWeight​(Graph<V,​E> g,
                                                                                   WeightFunction<E> w,
                                                                                   V source,
                                                                                   V target)
        Compute the shortest path from a source vertex to a target vertex, and its weight.

        If g is an IntGraph, a IPath object will be returned. In that case, its better to pass a IWeightFunction as w to avoid boxing/unboxing.

        Type Parameters:
        V - the vertices type
        E - the edges type
        Parameters:
        g - the graph
        w - an edge weight function
        source - the source vertex
        target - the target vertex
        Returns:
        a pair of the shortest path from the source to the target, and its weight, or null if there is no path
      • newInstance

        static ShortestPathSt newInstance()
        Create a new S-T shortest path algorithm object.

        This is the recommended way to instantiate a new ShortestPathSt object.

        Returns:
        a default implementation of ShortestPathSt