Transcript lecture 7

Max-flow/min-cut theorem
• Theorem: For each network
with one source and one
sink, the maximum flow
from the source to the
destination is equal to the
minimal cut of this network.
• Intuition:
– Maximal flow is determined
by the bottleneck of the
sysetm of pipes.
– Minimal cut is a kind of a
distributed bottleneck for the
whole network.
Max flow and min cut
• Min cut for the network has a value of 14.
• 4 paths B-E, D-E, F-E and F-G is a bottleneck of the network and
they should be widened first
– But it is possible that you don’t get 1 unit flow increase per 1 unit of
increased capacity for the selected paths.
– It is because an increased flow may activate a new bottleneck down
or up the „river”.
• Flow capacities may denote costs. Then minimal cut is a minimal
cost of blocking the flow in the whole river.
Network flow programming
• Formulating and solving network problems by linear
programming is called network flow programming.
• Every network flow program may be presented as
minimum-cost network flow program:
• Variables: unknown flows for every arc in the network
• Flow conservation constraint:
• Source
Sink
:
Network flow programming
• Flow bounds for each arc: may be lower (minimal prodction level in a
factory) {default value is 0} or upper bounds (maximal flow through a pipe)
{default value +∞}
– Flows should not be negative (we lose transparency)
• Cost per unit of flow {default value 0}:
revenue)
• Objective function:
• Three parameters for each arc: [l, u, c]
– Lower bound l
– Upper bound u
– Cost per unit of flow c
(if it is negative, then it is
Diagram vs linear program
1: 1 relation
We will henceforth think of a properly
marked diagram equivalently as of a linear
program formulation.
Properties
• Coefficients on the LHS of the constraints take values -1,0 or 1
• All pivot operations in the simplex algorithm consist therefore of addition
and subtraction (no need for multiplication or division)
• Even better: addition and subtraction operations may be replaced by
logical opeartions (based on Boolean algebra) in the Network simplex
algorithm
• If there are only integer values on the RHS of all the constraints and all
pivot operations are addition and subtraction operations, then the
decision variables in the optimal solution will all be integers as well –
unimodularity property
– This property is very useful in case of solving many integer programs, e.g. assignment
problems
Transportation problem
• Simple, yet very useful in practice
• Consists of product sources (e.g. factories), which are directly connected
with destination points (e.g. markets in different cities). For each
connection there is a unit flow cost.
– Supply not greater than capacity of a given factory
– Demand is equal to the supplied products
– Each arc has a default value for upper and lower bound and a unit flow cost (in
brackets)
Assignment problem
• It also appears as an integer program.
• Assigning elmenets of the set of people to the elments of the set of tasks
so that the total completion time for all the tasks is minimized.
– Each person needs certain amount of time for the task or cannot complete a task at all.
– Each person should be assigned with exactly one task.
Assignment problem
•
Assignment problem may be formulated as a transportation problem:
–
–
–
•
Each person is a source node, which introduces exactly one unit of flow into the network (if there are more
persons than tasks: not more than one unit)
Each task is a destaintion node, which removes exactly one unit of flow from the network
The cost of flow on each arc is the time for each person to complete a given task
The optimal flow on the arcs will be equal to 0 or 1
–
–
Due to the unimodularity property, the solution will be integer-valued,
Since sources and destination points have inflows and outflows equal to exactly 1.
Transshipment problem
• The same as transportation problem, but additionally:
– There are nodes which conserve flow [flow conserving nodes] – the transshipment
points
– The source and destination points may serve as transshipment points as well.
– B is a source and a transshipment point
– G is a destanation and a transshipment point
– D and E are transshipments point
The shortest route problem
• Instead of applying Dijkstra algorithm we can solve it by network
programming program
• The procedure is as follows:
–
–
–
–
Draw network diagram
Arc labels: lower bound 0, upper bound +∞, cost = arc length, e.g. [0, ∞,12]
Starting point is a source node with exactly one unit of flow without a cost [1,1,0]
Final point is a destination node with exactly one unit of flow without a cost [1,1,0]
• Arcs with positive flow will be on the shortest route.
• Due to the unimodularity property the optimal flow on each arc will be
either 0 or 1.
The shortest route tree problem
• The same as the shortest route problem, but there may be many (if not all)
destination nodes.
• Problem is to find the shortest path from the starting point to each of the
final points
• We could solve many shortest route problems, changing the final point. It is
easire however to do it in one problem.
• Assume there are many destaintion nodes. Procedure:
–
–
–
–
Draw network diagram
Arc labels: lower bound 0, upper bound +∞, cost = arc length, e.g. [0, ∞,12]
Starting point is a source node with exactly n unit of flow without a cost [n,n,0]
Final point is a destination node with exactly one unit of flow without a cost [1,1,0]
• In the optimum, ther will be only integer values (unimodularity). One
should mark all arcs which have positive flow. The shortest path is found
backwards.
Max flow/ Min cut problem
• Instead of applying Ford-Fulkerson algorithm, we can apply minimum cost
network flow program
• Procedure:
– Draw network diagram
– Arc labels: lower bound 0, upper bound maximal flow on this arc, cost = 0, e.g. [0, 25,0]
– Starting point is a source node with a very big upper bound without a cost: [0,M,0],
where M is very big
– Final point is a destination node with a very big upper bound with a cost of -1: [0,M,-1],
where M is very big
• In the optimum: Consider destination node. Cost per unit of flow is -1.
Objective is to minimize cost, hence the program will try to let as many
units of flow through this node. In the source node it will try to let as
many units of flow as well. Upper bounds for the flow on each arc will be
the only limit.
Max flow / Min cut problem
• The solution will provide us with the following information:
– The outflow in the destination node. Is equal to the maximal flow of the network.
– The flows on each arc will give the flow pattern of the maximum flow problem
• The minimum cut is found the same way, as after termination of the
Ford-Fulkerson algorithm.
• What is a good value for M?
– Not too small – has to be not smaller than the maximum flow which we search for
– Not too large – to avoid numerical problems
– Good suggestion – a random cut value in the network; we know from the max flow/min
cut theorem, that the cut value will be not smaller than tha maximum flow in the
network
Generalized networks, network with side constraints,
processing networks
• In a generalized network, arcs have gain factors: these are the numbers
by which we multiply the entering flow to get the outflow:
– E.g. the increase/decrease coefficient 0.9 may denote the leaking pipeline
– E.g. the increase coefficient of 1.1 may denote value inrease of the object
• Networks with side constraints – it may be necessary to introduce
additional constraints which are not network constraints, e.g.
– Specialized algorithms which solve the network part via network simplex algorithms and
the rest with a normal simplex and then the solutions are combined.
• Processing networks – very useful to model engineering systems:
additional processing nodes, in which flows in the neighbouring nodes
should appear in a specified proportions