Class BellmanFordShortestPath<V,​E>

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

    @Deprecated
    public class BellmanFordShortestPath<V,​E>
    extends java.lang.Object
    Deprecated.
    Bellman-Ford algorithm: weights could be negative, paths could be constrained by a maximum number of edges.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static double DEFAULT_EPSILON
      Deprecated.
       
      private double epsilon
      Deprecated.
       
      protected Graph<V,​E> graph
      Deprecated.
      Graph on which shortest paths are searched.
      private BellmanFordIterator<V,​E> iter
      Deprecated.
       
      private int nMaxHops
      Deprecated.
      Maximum number of edges of the calculated paths.
      private int passNumber
      Deprecated.
       
      protected V startVertex
      Deprecated.
      Start vertex.
    • Constructor Summary

      Constructors 
      Constructor Description
      BellmanFordShortestPath​(Graph<V,​E> graph, V startVertex)
      Deprecated.
      Creates an object to calculate shortest paths between the start vertex and others vertices using the Bellman-Ford algorithm.
      BellmanFordShortestPath​(Graph<V,​E> graph, V startVertex, int nMaxHops)
      Deprecated.
      Creates an object to calculate shortest paths between the start vertex and others vertices using the Bellman-Ford algorithm.
      BellmanFordShortestPath​(Graph<V,​E> graph, V startVertex, int nMaxHops, double epsilon)
      Deprecated.
      Creates an object to calculate shortest paths between the start vertex and others vertices using the Bellman-Ford algorithm.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      private void assertGetPath​(V endVertex)
      Deprecated.
       
      static <V,​E>
      java.util.List<E>
      findPathBetween​(Graph<V,​E> graph, V startVertex, V endVertex)
      Deprecated.
      Convenience method to find the shortest path via a single static method call.
      double getCost​(V endVertex)
      Deprecated.
      Get the cost of the shortest path to a vertex.
      java.util.List<E> getPathEdgeList​(V endVertex)
      Deprecated.
      Get the shortest path to a vertex.
      private void lazyCalculate()
      Deprecated.
       
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_EPSILON

        private static final double DEFAULT_EPSILON
        Deprecated.
        See Also:
        Constant Field Values
      • graph

        protected Graph<V,​E> graph
        Deprecated.
        Graph on which shortest paths are searched.
      • startVertex

        protected V startVertex
        Deprecated.
        Start vertex.
      • nMaxHops

        private int nMaxHops
        Deprecated.
        Maximum number of edges of the calculated paths.
      • passNumber

        private int passNumber
        Deprecated.
      • epsilon

        private double epsilon
        Deprecated.
    • Constructor Detail

      • BellmanFordShortestPath

        public BellmanFordShortestPath​(Graph<V,​E> graph,
                                       V startVertex)
        Deprecated.
        Creates an object to calculate shortest paths between the start vertex and others vertices using the Bellman-Ford algorithm.
        Parameters:
        graph - the graph
        startVertex - the start vertex
      • BellmanFordShortestPath

        public BellmanFordShortestPath​(Graph<V,​E> graph,
                                       V startVertex,
                                       int nMaxHops)
        Deprecated.
        Creates an object to calculate shortest paths between the start vertex and others vertices using the Bellman-Ford algorithm.
        Parameters:
        graph - the graph
        startVertex - the start vertex
        nMaxHops - maximum number of edges of the calculated paths
      • BellmanFordShortestPath

        public BellmanFordShortestPath​(Graph<V,​E> graph,
                                       V startVertex,
                                       int nMaxHops,
                                       double epsilon)
        Deprecated.
        Creates an object to calculate shortest paths between the start vertex and others vertices using the Bellman-Ford algorithm.
        Parameters:
        graph - the graph
        startVertex - the start vertex
        nMaxHops - maximum number of edges of the calculated paths.
        epsilon - tolerance factor when comparing floating point values
    • Method Detail

      • getCost

        public double getCost​(V endVertex)
        Deprecated.
        Get the cost of the shortest path to a vertex.
        Parameters:
        endVertex - the end vertex
        Returns:
        the cost of the shortest path between the start vertex and the end vertex.
      • getPathEdgeList

        public java.util.List<E> getPathEdgeList​(V endVertex)
        Deprecated.
        Get the shortest path to a vertex.
        Parameters:
        endVertex - the end vertex
        Returns:
        list of edges, or null if no path exists between the start vertex and the end vertex
      • assertGetPath

        private void assertGetPath​(V endVertex)
        Deprecated.
      • lazyCalculate

        private void lazyCalculate()
        Deprecated.
      • findPathBetween

        public static <V,​E> java.util.List<E> findPathBetween​(Graph<V,​E> graph,
                                                                    V startVertex,
                                                                    V endVertex)
        Deprecated.
        Convenience method to find the shortest path via a single static method call. If you need a more advanced search (e.g. limited by hops, or computation of the path length), use the constructor instead.
        Type Parameters:
        V - the graph vertex type
        E - the graph edge type
        Parameters:
        graph - the graph to be searched
        startVertex - the vertex at which the path should start
        endVertex - the vertex at which the path should end
        Returns:
        List of Edges, or null if no path exists