Professional Documents
Culture Documents
ECE 307 - Techniques For Engineering Decisions: Networks and Flows
ECE 307 - Techniques For Engineering Decisions: Networks and Flows
ECE 307 - Techniques For Engineering Decisions: Networks and Flows
Decisions
Networks and Flows
George Gross
Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
costs of transportation
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 5
THE TRANSPORTATION PROBLEM
supply demand
⎧ ⎫
⎪1 a1 b1
⎪
transportation 1 ⎪⎪
⎪ links with ⎪
⎪ ⎪
⎪2
a2 costs
b2 ⎪
warehouses
⎪
2⎪
markets
.. ⎪
⎪
⎨
ci j .. ⎪
⎪
. . ⎬
ai bj ⎪
⎪i j⎪
⎪ c i j = ∞ whenever ⎪
⎪
⎪
.. .. ⎪
⎪
⎪
. warehouse i cannot . ⎪
⎪m am bn n⎪
⎩ ship to market j ⎪
⎭
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 6
THE TRANSPORTATION PROBLEM
i = 1, 2, ... , m
j = 1, 2, ... , n
∑
j =1
xij ≤ ai i = 1, 2, ... , m
∑
i =1
xij ≥ bj j = 1, 2, ... , n
i = 1, 2, ... , m
xij ≥ 0
j = 1, 2, ... , n
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 10
LP FORMULATION OF THE
TRANSPORTATION PROBLEM
Note that feasibility requires
m n
∑
i =1
ai ≥ ∑
j =1
bj
When
m n
∑
i =1
ai = ∑
j =1
bj
s .t .
n
∑
j =1
xij = ai
i = 1, ... , m
m
∑ xij = bj
i =1 j = 1, ... , n
xij ≥ 0
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 12
TRANSPORTATION PROBLEM
EXAMPLE
market j
w/h i M1 M2 M3 M4 supplies
x 11 x 12 x 13 x 14
W1 a1
c 11 c 12 c 13 c 14
x 21 x 22 x 23 x 24
W2 a2
c 21 c 22 c 23 c 24
x 31 x 32 x 33 x 34
W3 a3
c 31 c 32 c 33 c 34
demands b1 b2 b3 b4
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 13
STANDARD TRANSPORTATION
PROBLEM
The standard transportation problem has
m n variables x i j
m + n equality constraints
Since
m n m n
∑ ∑
i =1 j =1
xi j = ∑
i =1
ai = ∑
j =1
bj
W1 3
2 2 2 1
W2 7
10 8 5 4
W3 5
7 6 6 8
bj 4 3 4 4
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 15
THE LEAST – COST RULE
PROCEDURE
This scheme is used to generate an initial basic
3
W1 3
2 2 2 1
W2 7
10 8 5 4
W3 5
7 6 6 8
bj 4 3 4 4
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 18
APPLICATION OF THE LEAST – COST
RULE
The remaining demand at M 4 is
4–3 =1
min { a 2 , b 4 } = min { 7 , 1 } = 1
x 34 = 0
7–1 =6,
4
W2 6
10 8 5
0
W3 5
7 6 6
bj 4 3 4
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 22
APPLICATION OF THE LEAST – COST
RULE
pick x 23 to enter the basis
set
x 23 = min { 6, 4 } = 4
and set x 33 = 0
eliminate column 3 and reduce the supply at
W 2 to
6–4 = 2
For the reduced tableau
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 23
APPLICATION OF THE LEAST – COST
RULE
market j
M1 M2 ai
w/h i
0
W2 2
10 8
3
W3 5
7 6
bj 4 3
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 24
APPLICATION OF THE LEAST – COST
RULE
pick x 32 to enter the basis
set
x 32 = min { 3, 5 } = 3
and set x 22 = 0
eliminate column 2 in the reduced tableau
and reduce the supply at W 3 to
5–3 = 2
The last reduced tableau is
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 25
APPLICATION OF THE LEAST – COST
RULE
market j
M1 ai
w/h i
2
W2
10
2
2
W3
7
bj 4
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 26
APPLICATION OF THE LEAST – COST
RULE
pick x 31 to enter the basis
set
x 31 = min { 2, 5 } = 2
reduce the demand at M 1 to
4–2 = 2
the value of
x 21 = 2
is obtained by default
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 27
INITIAL BASIC FEASIBLE SOLUTION
market j
w/h i M1 M2 M3 M4 ai
3
W1 3
2 2 2 1
2 4 1
W2 7
10 8 5 4
2 3
W3 5
7 6 6 8
bj 4 3 4 4
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 28
APPLICATION OF THE LEAST – COST
RULE
The feasible solution involves only the basic
3 4
∑ ∑
i =1 j =1
c ij x i j = 1 ⋅ 3 + 4 ⋅ 1 + 5 ⋅ 4 + 6 ⋅ 3 + 7 ⋅ 2 + 10 ⋅ 2
= 79
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 29
THE STANDARD TRANSPORTATION
PROBLEM
The primal problem is
m n
⎫
min Z = ∑ ∑
i =1 j =1
cij xij ⎪
⎪
s .t . ⎪
⎪
n ⎪
⎪
ui ↔ ∑ xij = ai ⎬ ( P)
i = 1, ... , m ⎪
j =1
m ⎪
⎪
v j ↔ ∑
i =1
xij = bj
j = 1, ... , n ⎪
⎪
xij ≥ 0 ⎪⎭
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 30
THE STANDARD TRANSPORTATION
PROBLEM
The dual problem is
m n ⎫
max W = ∑
i =1
a i ui + ∑ b j v j
j =1
⎪
⎪
⎪
s.t . ⎪
⎪
⎪
ui + v j ≤ c i j i = 1, ... , m ⎬ ( D)
xi j ↔ ⎪
⎪
j = 1, ... , n ⎪
⎪
u i , v j are unrestricted in sign ⎪
⎪⎭
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 31
THE STANDARD TRANSPORTATION
PROBLEM
The complementary slackness conditions for ( D ) are
i = 1, ... , m
x i*j [ u i* + v *j − c i*j ] = 0
j = 1, ... , n
Due to the equalities in ( P ), the other complemen-
u i* + v *j < c i j ⇒ x i*j = 0
transportation problem
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 33
THE u–v METHOD
slackness conditions
ui + v j = c i j ∀ basic x i j
c pq = min
pq ∋ x pq
{c } pq
is nonbasic
previously discussed
require
ui + v j = c i j ∀ basic x i j
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 38
STANDARD TRANSPORTATION
PROBLEM EXAMPLE
We start with the basic feasible solution and apply
the complementary slackness conditions
u1 + v 4 = 1 = c 14
u 2 + v 4 = 4 = c 24
u2 + v3 = 5 = c 23
u3 + v 2 = 6 = c 32
u3 + v1 = 7 = c 31
u2 + v1 = 10 = c 21
We have 6 equations in 7 unknowns and so there
is an infinite number of solutions
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 39
STANDARD TRANSPORTATION
PROBLEM EXAMPLE
Arbitrarily, we set
v4 = 0
and solve the equations above to obtain
u1 = 1
u2 = 4
v3 = 1
v1 = 6
u3 = 1
v2 = 5
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 40
STANDARD TRANSPORTATION
PROBLEM EXAMPLE
The ci j for the nonbasic variables are
x 11 : c 11 = c 11 − ( u1 + v 1 ) = 2 − (1 + 6) = − 5
x 12 : c 12 = c 12 − ( u1 + v 2 ) = 2 − (1 + 5) = − 4
x 13 : c 13 = c 13 − ( u1 + v 3 ) = 2 − (1 + 1) = 0
x 34 : c 34 = c 34 − ( u 3 + v 4 ) = 8 − (1 + 0 ) = 7
x 33 : c 33 = c 33 − ( u 3 + v 3 ) = 6 − (1 + 1) = 4
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 41
STANDARD TRANSPORTATION
PROBLEM EXAMPLE
We determine
c pq = min
= c 11 = − 5
pq ∋ x pq
is nonbasic
W1 θ 3–θ 3
W2 2–θ 4 1+θ 7
W3 2 3 5
bj 4 3 4 4
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 43
STANDARD TRANSPORTATION
EXAMPLE
Therefore,
max θ = min { 2, 3 } = 2
x 14 = 1, x 11 = 2, x 31 = 2, x 32 = 3, x 23 = 4, x 24 = 3
u1 = 0 2 1 3
2 2 2 1
u2 = 3 4 3 7
10 8 5 4
u3 = 5 2 3 5
7 6 6 8
bj 4 3 4 4
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 45
STANDARD TRANSPORTATION
EXAMPLE
The complementary slackness conditions of the
u 1 + v 1 = c 11 = 2
u 1 + v 4 = c 14 = 1
u 2 + v 3 = c 23 = 5
u 2 + v 4 = c 24 = 4
u 3 + v 1 = c 31 = 7
u 3 + v 2 = c 32 = 6
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 46
STANDARD TRANSPORTATION
EXAMPLE
We set
u1 = 0
and therefore
v3 = 2 v1 = 2
u3 = 5 u3 = 5
v2 = 1 v2 = 0
We compute c i j for each nonbasic variable x i j
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 47
STANDARD TRANSPORTATION
EXAMPLE
c12 = c 12 − ( u1 + v 2 ) = 2 − (0 + 1) = 1
c13 = c 13 − ( u1 + v 3 ) = 2 − (0 + 2) = 0
c21 = c 21 − ( u 2 + v 1 ) = 10 − (3 + 2) = 5
c22 = c 22 − ( u 2 + v 2 ) = 8 − (3 + 1) = 4
c33 = c 33 − ( u 3 + v 3 ) = 6 − (5 + 2) = −1
c34 = c 34 − ( u 3 + v 4 ) = 8 − (5 + 1) = 2
only possible improvement
W1 2+θ 1–θ 3
W2 4–θ 3+θ 7
W3 2–θ 3 θ 5
bj 4 3 4 4
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 49
STANDARD TRANSPORTATION
EXAMPLE
The limiting value of θ is
θ = min { 2, 4, 1 } = 1
3
u1 = 0 3
2 2 2 1
u2 = 4 3 4
7
10 8 5 4
1 3 1
u3 = 5 8
5
7 6 6
bj 4 3 4 4
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 51
STANDARD TRANSPORTATION
EXAMPLE
We evaluate c i j for each nonbasic variable;
4 cities
6
The costs of supplying each 10 kWh are given
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 53
ELECTRICITY COSTS
to city supplies
from
1 2 3 4 (106 kWh)
1 8 6 10 9 35
plant 2 9 12 13 7 50
3 14 9 16 5 40
demands 125
45 20 30 30
(106 kWh)
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 54
ELECTRICITY COSTS
to city supplies
from
1 2 3 4 (106 kWh)
1 balanced
8 6 10 9 35
plant transportation
2 9 12 13 7 50
3 problem
14 9 16 5 40
demands 125
45 20 30 30
(106 kWh)
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 55
ELECTRICITY ALLOCATION EXAMPLE
We note that
3 4
∑ ai = ∑bj
i =1 j =1
problem
cost rule
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 56
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION
to city supplies
from 1 2 3 4 (106 kWh)
1 0 35
8 6 10 9
plant 2 0 50
9 12 13 7
3 30 40
10
14 9 16 5
demands
45 20 30 30 125
(106 kWh)
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 57
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION
And we set
x 34 = 30
x 14 = 0
x 24 = 0
1 20 35
15
8 6 10
plant 2 0 50
9 12 13
3 0 10
14 9 16
demands
45 20 30
(106 kWh)
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 59
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION
and so we set
x 12 = 20
x 22 = 0
x 32 = 0
1 15 0 15
8 10
plant 2 50
9 13
3 10
14 16
demands
30
45 30
(106 kWh)
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 61
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION
and therefore we set
x 11 = 15
x 13 = 0
system
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 62
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION
to city supplies
from (106 kWh)
1 3
2 30 20
50
9 13
plant
3 0 10
14 16
demands
30 30
(106 kWh)
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 63
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION
and therefore we set
x 21 = 30
x 31 = 0
2 20 20
13
plant
3 10 10
16
demands
30
(106 kWh)
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 65
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION
which allows us to set
x 23 = 20
x 33 = 10
The basic feasible solution has the costs
Z = 30 · 5 + 20 · 6 + 15 · 8 + 30 · 9 + 20 · 13 + 10 · 16 = 1080
We improve this solution by using the u – v
scheme
The first tableau corresponding to the initial basic
feasible solution is:
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 66
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION
to city supplies
from 3 4 (106 kWh)
1 2
1 15 20 35
8 6
plant
2 30 20 50
9 13
3 10 30 40
16 5
demands
45 20 30 30
(10 6 kWh)
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 67
STANDARD TRANSPORTATION
EXAMPLE
We compute, the possible improvements at each
nonbasic variable:
c 31 = c 31 − ( u 3 + v 1 ) = 14 − (4 + 8) = 2
c 22 = c 22 − ( u 2 + v 2 ) = 12 − (1 + 6) = 5
c 32 = c 32 − ( u3 + v 2 ) = 9 − (4 + 6) = −1
c 13 = c 13 − ( u1 + v 3 ) = 10 − (0 + 12) = −2
c 14 = c 14 − ( u1 + v 4 ) = 9 − (0 + 1) = 8
c 24 = c 24 − ( u2 + v 4 ) = 7 − (1 + 1) = 5
improvement possible
better possibility
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 68
STANDARD TRANSPORTATION
EXAMPLE
We bring x 13 into the basis and determine the
θ = min { 15, 20 } = 15
1 15 − θ 20 θ 35
2 30 + θ 20 – θ 50
3 10 30 40
bj 45 20 30 30
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 70
STANDARD TRANSPORTATION
EXAMPLE
The adjacent basic feasible solution is
Z = 20 · 6 + 15 · 10 + 45 · 9 + 5 · 13 + 10 · 16 + 30 · 5
u1 = 0 20 15 35
6 10
u2 = 3 45 5 50
9 13
u3 = 6 10 30 40
16 5
demands 45 20 30 30
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 72
STANDARD TRANSPORTATION
EXAMPLE
The complementary slackness conditions obtain
the possible improvements
c 11 = c 11 − ( u1 + v 1 ) = 8 − (0 + 6) = 2
c 31 = c 31 − ( u 3 + v 1 ) = 14 − (6 + 6) = 2
c 22 = c 22 − ( u 2 + v 2 ) = 12 − (3 + 6) = 3
c 32 = c 32 − ( u 3 + v 2 ) = 9 − (6 + 6) = −3
c 14 = c 14 − ( u1 + v 4 ) = 9 − (0 − 1) = 10
c 24 = c 24 − ( u 2 + v 4 ) = 7 − (3 − 1) = 5
only possible improvement
We bring x 32 into the basis and determine its
value θ using
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 73
STANDARD TRANSPORTATION
EXAMPLE
plants
cities
1 2 3 4 ai
1 20 – θ 15 + θ 35
2 45 5 50
3 θ 10 – θ 30 40
bj 45 20 30 30
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 74
STANDARD TRANSPORTATION
EXAMPLE
and so
θ = min { 10, 20 } = 10
The adjacent basic feasible solution is, then,
x 21 = 45 x 12 = 10 x 32 = 10
x 13 = 25 x 23 = 5 x 34 = 30
and the value of Z becomes
Z = 45 · 9 + 10 · 6 + 10 · 9 + 25 · 10 + 5 · 13 30 · 5 =1,020
You are asked to prove, using complementary
slackness conditions, that this is the optimum
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 75
NONSTANDARD TRANSPORTATION
PROBLEM
The nonstandard transportation problem arises
warehouses)
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 79
NONSTANDARD TRANSPORTATION
PROBLEM
Note that the variable x m+1, j is the shortage at
supplies
Smith 200 10
Jones 300 9
Richard 400 8
to plant
from A B
Smith 2 2.5
Jones 1 1.5
Richard 5 3
plant A B
capacity
450 550
( ton )
labor costs
25 20
( $ / ton )
⎡ ⎤ ⎡ ⎤
+ ⎢
50 − 25 − 8 − 5 ⎥x + ⎢ 50 − 20 − 10 − 2.5 ⎥ x
⎢
⎥ RA ⎢
⎥ SB
⎣ 12 ⎦ ⎣ 17.5 ⎦
⎡ ⎤ ⎡ ⎤
+ ⎢
50 − 20 −
9 − 1.5 ⎥ x + ⎢ 50 − 20 − 8 − 3 ⎥ x
⎥ JB
⎢ ⎢
⎥ RB
⎣ 19.5 ⎦ ⎣ 19 ⎦
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 85
EXAMPLE: CANNING OPERATIONS
SCHEDULING
The supply constraints are
x SA + x SB ≤ 200
x JA + x JB ≤ 300
x RA + x RB ≤ 400
The demand constraints are
x SA + x JA + x RA ≤ 450
x SB + x JA + x RB ≤ 550
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 86
EXAMPLE: CANNING OPERATIONS
SCHEDULING
Clearly, all decision variables are nonnegative
standard
is nonbasic
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 90
EXAMPLE SOLUTION
plant j A B supply
grower i
S 200 0 200
13
J 250 50 300
15 19.5
R 0 400 400
19
F 0 100 100
0 0
demand 450 550
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 91
EXAMPLE SOLUTION
u 1 + v 1 = 13 u 2 + v 2 = 19.5
u 2 + v 1 = 15 u 3 + v 2 = 19
u4 +v 2 = 0
nonbasic variables
c 12 = c 12 − ( u1 + v 2 ) = 17.5 − (0 + 17.5) = 0
single possible improvement
plant j A B supply
grower i
S 200 200
13
J 250 – θ 50 + θ 300
15 19.5
R 400 400
19
F θ 100 – θ 100
0 0
demand 450 550
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 94
EXAMPLE SOLUTION
It follows that
u 1 + v 1 = 13 u 2 + v 2 = 19.5
u 2 + v 1 = 15 u 3 + v 2 = 19
u4 + v1 = 0
v 1 = 13 , u 2 = 2 , v 2 = 17.5 , u 3 = 1.5 , u 4 = – 13
c 12 = 17.5 − ( 0 + 17.5) = 0
c 42 = 0 − ( − 13 + 17.5) = − 4.5
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 97
EXAMPLE SOLUTION
Since each c i j is ≤ 0 no more improvement in
profits are
= 15,375 $
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 98
SCHEDULING PROBLEM AS A
STANDARD TRANSPORTATION PROBLEM
The problem is concerned with the weekly
production scheduling over a 4 – week period
production costs from each item
first two weeks $ 10
choices!
variables
⎧1 job j is assigned to machine i
⎪
xij = ⎨
⎪0 otherwise
⎩
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 103
ASSIGNMENT PROBLEM
and the problem constraints can be stated as
n
∑
j =1
x ij = 1 ∀ i each machine does exactly 1 job
n
∑
i =1
x ij = 1 ∀ j each job is assigned
to only 1 machine
ai = 1 ∀i
bj = 1 ∀ j
n n
∑
i =1
ai = ∑
j =1
bj
© 2006-2009 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved. 105
NONSTANDARD ASSIGNMENT
PROBLEM
Suppose we have m machines and n jobs with
m ≠ n
and jobs