ECE 307 – Techniques for Engineering
Decisions
Transshipment and Shortest Path Problems
George Gross
Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
1
TRANSSHIPMENT PROBLEMS
We consider the shipment of a homogeneous
commodity from a specified point or source to a
particular destination or sink
In general, the source and the sink need not be
directly connected; rather, the flow goes through
the transshipment points or the intermediate nodes
The objective is to determine the maximal flow
from the source to the sink
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
2
FLOW NETWORK EXAMPLE
1
4
s
t
3
2
5
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
3
TRANSSHIPMENT PROBLEMS
nodes 1, 2, 3, 4, and 5 are the transshipment
points
arcs of the network are ( s, 1 ), ( s, 2 ), ( 1, 2 ),
( 1, 3 ), ( 2, 5 ), ( 3, 4 ), ( 3, 5 ), ( 4, 5 ), ( 5, 4 ), ( 4, t ),
( 5, t ) ; the existence of an arc from 4 to 5 and
from 5 to 4 allows bidirectional flows between
the two nodes
each arc may be constrained in terms of a
limit on the flow through the arc
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
4
MAX FLOW PROBLEM
We denote by f ij the flow from i to j and this
equals the amount of the commodity shipped
from i to j on an arc ( i , j ) that directly connects
the nodes i and j
The problem is to determine the maximal flow f
from s to t taking into account the flow limits k ij
of each arc ( i , j )
The mathematical statement of the problem is
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
5
MAX FLOW PROBLEM
max Z = f
s.t .
0 ≤ f ij ≤ k ij
∀ arc ( i , j ) that connects
nodes i and j
∑ f si
=
f
at source s
i
∑i f it
=
∑i f ij
f
=
at sink t
∑k f jk
conservation of
flow relations
⎫⎪
⎬ at each transshipment node j
⎪⎭
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
6
MAX FLOW PROBLEM
While the simplex approach can solve the max
flow problem, it is possible to construct a highly
efficient network method to find f directly
We develop such a scheme by making use of
network or graph theoretic notions
We start by introducing some definitions
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
7
DEFINITIONS OF NETWORK TERMS
Each arc is directed and so for an arc ( i , j ), f ij ≥ 0
A forward arc at a node i is one that leaves the
node i to some node j and is denoted by ( i , j )
A backward arc at node i is one that enters node
i from some node j and is denoted by ( j , i )
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
8
DEFINITIONS OF NETWORK TERMS
A path connecting node i to node j is a sequence
of arcs that starts at node i and terminates at
node j
we denote a path by
P = { ( i, k ), ( k, l ), . . . , ( m, j ) }
in the example network
•( 1, 2 ), ( 2, 5 ), ( 5, 4 ) is a path from 1 to 4
•( 1, 3 ), ( 3, 4 ) is another path from 1 to 4
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
9
DEFINITIONS OF NETWORK TERMS
A cycle is a path with i = j , i.e.,
P = { ( i, k ), ( k, l ), . . . , ( m, i ) }
We denote the set of nodes of the network by N
the definition is
N = { i : i is a node of the network }
In the example network
N = { s , 1, 2, 3, 4, 5, t }
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
10
NETWORK CUT
A cut is a partitioning of nodes into two distinct
subsets S and T with
N = S ∪T
and S ∩ T = ∅
We are interested in cuts with the property that
s ∈ S and t ∈ T
the sets S and T provide an s – t cut
in the example network,
S = { s , 1, 2 } and T = { 3, 4, 5, t }
provide an s – t cut
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
11
NETWORK CUT
The capacity of a cut is
Κ (S ,T ) =
k ij
∑
i ∈S
j∈T
In the example network with
S = { s, 1, 2 } and T = { 3, 4, 5, t }
we have
Κ (S ,T ) = k 13 + k 25
but for the cut with
S = {s, 1, 2, 3, 4 } and T = { 5, t }
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
12
NETWORK CUT
Κ (S ,T ) = k 4, t + k 4,5 + k 3,5 + k 2,5
Now, arc (5, 4) is directed from a node in T to a
node in S and is not included in the summation
An important characteristic of the s – t cuts of
interest is that if all the arcs in the cut are
removed, then no path exists from s to t ;
consequently, no flow is possible since any flow
from s to t must go through the arcs in a cut
The flow is limited by the capacity of the cut
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
13
NETWORK CUT LEMMA
For any directed network, the flow f from
s to t is constrained by an s – t cut
f ≤ Κ (S ,T ) for any cut S ,T
Corollaries of this lemma are
(i) max flow ≤ Κ (S ,T ) ∀ S ,T
and
Κ
(S ,T )
(ii) max flow ≤ min
S ,T
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
14
MAX – FLOW – MIN – CUT THEOREM
For any network, the value of the maximal flow
from s to t is equal to the minimal cut, i.e., the
cut S , T with the smallest capacity
The max-flow min-cut theorem allows us, in
principle, to find the maximal flow in a network by
finding the capacities of all the cuts and
determining the cut with the smallest capacity
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
15
MAX FLOW
The maximal flow algorithm is based on finding a
path through which a positive flow from s to t can
be sent, the so – called flow augmenting path; the
procedure is continued until no such flow
augmenting path can be found and therefore we
have the maximal flow
The maximal flow algorithm is based on the
repeated application of the labeling procedure
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
16
LABELING PROCEDURE
The labeling procedure is used to find a flow
augmenting path from s – t
We say that a node j can be labeled if
and only
if flow can be sent from s to t
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
17
LABELING PROCEDURE
Step 0 : start with node s
Step 1 : label node j given that node i is
labeled only if
(i) either there exists an arc ( i , j ) and
f ij < k ij
(ii) or there exists an arc ( j , i ) and
f ji > 0
Step 2 : if j = t , stop; else, go to Step 1
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
18
THE MAX FLOW ALGORITHM
Step 0 : start with a feasible flow
Step 1 : use the labeling procedure to find a flow
augmenting path
Step 2 : determine the maximum value δ for the
max increase (decrease) of flow on all
forward (backward) arcs
Step 3 : use the labeling procedure to find a flow
augmenting path; if no such path exists,
stop and go to Step 2
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
19
EXAMPLE
Consider the simple network with the flow
capacities on each arc indicated
7
1
s
9
t
3
9
8
2
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
20
EXAMPLE
We initialize the network with a flow 1
(1,7)
s
1
(0, 9)
t
(1, 3)
(0, 9)
f = 1
(1,8)
2
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
21
EXAMPLE
We apply the labeling procedure
6
1
s
t
2
7
2
f = min { 6, 2, 7 } = 2
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
22
EXAMPLE
Consider the simple network with the flow and the
capacity on each arc ( i, j ) indicated by ( f ij , k ij )
(3,7)
1
s
(0, 9)
t
(3, 3)
(0, 9)
f = 3
(3, 8)
2
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
23
EXAMPLE
We repeat application of the labeling procedure
s
t
5
9
2
f = min { 5, 9 } = 5
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
24
EXAMPLE
We increase the flow by 5
(3,7)
1
s
(0, 9)
t
(3, 3)
(5, 9)
f = 8
(8, 8)
2
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
25