Documentation of 'org.jgrapht.alg.FloydWarshallShortestPaths' Java class
FloydWarshallShortestPaths
org.jgrapht.alg

Class FloydWarshallShortestPaths<V,E>

  • Type Parameters:
    V - the graph vertex type
    E - the graph edge type

    Deprecated. 

    @Deprecated
    public class FloydWarshallShortestPaths<V,E>
    extends java.lang.Object
    The Floyd-Warshall algorithm finds all shortest paths (all n^2 of them) in O(n^3) time. It can also calculate the graph diameter. Note that during construction time, no computations are performed! All computations are performed the first time one of the member methods of this class is invoked. The results are stored, so all subsequent calls to the same method are computationally efficient. Warning: This code has not been tested (and probably doesn't work) on multi-graphs. Code should be updated to work properly on multi-graphs.
    • Constructor Detail

      • FloydWarshallShortestPaths

        public FloydWarshallShortestPaths(Graph<V,E> graph)
        Deprecated. 
        Create a new instance of the Floyd-Warshall all-pairs shortest path algorithm.
        Parameters:
        graph - the input graph
    • Method Detail

      • getGraph

        public Graph<V,E> getGraph()
        Deprecated. 
        Returns:
        the graph on which this algorithm operates
      • getShortestPathsCount

        public int getShortestPathsCount()
        Deprecated. 
        Returns:
        total number of shortest paths
      • shortestDistance

        public double shortestDistance(V a,
                                       V b)
        Deprecated. 
        Get the length of a shortest path.
        Parameters:
        a - first vertex
        b - second vertex
        Returns:
        shortest distance between a and b
      • getDiameter

        public double getDiameter()
        Deprecated. 
        Returns:
        the diameter (longest of all the shortest paths) computed for the graph. If the graph is vertexless, return 0.0.
      • getShortestPath

        public GraphPath<V,E> getShortestPath(V a,
                                              V b)
        Deprecated. 
        Get the shortest path between two vertices.
        Parameters:
        a - from vertex
        b - to vertex
        Returns:
        the path, or null if none found
      • getShortestPathAsVertexList

        public java.util.List<V> getShortestPathAsVertexList(V a,
                                                             V b)
        Deprecated. 
        Get the shortest path between two vertices as a list of vertices.
        Parameters:
        a - from vertex
        b - to vertex
        Returns:
        the path, or null if none found
      • getShortestPaths

        public java.util.List<GraphPath<V,E>> getShortestPaths(V v)
        Deprecated. 
        Get shortest paths from a vertex to all other vertices in the graph.
        Parameters:
        v - the originating vertex
        Returns:
        List of paths
      • getShortestPaths

        public java.util.List<GraphPath<V,E>> getShortestPaths()
        Deprecated. 
        Get all shortest paths in the graph.
        Returns:
        List of paths
      • getFirstHop

        public V getFirstHop(V a,
                             V b)
        Deprecated. 
        Returns the first hop, i.e., the second node on the shortest path from a to b. Lookup time is O(1). If the shortest path from a to b is a,c,d,e,b, this method returns c. If the next invocation would query the first hop on the shortest path from c to b, vertex d would be returned, etc. This method is computationally cheaper than getShortestPathAsVertexList(a,b).get(0);
        Parameters:
        a - source vertex
        b - target vertex
        Returns:
        next hop on the shortest path from a to b, or null when there exists no path from a to b.
      • getLastHop

        public V getLastHop(V a,
                            V b)
        Deprecated. 
        Returns the last hop, i.e., the second to last node on the shortest path from a to b. Lookup time is O(1). If the shortest path from a to b is a,c,d,e,b, this method returns e. If the next invocation would query the next hop on the shortest path from c to e, vertex d would be returned, etc. This method is computationally cheaper than getShortestPathAsVertexList(a,b).get(shortestPathListSize-1);. The first invocation of this method populates a last hop matrix.
        Parameters:
        a - source vertex
        b - target vertex
        Returns:
        last hop on the shortest path from a to b, or null when there exists no path from a to b.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.