Interface IFlow

    • Method Detail

      • getFlow

        double getFlow​(int edge)
        Get the amount of flow units going along an edge.

        If the graph is directed, a flow of \(f\) units on e, for \(0 \leq f \leq cap(e)\), means a flow of \(f\) units of flow from edgeSource(e) to edgeTarget(e).

        If the graph is undirected, a flow of \(+f\) units on e, for \(0 \leq f \leq cap(e)\), means a flow of \(f\) units of flow from edgeSource(e) to edgeTarget(e), while a flow of \(-f\) units on e, for \(-cap(e) \leq -f \leq 0\), means a flow of \(|-f|\) units of flow from edgeTarget(e) to edgeSource(e) (opposite direction).

        Parameters:
        edge - an edge in the graph
        Returns:
        the amount of flow units going along an edge
        Throws:
        NoSuchEdgeException - if edge is not a valid edge
      • getFlow

        @Deprecated
        default double getFlow​(Integer edge)
        Deprecated.
        Please use getFlow(int) instead to avoid un/boxing.
        Get the amount of flow units going along an edge.

        If the graph is directed, a flow of \(f\) units on e, for \(0 \leq f \leq cap(e)\), means a flow of \(f\) units of flow from edgeSource(e) to edgeTarget(e).

        If the graph is undirected, a flow of \(+f\) units on e, for \(0 \leq f \leq cap(e)\), means a flow of \(f\) units of flow from edgeSource(e) to edgeTarget(e), while a flow of \(-f\) units on e, for \(-cap(e) \leq -f \leq 0\), means a flow of \(|-f|\) units of flow from edgeTarget(e) to edgeSource(e) (opposite direction).

        Specified by:
        getFlow in interface Flow<Integer,​Integer>
        Parameters:
        edge - an edge in the graph
        Returns:
        the amount of flow units going along an edge
      • getSupply

        double getSupply​(int vertex)
        Get the sum of flow units going out of a vertex, minus the sum of flow units going into a vertex.

        In the classical maximum flow problem with two terminal nodes s and t, the supply of s is the total amount of flow in the network, and it is equal to the negative of the supply of t. The negative of the supply is sometimes called the demand. For any other vertex, the supply is zero.

        Parameters:
        vertex - a vertex in the graph
        Returns:
        the sum of flow units going out of a vertex, minus the sum of flow units going into a vertex
      • getSupply

        @Deprecated
        default double getSupply​(Integer vertex)
        Deprecated.
        Please use getSupply(int) instead to avoid un/boxing.
        Get the sum of flow units going out of a vertex, minus the sum of flow units going into a vertex.

        In the classical maximum flow problem with two terminal nodes s and t, the supply of s is the total amount of flow in the network, and it is equal to the negative of the supply of t. The negative of the supply is sometimes called the demand. For any other vertex, the supply is zero.

        Specified by:
        getSupply in interface Flow<Integer,​Integer>
        Parameters:
        vertex - a vertex in the graph
        Returns:
        the sum of flow units going out of a vertex, minus the sum of flow units going into a vertex