Professional Documents
Culture Documents
06-Transshipment and Shortest Path
06-Transshipment and Shortest Path
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
1
4
s 3 t
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
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 = ∑ f si
i
at source s conservation of
∑i f it = f at sink t flow relations
⎫⎪
∑i f ij = ∑k f jk ⎬ at each transshipment node j
⎪⎭
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 6
MAX FLOW PROBLEM
node j
we denote a path by
P = { ( i, k ), ( k, l ), . . . , ( m, j ) }
•( 1, 2 ), ( 2, 5 ), ( 5, 4 ) is a path from 1 to 4
P = { ( i, k ), ( k, l ), . . . , ( m, i ) }
the definition is
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 ) = ∑
i ∈S
k ij
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
s to t is constrained by an s – t cut
and
7 1 9
s 3 t
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) 1 (0, 9)
s (1, 3) t
(0, 9) (1,8)
f = 1 2
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 21
EXAMPLE
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
(3,7) 1 (0, 9)
s (3, 3) t
(0, 9) (3, 8)
2
f = 3
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 23
EXAMPLE
s t
9 5
2
f = min { 5, 9 } = 5
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 24
EXAMPLE
(3,7) 1 (0, 9)
s (3, 3) t
(5, 9) (8, 8)
2
f = 8
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 25
EXAMPLE
1
4 9
s t
f = min { 4, 9 } = 4
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 26
EXAMPLE
(7,7) 1 (4, 9)
s (3, 3) t
(5, 9) (8, 8)
2
f = 12
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 27
EXAMPLE
1
5
s t
3
4
2
f = min { 4, 3, 5 } = 3
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 28
EXAMPLE
(7,7) 1 (7, 9)
s (0, 3)
t
(8, 9) (8, 8)
2
30
1 3
40 50
s 15 20 25 t
30 30
2 4
50
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 31
EXAMPLE OF A NETWORK WITH
UNDIRECTED ARCS
To make the problem realistic, we may view the
capacities as representing traffic flow limits: the
directed arcs correspond to unidirectional streets
and the problem is to place one-way signs on each
street (i, j) not already directed, so as to maximize
traffic flow from s to t
The procedure is to replace each undirected arc by
two directed arcs (i, j) and ( j, i) to deter-mine the
maximal s – t flow
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 32
EXAMPLE OF A NETWORK WITH
3 UNDIRECTED ARCS
1 30 3
40 50
15 15 20
s 25 25 t
20
30 30
2 4
50
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 33
EXAMPLE OF A NETWORK WITH
3 UNDIRECTED ARCS
We apply the max flow scheme to the directed
network and give the following interpretations to
the flows on the max flow bidirectional arcs that
are the initially undirected arcs ( i, j ) : if
fij > 0 , fji > 0 and fij > fji
set up the flow from i to j with value fij – fji
and remove the arc ( j, i )
The computation of the max flow f for this
example is left as a homework exercise
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 34
EXAMPLE OF A NETWORK WITH
3 UNDIRECTED ARCS
(30 ,30)
30
1 3 (30 50
(40 ,50)
(40
(30 ,40)
40
20
s 15 15 25 (10 ,25)
25 t
20
(10 ,20)
30
(30 ,30) (30 ,30)
30
2 4
(30 ,50)
50
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 35
EXAMPLE OF A NETWORK WITH
3 UNDIRECTED ARCS : RESULT
flow: s 1 3 t = 30
flow: s 2 4 t = 30
flow: s 1 4 3 t = 10
and so the maximum flow is 30 + 30 + 10 = 70
one way signs should be put from 1 4 and 4 3
an alternative routing of a flow of 10 is the path
s 1 2 4 3 t which would require one
way signs from 1 2 and 4 3
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 36
NETWORKS WITH MULTIPLE
SOURCES AND MULTIPLE SINKS
We next consider a network with several supply
s1 t1
k
r
o
ŝ s2 t2 t̂
w
. . .
. . .
t
e
sm tn
n
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 38
MULTIPLE ─ SOURCE / MULTIPLE ─
SINK NETWORK EXAMPLE
15 sink with
2 5 demand 15
10 sink with
5
10 5 demand 20
1 3 5 6 10 8
20
5 5
10 10
sources
each with a 4 5 7
supply 20
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 39
MULTIPLE ─ SOURCE / MULTIPLE ─
SINK NETWORK EXAMPLE
2 15 super sink
5
node t̂
10 15
5 t̂
10 5
20 20
ŝ 1 3 5 6 10 8
20
20 5
5 10 10
super source
node ŝ 5
4 7
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 40
MULTIPLE ─ SOURCE / MULTIPLE ─
SINK NETWORK EXAMPLE
The transshipment problem is feasible if and only
demand of 35 ;
2 15 5 f
15
10 t̂
5
10 5
20
1 3 5 6 10 8
20
20 5 5
10 10
ŝ
20 4 5 7
f
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 42
MULTIPLE ─ SOURCE / MULTIPLE ─
SINK NETWORK EXAMPLE
The minimum cut is shown and has capacity
15 + 5 + 5 + 5 = 30
minimum shortage is 5
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 43
APPLICATION TO MANPOWER
SCHEDULING
Consider the case of a company that must
complete its four projects in 6 months
manpower
earliest start latest finish
project requirements
month month
( person/month)
A 1 4 6
B 1 6 8
C 2 5 3
D 1 6 4
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 44
APPLICATION TO MANPOWER
SCHEDULING
There are the following additional constraints:
the company has only 4 engineers
at most 2 engineers may be assigned to any
one project in a given month
no engineer may be assigned to more than
one project at any time
The question is whether there is a feasible assign-
ment and if so determine the optimal assignment
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 45
APPLICATION TO MANPOWER
SCHEDULING
The solution approach is to set up the problem
as a transshipment network
the sources are the 6 months of duration
the sinks are the 4 projects
an arc (i, j) is introduced whenever a feasible
assignment of the engineers working in
month i can be made to project j with
k ij = 2 i = 1, 2, . . . , 6 , j=A,B,C,D
there is no arc (1, C) since project C cannot
start before month 2
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 46
APPLICATION TO MANPOWER
SCHEDULING
each arc has capacity 2
4 1
A 6
4 2
man / months
man / months
B 8
4 3
demands
supplies
4 4 C 3
4 5
D 4
4 6
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 47
APPLICATION TO MANPOWER
SCHEDULING
The transshipment problem is feasible if the total
demand
6 + 8 + 3 + 4 = 21
can be met
(4, 4)
2 (2, 2)
(2, 2)
(4, 4)
(2, 2) B (8, 8)
3
ŝ (2, 2) t̂
(4, 4) 4 (2, 2) (1, 2) C (3, 3)
(3, 4)
5 (2, 2)
(2, 4)
D (4, 4)
6 (2, 2)
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 49
APPLICATION TO MANPOWER
SCHEDULING
(2, 2)
1 (6, 6)
(4, 4) (2, 2) (2, 2) A
21
(4, 4)
2 (2, 2)
(2, 2) (8, 8)
(4, 4)
(2, 2) B
3
ŝ (2, 2) t̂
(3, 3)
(4, 4) 4 (2, 2) C
(1, 2) 21
(3, 4)
5 (2, 2)
(4, 4)
(2, 4)
D
6 (2, 2)
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 50
SHORTEST ROUTE PROBLEM
{ ( 1, i 1 ) , ( i 1, i 2 ) , … , ( iq , n ) }
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 51
SHORTEST ROUTE PROBLEM
data parameters
d ij ≥ 0
9
2 6
3 6
2
1 7 3 3
1
3
4
4 5
3
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 58
EXAMPLE : SHORTEST PATH
The problem is to
0
3,7,4,∞ ,∞ ⎤⎦
Steps 0 and 1 : L (0 ) = ⎡⎣0 ,,3,7,4,
initial label 1
label in iteration 4 5
L (4) = ⎡0,3,5,4,7,10 ⎤
⎣ ⎦
6
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 61
EXAMPLE : SHORTEST PATH
9
2 6 5
3 1 6
2
1 7 3 3 3
0
1 3
4 2
4 5 4
3
The shortest distance is 10 obtained from the path
{ ( 1, 4 ) , ( 4, 5 ) , ( 5, 6 ) }
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 62
PATH RETRACING
network
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 64
EXAMPLE : FIVE – NODE NETWORK
4 8 10
0 1 2 3 4
3 3 2 3
4 4 8
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 65
EXAMPLE : FIVE – NODE NETWORK
L (0 ) = ⎡0 ,,3,4,8,10,
⎣
3,4,8,10,∞ ⎤
⎦
0
L (1) = ⎡0 ,,3,4,7,10
⎣
3, 4,7,10 ⎤
⎦
1
L (2) = ⎡0 ,3,4,6,8
⎣
, 3, 4, 6,8 ⎤
⎦
2
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 66
EXAMPLE : FIVE – NODE NETWORK
L (3) = ⎡0 , 3, 4, 6, 8 ⎤
⎣ ⎦
determines the
We retrace the path to get
8 = 4
O + d 24
node 2 4
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 67
EXAMPLE : FIVE – NODE NETWORK
1 4 8 3 10
2
0 1 2 3 4 4
3 3 2 3
4 4 8
0
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 68
APPPLICATION : EQUIPMENT
REPLACEMENT PROBLEM
We consider the problem of replacing old
equipment or continuing its maintenance
As equipment ages, the level of maintenance
required increases and typically, this results in
increased operating costs
O&M costs may be reduced by replacing aging
equipment; however, replacement requires addit-
ional capital investment and so higher fixed costs
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 69
APPPLICATION : EQUIPMENT
REPLACEMENT PROBLEM
The problem is how often to replace equipment
fixed variable
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 70
EXAMPLE: EQUIPMENT
REPLACEMENT
Equipment replacement is planned during the
next 5 years
The cost elements are
p j = purchase costs in year j
s j = salvage value of original
equipment after j years of use
c j = O&M costs in year j of operation
of equipment with the property that
… cj < cj + 1 < cj + 2 < …
We formulate this problem as a shortest route
problem on a directed network
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 71
EQUIPMENT REPLACEMENT
PROBLEM
end of
planning
d16
d15 period
d14 d36
d13 d35
1 d12
2 d23
3 4 5 6
d34 d45 d56
d24 d46
d25
start of d26
planning period
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 72
APPPLICATION : EQUIPMENT
REPLACEMENT PROBLEM
where, the “distances” d ij are defined to be
finite if i < j , i.e., year i precedes the year j ,
with
j−i
d ij = pi − s j−i + ∑ cτ j > i
τ =1
a total of n ( n + 1) arcs
2
⎧ j
⎪ sj + cj H j
d ij = ⎨ ∑
k = i +1
Lk if j > i
⎪ ∞ otherwise
⎩
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 80
COMPACT BOOK STORAGE IN A
LIBRARY
For this network, we solve the shortest route
{ ( 0, 7 ) , ( 7, 9 ) , ( 9,15 ) , (1 5, 17 ) }
the interpretation of this solution is :
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 81
COMPACT BOOK STORAGE IN A
LIBRARY
store all the books of height ≤ H7 on the
shelf of height H7
store all the books of height ≤ H9 but > H7
on the shelf of height H9
store all the books of height ≤ H15 but > H9
on the shelf of height H15
store all the books of height ≤ H17 but > H15
on the shelf of height H17
© 2006 – 2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 82