Class MinimumCostFlowProblem.MinimumCostFlowProblemImpl<V,​E>

    • Constructor Detail

      • MinimumCostFlowProblemImpl

        public MinimumCostFlowProblemImpl​(Graph<V,​E> graph,
                                          Function<V,​Integer> supplyMap,
                                          Function<E,​Integer> arcCapacityUpperBounds)
        Constructs a new minimum cost flow problem without arc capacity lower bounds.
        Parameters:
        graph - the flow network
        supplyMap - the node demands
        arcCapacityUpperBounds - the arc capacity upper bounds
      • MinimumCostFlowProblemImpl

        public MinimumCostFlowProblemImpl​(Graph<V,​E> graph,
                                          Function<V,​Integer> nodeSupplies,
                                          Function<E,​Integer> arcCapacityUpperBounds,
                                          Function<E,​Integer> arcCapacityLowerBounds)
        Constructs a new minimum cost flow problem
        Parameters:
        graph - the flow network
        nodeSupplies - the node demands
        arcCapacityUpperBounds - the arc capacity upper bounds
        arcCapacityLowerBounds - the arc capacity lower bounds
    • Method Detail

      • getNodeSupply

        public Function<V,​Integer> getNodeSupply()
        Returns a function which defines the supply and demand of each node in thet network. Supplies can be positive, negative or 0. Nodes with positive negative supply are the demand nodes, nodes with zero supply are the transhipment nodes. Flow is always directed from nodes with postive supply to nodes with negative supply. Summed over all nodes, the total demand should equal 0.
        Specified by:
        getNodeSupply in interface MinimumCostFlowProblem<V,​E>
        Returns:
        supply function
      • getArcCapacityLowerBounds

        public Function<E,​Integer> getArcCapacityLowerBounds()
        Returns a function which specifies the minimum capacity of an arc. The minimum capacity is the minimum amount of flow that has to go through an arc.
        Specified by:
        getArcCapacityLowerBounds in interface MinimumCostFlowProblem<V,​E>
        Returns:
        arc capacity lower bounding function
      • getArcCapacityUpperBounds

        public Function<E,​Integer> getArcCapacityUpperBounds()
        Returns a function which specifies the maximum capacity of an arc. The flow through an arc cannot exceed this upper bound.
        Specified by:
        getArcCapacityUpperBounds in interface MinimumCostFlowProblem<V,​E>
        Returns:
        arc capacity upper bounding function