Package com.jgalgo

Interface FlowNetwork.Int

  • All Superinterfaces:
    FlowNetwork
    Enclosing interface:
    FlowNetwork

    public static interface FlowNetwork.Int
    extends FlowNetwork
    Flow on graph edges, with integer capacities and flows values.

    Similar to the regular FlowNetwork interface, but with integer capacities and flows. Some algorithms that work on flow networks are specifically for integers networks, or may performed faster if the capacities and flows are integers.

    Author:
    Barak Ugav
    • Method Detail

      • getCapacityInt

        int getCapacityInt​(int edge)
        Get the integer capacity of an edge.
        Parameters:
        edge - an edge identifier in the graph
        Returns:
        the capacity of the edge
        Throws:
        IndexOutOfBoundsException - if edge is not a valid edge identifier
      • getCapacity

        @Deprecated
        default double getCapacity​(int edge)
        Deprecated.
        Description copied from interface: FlowNetwork
        Get the capacity of an edge.
        Specified by:
        getCapacity in interface FlowNetwork
        Parameters:
        edge - an edge identifier in the graph
        Returns:
        the capacity of the edge
      • setCapacity

        void setCapacity​(int edge,
                         int capacity)
        Set the integer capacity of an edge.
        Parameters:
        edge - an edge identifier in the graph
        capacity - the new capacity of the edge
        Throws:
        IndexOutOfBoundsException - if edge is not a valid edge identifier
        IllegalArgumentException - if capacity is negative
      • setCapacity

        @Deprecated
        default void setCapacity​(int edge,
                                 double capacity)
        Deprecated.
        Description copied from interface: FlowNetwork
        Set the capacity of an edge.
        Specified by:
        setCapacity in interface FlowNetwork
        Parameters:
        edge - an edge identifier in the graph
        capacity - the new capacity of the edge
      • getFlowInt

        int getFlowInt​(int edge)
        Get the integer 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 < 0\), means a flow of \(|-f|\) units of flow from edgeTarget(e) to edgeSource(e) (opposite direction).

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

        @Deprecated
        default double getFlow​(int edge)
        Deprecated.
        Description copied from interface: FlowNetwork
        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 < 0\), means a flow of \(|-f|\) units of flow from edgeTarget(e) to edgeSource(e) (opposite direction).

        Specified by:
        getFlow in interface FlowNetwork
        Parameters:
        edge - an edge identifier in the graph
        Returns:
        the amount of flow units going along an edge
      • setFlow

        void setFlow​(int edge,
                     int flow)
        Set the integer amount of flow units going along an edge.
        Parameters:
        edge - an edge identifier in the graph
        flow - the new flow of the edge
        Throws:
        IndexOutOfBoundsException - if edge is not a valid edge identifier
      • setFlow

        @Deprecated
        default void setFlow​(int edge,
                             double flow)
        Deprecated.
        Description copied from interface: FlowNetwork
        Set the amount of flow units going along an edge.
        Specified by:
        setFlow in interface FlowNetwork
        Parameters:
        edge - an edge identifier in the graph
        flow - the new flow of the edge