Академический Документы
Профессиональный Документы
Культура Документы
Engineering Decisions
Engineering Decision Making Techniques
Topic 1: Course Overview
George Gross
Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
SCOPE OF COURSE
1
EXAMPLES OF DECISION MAKING
PROBLEMS
Introduction of a new product
BASIC THRUSTS
2
THE UNDERLYING BASIS
3
PRODUCT MIX OPTIMIZATION
PROBLEM
product A B C limit
resources required
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
4
PRODUCT MIX OPTIMIZATION
PROBLEM
max Z = 10 x A + 6xB + 4xC objective
xA + xB + xC ≤ 100 labor
⎫
≤ 600 material ⎪
constraints
10 x A + 4 xB + 5 xC
⎪
⎬
2 xA + 2 xB + 6 xC ≤ 300 A & G ⎪
x A , x B , xC
⎪
≥ 0 reality check ⎭
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
5
PRODUCT MIX OPTIMIZATION
PROBLEM
We next examine a sensitivity case correspon-
ding to the use of overtime labor
We are interested in determining how many
overtime hours would be profitable to schedule
without impacting on the optimal product mix
20 hours of labor overtime increases profits
by (20) (3.33) = $ 66.6
as long as the cost of overtime labor does
not exceed $ 66.6 it is worthwhile to use it
the optimal product mix remains unchanged:
since we only produce products A and B and
no product C
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
2 5
8
1 3 6 10
9
4 7
6
OPTIMAL TRAJECTORY PLANNING
5 6 7 8 9
10
2 3 4 2 7 4 6 5 1 4
8 3
1 2 4 3 3 3 2 4 6 6 3
9 4
4 4 1 5 7 3 3
Solution approaches:
enumerate all possibilities: this is, in general,
too time consuming since we need to
consider
3 × 3 × 2 = 18
different routes for this simple case
select the best for each successive stage:
myopic decision making solution leads to the
path
1 2 6 9 10
with costs of 13
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
7
OPTIMAL TRAJECTORY PLANNING
11:
1 4 5 8 10
1 4 6 9 10
optimum
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
8
BUSING PROBLEM
number of students
district
C A
1 210 120
2 210 30
3 180 150
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
BUSING PROBLEM
⎛ A⎞ ⎛ A⎞ ⎛ A⎞
⎜C⎟ = ⎜C⎟ = ⎜C⎟
⎝ ⎠1 ⎝ ⎠2 ⎝ ⎠3
and the only means of attaining the racial
balance goal is through busing
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
9
BUSING PROBLEM
10
THE ENVELOPE QUESTION
like this:
keep x
0.5 x
switch
2
0.5 2x
11
THE ENVELOPE QUESTION
contestant
2
payoff
A has x/2 (0.5) x
switch to B
2
B has x (0.5)
x
The two decision branches are identical from the
view of the decision maker
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
12
DECISION ANALYSIS PROTOTYPE
EXAMPLE
payoff ($)
decision
alternative
land has oil land is dry
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
13
DECISION ANALYSIS PROTOTYPE
EXAMPLE
Sometimes it is possible to undertake further
work before a decision is taken; for example, an
available option before making a decision is to
conduct a detailed seismic survey with costs of
$ 30,000 to obtain a better estimate of the
probability of oil
We construct a decision tree to
visually display the problem
organize systematically the computation
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
a v
f
un oil 670
rve ic
l
su eism
b
il
dr
g
-130
y
fa v dry
ora
s
ble d
sel l 60
do
a oil 700
no il l h
s
su eism dr dry -100
rv
e y ic
e
sel l 90
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
14
A GENERAL FRAMEWORK FOR DECISION
MAKING UNDER UNCERTAINTY
consequences of an outcome
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
15
A GENERAL FRAMEWORK FOR DECISION
MAKING UNDER UNCERTAINTY
DECISION ANALYSIS
16
ECE 307
GRADING POLICY
17
ECE 307 TOPICAL OUTLINE
Introduction: nature of engineering decisions;
structuring of decisions; role of models;
interplay of economics and technical/engine-
ering considerations; decision making under
certainty and uncertainty; good decisions vs.
good outcomes; tools
Resource allocation decision making using the
linear programming framework: problem
formulation; basic approach; duality; economic
interpretation; sensitivity analysis; interpretation
of results
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
18
ECE 307 TOPICAL OUTLINE
19
ECE 307 – Techniques for
Engineering Decisions
Topic 2: Introduction to Linear Programming
George Gross
Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
OUTLINE
problem
1
EXAMPLE 1: HIGH/LOW HEEL SHOE
CHOICE PROBLEM
You are headed to a party and are trying to find a
pair of shoes to wear; you choice is narrowed
down to two candidates:
a high heel pair; and
a low heel pair
The high heel shoes look more beautiful but are
not as comfortable as the competing pair
Which pair should you choose?
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
MODEL FORMULATION
assessment
maximum weight
aspect high low
value (%)
heels heels
esthetics 5.0 4.2 3.6 70
comfort 5.0 3.5 4.8 30
Next you represent your decision in terms of two
decision variables:
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
2
MODEL FORMULATION
weighted assessment as
MODEL FORMULATION
xH + xL = 1
xH ≥ 0 , xL ≥ 0
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
3
PROBLEM STATEMENT SUMMARY
Decision variables:
OPTIMAL SOLUTION
Z * = Z ( x *H , x *L ) ≥ Z ( x H , x L )
4
SOLUTION APPROACH: EXHAUSTIVE
SEARCH
We enumerate all the possible solutions: in this
problem there are only two choices:
⎧ xH = 1 ⎧ xH = 0
A ⎨ B ⎨
⎩ xL = 0 ⎩ xL = 1
We evaluate Z for A and B and compare
Z A = 3.99 Z B = 3.96
so that Z A > Z B and so A is the optimal choice
The optimal solution is
x *
H = 1 , x *
L = 0 and Z * = 3.99
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
CHARACTERISTICS OF A PROGRAMMING/
OPTIMIZATION PROBLEM
Objective is to make a decision among various
alternatives and therefore requires the definition
of the decision variables
The solution of the “best” decision is made
according to some objective and requires the
formulation of the objective function
The decision must satisfy certain specified
constraints and so requires the mathematical
statement of the problem constraints
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
5
CLASSIFICATION OF PROGRAMMING
PROBLEMS
The problem statement is characterized by :
continuous valued
decision variables
integer valued
linear
objective function
non linear
linear
constraints
non linear
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
Linear/nonlinear programming
Static/dynamic programming
Integer programming
Mixed programming
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
6
EXAMPLE 2: CONDUCTOR PROBLEM
A company is producing two types of conductors
for EHV transmission lines
production
metal needed profits
type conductor capacity
(tons/unit) ($/unit)
(unit/day)
1 ACSR 84/19 4 1/6 3
2 ACSR 18/7 6 1/9 5
PROBLEM ANALYSIS
7
MODEL CONSTRUCTION
Z = profits ($/day)
= 3 x1 + 5 x2
PROBLEM STATEMENT
Objective function:
max Z = 3 x 1 + 5 x 2
Constraints:
capacity limits:
x1 ≤ 4 x2 ≤ 6
metal supply limit:
x1 x2
+ ≤ 1
6 9
common sense requirements:
x 1 ≥ 0, x 2 ≥ 0
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
8
PROBLEM STATEMENT
max Z = 3x1 + 5x 2
s .t .
x1 ≤ 4
x2 ≤ 6
x1 x
+ 2 ≤ 1
6 9
x1 ≥ 0 , x2 ≥ 0
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
x2 x1 = 4
( 4,0 )
( 0, 0 ) x1
x 1 ≤ 4, x 1 ≥ 0 , x 2 ≥ 0
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
9
CONSTRUCTION OF THE FEASIBLE
REGION
x2
x2 = 6
( 0 , 6)
x 2 ≤ 6, x 2 ≥ 0 , x 1 ≥ 0
( 0, 0 ) x1
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
x2
( 0,9) x1 x2
+ ≤1
6 9
( 6,0)
( 0,0)
x1
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
10
THE FEASIBLE REGION
x1 = 4
x2
( 2, 6) x2 = 6
( 0, 6)
feasible
region
( 4, 3)
x1 x2
+ = 1
6 9
( 0, 0 ) x1
( 4,0 )
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
FEASIBLE SOLUTIONS
x2 x1 = 4
( 2, 6)
x2 = 6
( 0, 6)
D max Z = 3 x 1 + 5 x 2
(1.5, 4.5)
Z = 27 ( 4, 3)
° ( 2, 2 ) x1 x2
Z = 16 + = 1
6 9
( 0, 0 ) ( 4,0 ) x1
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
11
CONTOURS OF CONSTANT Z
x2 x1 = 4
( 0 , 6) ( 2, 6)
x2 = 6
Z = 25
Z = 20 max Z = 3 x1 + 5 x2
Z = 15
Z = 36
Z = 10 ( 4, 3)
x1 x2
( 0 , 2) + = 1
6 9
( 0, 0 ) ( 4,0 ) x1
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
OPTIMAL SOLUTION
solution
x *1 = 2 and x *2 = 6
Z * = 3 x *1 + 5 x *2 = 36
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
12
LINEAR PROGRAMMING (LP)
PROBLEM
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
13
EXAMPLE 3: ONE-POTATO, TWO-
POTATO PROBLEM
The known data are summarized in the table
source 1 source 2
product sales limit (tons)
uses uses
F 20% 30% 1.8
H 20% 10% 1.2
C 30% 30% 2.4
profits ($/ton) 5 6
ANALYSIS
Decision variables:
x1 = quantity purchased from source 1
x2 = quantity purchased from source 2
Objective function:
max Z = 5 x1 + 6 x2
Constraints:
0.2 x1 + 0.3 x2 ≤ 1.8 (F)
0.2 x1 + 0.1 x2 ≤ 1.2 (H) x1 ≥ 0 , x2 ≥ 0
0.3 x1 + 0.3 x2 ≤ 2.4 (C)
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
14
FEASIBLE REGION DETERMINATION
x2 x2
6 freedom fries 12
F 10
4
8
hash browns
2
H
x1 6
0 2 4 6 8
x2
4
8
chips 2
6
C 0 2 4 6 8 x1
4
2
0 2 4 6 8 x1
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
x2
12
10
8 feasible
region
6
4
2
x1
2 4 6 8 10 12
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
15
EXAMPLE 3: CONTOURS OF
CONSTANT Z
Z = 36 x2
max Z = 5 x 1 + 6 x 2
Z = 30
6
Z = 24 Z = 40.5
5
Z = 18
4
3 ( 4.5, 3)
2
1
x1
1 2 3 4 5 6
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
x *1 = 4.5 x *2 = 3
Z * = 5 x *1 + 6 x *2 = 40.5
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
16
OBSERVATIONS
needed
corner points
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
17
EXAMPLE 3: THE SIMPLEX
APPROACH
x2
Z = 36 max Z = 5 x1 + 6 x2
( 0 , 6) 6
5
Z = 40.5
4
3
( 4.5, 3)
2
1 Z = 30
Z = 0 ( 6,0 )
( 0, 0 ) 0
1 2 3 4 5 6
x1
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
step x1 x2 Z
0 0 0 0
1 0 6 36
2 4.5 3 40.5
3 6 0 30
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
18
EXAMPLE 3 : THE SIMPLEX METHOD
Z = 36 x
2
(0,6) max Z = 5 x1 + 6 x 2
6
5
4
Z = 40.5
3 (4.5,3)
1 Z = 30
Z=0 (6,0)
(0,0) 0 x1
1 2 3 4 5 6
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
19
REVIEW
variables
an objective function
REVIEW
Key attributes of an LP
objective function is linear
constraints are linear
Basic steps in formulating a programming
problem
definition of decision variables
statement of objective function
formulation of constraints
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
20
REVIEW
1 25 98 4
2 15 95 3
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
21
EXAMPLE 4: INSPECTION OF GOODS
PRODUCED
Each error costs $ 2
EXAMPLE 4: FORMULATION
Objective function
22
EXAMPLE 4: FORMULATION
4 + 2 (25)(0.02) = 5 $/hr
EXAMPLE 4: FORMULATION
Constraints:
job completion:
8(25) x1 + 8(15) x2 ≥ 1800
⇔ 200 x1 + 120 x2 ≥ 1800
⇔ 5 x1 + 3 x2 ≥ 45
availability limit:
x1 ≤ 8
x2 ≤ 10
nonnegativity:
x1 ≥ 0 , x2 ≥ 0
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
23
EXAMPLE 4: PROBLEM STATEMENT
SUMMARY
Decision variables:
x1 = number of grade 1 inspectors assigned
x2 = number of grade 2 inspectors assigned
Objective function:
min Z = 40 x1 + 36 x2
Constraints:
5 x1 + 3 x2 ≥ 45
x1 ≤ 8
x2 ≤ 10
x1 ≥ 0 , x2 ≥ 0
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
solution
24
EXAMPLE 5: HYDROELECTRIC
POWER SYSTEM OPERATIONS
We consider a single operator of a system
a two–period horizon
EXAMPLE 5: HYDROELECTRIC
POWER SYSTEM OPERATIONS
res A wA wA wB wB
res A plant res B plant
inflow A B
sA sB
res B
inflow
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
25
EXAMPLE 5: RESERVOIR DATA IN kAf
EXAMPLE 5: SYSTEM
CHARACTERISTICS
A 150
B 87.5
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
26
EXAMPLE 5: SYSTEM
CHARACTERISTICS
Demand in MWh ( for each period )
up to 50,000 MWh can be sold @ $ 20/MWh
all additional MWh are sold @ $ 14/MWh
$/MWh
non-linear objective
function
14 $/MWh
20
$/MWh
xH xL MWh
50,000
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
27
EXAMPLE 5: OBJECTIVE FUNCTION
units are in $
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 5 : CONSTRAINTS
Period 1
energy conservation in a lossless system
• total generation 400 w 1A + 200 w 1B ( MWh )
• total sales x1H + x 1L ( MWh )
• losses are negelected and so
x 1H + x 1L = 400 w 1A + 200 w 1B
maximum available capacity limit
w 1A ≤ 150
wB1 ≤ 87.5
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
28
EXAMPLE 5 : CONSTRAINTS
conservation of flow relations for each
reservoir
• reservoir A:
w A1 + s A1 + rA1 = 1900 + 200 = 2100 ( kAf )
res. Res.level
level at at res. Res.level
level at at predicted
Res.level at
e.o.p.
e.o.p.10
e.o.p.
e.o.p.00 inflow
e.o.p. 0
• reservoir B:
w B1 + sB1 + rB1 = 850 + 400 + w A1 + s A1 ( kAf )
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 5 : CONSTRAINTS
• reservoir A:
x H1 ≤ 50,000 ( kAf )
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
29
EXAMPLE 5 : CONSTRAINTS
Period 2
energy conservation in a lossless system
• total generation 400 w A2 + 200 w B2 ( MWh )
• total sales x H2 + x L2 ( MWh )
• losses are negelected and so
x H2 + x L2 = 400 w A2 + 200 w B2
maximum available capacity limit
w A2 ≤ 150
wB2 ≤ 87.5
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 5 : CONSTRAINTS
res. Res.level
level at at res. level atat
Res.level Res.level at
predicted
e.o.p.20 e.o.p. 0 e.o.p. 0
e.o.p. e.o.p. 1 inflow
• reservoir B:
w B2 + sB2 + r B2 = r B1 + 15 + w A2 + s A2 ( kAf )
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
30
EXAMPLE 5 : CONSTRAINTS
• reservoir A:
x H2 ≤ 50,000 ( kAf )
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
16 decision variables:
x Hi , x Li , w Ai , w Bi , s Ai , sBi , r Ai , r Bi , i = 1, 2
Objective function:
Constraints:
31
EXAMPLE 6 : DISHWASHER AND
WASHING MACHINE PROBLEM
The Appliance Co. manufactures dishwashers
and washing machines
The sales targets for next four quarters are:
quarter t
product variable
1 2 3 4
washing
Wt 1200 1500 1000 1400
machine
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
32
EXAMPLE 6: CONSTRAINTS
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
33
EXAMPLE 6: QUARTER t DECISION
VARIABLES
symbol variable
t = 1, 2, 3, 4
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
34
EXAMPLE 6: CONSTRAINTS
r0 , s0 r1 , s1 r2 , s2 r3 , s3 r4 , s4
t=1 t=2 t=3 t=4
⎧ rt −1 + d t − rt = Dt
⎨ t = 1, 2, 3, 4
⎩ s t − 1 + w t − s t = Wt
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 6: CONSTRAINTS
⎧1.5d t + 2 wt − h t ≤ 0
⎪
⎨ t = 1, 2, 3, 4
⎪ 0.9h ≤ h ≤ 1.1h
⎩ t −1 t t −1
h0 = 5000
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
35
EXAMPLE 6: PROBLEM STATEMENT
d1 w1 r1 s1 h1 d2 w2 r2 s2 h2 d3 w3 r3 s3 h3 d4 w4 r4 s4 h4
1 -1 = 1250
1 -1 = 1150
1.5 2 -1 ≤0
1 ≥ 4500
1 ≤ 5500
1 1 -1 = 1300
1 1 -1 = 1500
1.5 2 -1 ≤0
-0.9 1 ≥0
-1.1 1 ≤0
1 1 -1 = 3000
1 1 -1 = 1000
1.5 2 -1 ≤ 0
-0.9 1 ≥0
-1.1 1 ≤0
1 1 -1 = 1000
1 1 -1 = 1400
1.5 2 -1 ≤0
-0.9 1 ≥0
-1.1 1 ≤0
125 90 5.0 4.3 6.0 130 100 4.5 3.8 6.0 125 95 4.5 3.8 6.8 126 95 4.0 3.3 6.8 minimize
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
# #
am1 x1 + am2 x2 + ... + amn xn = bm
x1 ≥ 0, x2 ≥ 0, ... , xn ≥ 0
b1 ≥ 0, b2 ≥ 0, ... , bm≥ 0
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
36
STANDARD FORM OF LP (SFLP)
coefficient matrix
T
max (min) Z = c x m× n
A ∈ℜ
x ∈ ℜn
Ax= b decision
vector b ∈ ℜm
n
c ∈ℜ
x ≥ 0
requirement
vector profits
(costs)
vector
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
xslack ≥ 0
inequality + xslack = b
inequality – xslack = b
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
37
CONVERSION OF LP INTO SFLP
unspecified
with
⎧ xu xu ≥ 0 ⎧ 0 xu ≥ 0
x+ = ⎨ x− = ⎨
⎩0 xu < 0 ⎩ - xu xu < 0
and with xu replaced by
xu = x+ − x−
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
SFLP CHARACTERISTICS
If S = Ø ⇒ LP is infeasible
x* is optimal ⇒ cT x * ≥ cTx , ∀ x ∈ S
x * may be unbounded
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
38
ECE 307 – Techniques for Engineering
Decisions
Topic 3: Introduction to the Simplex Algorithm
George Gross
Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
Ax = b
unknowns:
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
1
SOLUTION OF SYSTEMS OF LINEAR
EQUATIONS
⎧⎪ x1 − 2 x 2 + x 3 − 4 x 4 + 2 x 5 = 2 (i )
S1 ⎨
⎪⎩ x1 − x 2 − x 3 − 3 x 4 − x 5 = 4 ( ii )
is nontrivial
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
⎧⎪ x1 − 2 x2 + x3 − 4 x4 + 2 x5 = 2
S2 ⎨
⎪⎩ x2 − 2 x3 + x4 − 3 x5 = 2
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
2
DEFINITIONS
A basic variable is a variable x i that appears
with the coefficient 1 in an equation and with the
coefficient 0 in all the other equations
The variables x j that are not basic are called
nonbasic variables
In the system S 2 , x 1 appears as a basic variable;
x 2 , x 3 , x 4 and x 5 are nonbasic variables
Basic variables may be generated through the
use of elementary row operations
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DEFINITIONS
3
CANONICAL SYSTEM FORM
We transform the system S2 into the canonical
form of system S3 :
⎧ x1 − 3 x3 − 2 x4 − 4 x5 = 6
S3 ⎪⎨
⎪⎩ x2 − 2 x3 + x4 − 3 x5 = 2
4
BASIC FEASIBLE SOLUTION
⎛ 5⎞ 5!
⎜ ⎟ = = 10
2
⎝ ⎠ 3! 2!
5
SIMPLEX METHODOLOGY EXAMPLE
max Z = 5 x 1 + 2 x 2 + 3 x 3 − x 4 + x 5
s .t .
⎧
canonical ⎪ x 1 + 2 x 2 + 2 x 3 + x 4 = 8 (*)
⎪
⎨
form ⎪
⎪⎩3 x 1 + 4x2 + x3 + x5 = 7 (**)
xi ≥ 0 i = 1, … ,5
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
x1 = x 2 = x 3 = 0 x4 = 8, x5 = 7
Z = − 8 + 7 = −1
6
ADJACENT FEASIBLE SOLUTION
7
ADJACENT FEASIBLE SOLUTION
x1 + x 4 = 8
3 x1 + x5 = 7
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
⎧ 7⎫ 7
min ⎨8, ⎬ =
⎩ 3⎭ 3
8
ADJACENT FEASIBLE SOLUTION
x 2 = x 3 = 0 and x 5 = 0
max Z = 5 x 1 + 2 x 2 + 3 x 3 − x 4 + x 5
s .t .
⎧ x + 2x + 2 x3 + x4 = 8 (*)
canonical ⎪⎪
1 2
⎨
form ⎪
⎪⎩ 3 x 1 + 4 x 2 + x3 + x5 = 7 (**)
xi ≥ 0 i = 1, … ,5
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
9
ADJACENT FEASIBLE SOLUTION
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
10
THE SIMPLEX SOLUTION METHOD
nonbasic variable
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
11
SIMPLEX ALGORITHM FOR
MAXIMIZATION
Step 3: select a nonbasic variable to become
the new basic variable; check the limits
on the nonbasic variable – the limiting
constraint determines the basic variable
that is being replaced by the selected
nonbasic variable
Step 4: determine the canonical form for the
new set of basic variables through
elementary row operations; compute the
basic feasible solution, Z and return to
Step 2
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
of so-called tableaus
12
THE SIMPLEX TABLEAU
cj 5 2 3 –1 1
constraint
cB basic constants
x1 x2 x3 x4 x5
variables
–1 x4 1 2 2 1 8
1 x5 3 4 1 1 7
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
13
THE SIMPLEX TABLEAU
We interpret as the change in Z corresponding
to a unit increase in x j
cj 5 2 3 –1 1 constraint
basic constants
cB x1 x2 x3 x4 x5
variables
–1 x4 1 2 2 1 8
1 x5 3 4 1 1 7
cT 3 0 4 0 0 Z = –1
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
SIMPLEX TABLEAU
14
THE SIMPLEX TABLEAU
2 x5 (7/1) = 7
min { 4, 7 } = 4
max Z = 5 x 1 + 2 x 2 + 3 x 3 − x 4 + x 5
s .t .
⎧ x + 2x + 2 x3 + x4 = 8 (*)
canonical ⎪⎪
1 2
⎨
form ⎪
⎪⎩ 3 x 1 + 4 x 2 + x3 + x5 = 7 (**)
xi ≥0 i = 1, … , 5
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
15
THE SIMPLEX TABLEAU
For the new basic feasible solution, we put the
equations into canonical form
cj 5 2 3 –1 1
constraint
cB basic
x1 x2 x3 x4 x5 constants
variables
3 x3 1/2 1 1 1/2 4
1 x5 5/2 3 –1/2 1 3
cT 1 –4 0 –2 0 Z = 15
x 3 = 4, x 5 = 3
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
16
THE SIMPLEX TABLEAU
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
17
THE SIMPLEX TABLEAU
The following elementary row operations are
used
cj 5 2 3 –1 1
constraint
cB basic x1 x2 x3 x4 x5 constants
variables
3 x3 2/5 1 3/5 – 1/5 17/5
16.2 > 15
c j ≤ 0 implies optimality
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
18
SIMPLEX TABLEAU EXAMPLE
max Z = 3 x1 + 2x2
s .t .
− x1 + 2x2 ≤ 4
x1 + 2x2 ≤ 14
x1 − x2 ≤ 3
x1 ≥ 0 x 2 ≥ 0
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
x1 , …, x5 ≥ 0
x 3 , x 4 , x 5 are fictitious variables
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
19
SIMPLEX TABLEAU EXAMPLE
cj 3 2 0 0 0 constraint
cB basic
x1 x2 x3 x4 x5 constants
variables
0 x3 –1 2 1 4
0 x4 3 2 1 14
0 x5 1 –1 1 3
cT 3 2 0 0 0 Z = 0
c j = c j − ( c BT • column corresponding to x j )
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
20
SIMPLEX TABLEAU EXAMPLE
cj 3 2 0 0 0 constraint
cB basic
x1 x2 x3 x4 x5 constants
variables
0 x3 1 1 1 7
0 x4 5 1 –3 5
3 x1 1 –1 1 3
cT 0 5 0 0 –3 Z = 9
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
components
c j = c j −( c T
B i column corresponding to x j )
for each nonbasic variable x j
definition
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
21
SIMPLEX TABLEAU EXAMPLE
min {7 , 1, ∞} = 1
22
SIMPLEX TABLEAU EXAMPLE
cj 3 2 0 0 0 constraint
cB basic
x1 x2 x3 x4 x5 constants
variables
0 x3 1 –1/5 8/5 6
2 x2 1 1/5 –3/5 1
3 x1 1 1/5 2/5 4
cT 0 0 0 –1 Z = 14
cj ≤ 0∀ j ⇒ optimum
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
1 8
x3 − x + x = 6 ⎫
5 4 5 5
x2 + 1
x − 2
x = 1 ⎬
⎪
5 4 5 5
x1 + 1
x + 2
x = 4 ⎭
⎪
5 4 5 5
given by
x4 = x5 = 0
x3 = 6
x2 = 1
x1 = 4
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
23
LINEAR PROGRAMMING EXAMPLE
s .t .
− x1 + 2x2 ≤ 4
3 x1 + 2 x 2 ≤ 14
x1 − x 2 ≤ 3
x1 ≥ 0 x 2 ≥ 0
The graphical representation corresponds to
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
x2 = 4
x2
x + 2
-
D
3
3
=
3x 1
2
- x
E
+
3x 1
2x 2
2
1
-x
3x 1
=1
tableau 3
2x 2
4
+
2x 2
1
C
Z
=
=9
Z
tableau 1
=3
B
A x1
1 2 3 tableau 2
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
24
LINEAR PROGRAMMING EXAMPLE
25
LINEAR PROGRAMMING EXAMPLE
cj 3 2 0 0 0
constraint
cB basic x1 x2 x3 x4 x5 constants
variables
0 x3 5/8 –1/8 1 15/4
2 x2 1 3/8 1/8 13/4
cT 0 0 0 –1 0 Z = 14
cj ≤ 0 ∀ j
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
5 13 15
x1 = , x2 = , x3 = x4 = 0 , x5 =
2 4 4
cj ≤ 0 ∀ j
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
26
ALTERNATE OPTIMAL SOLUTION
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
MINIMIZATION LP
s.t .
Ax = b
x≥0
In the simplex scheme, replace the optimality
check by the following :
if each coefficient c j is ≥ 0 , stop; else, select
the nonbasic variable with the most negative
value in c to become the new basic variable
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
27
MINIMIZATION LP
min Z = cT x max Z ′ = (− c T ) x
s.t . s.t .
Ax = b Ax = b
x ≥ 0 x ≥ 0
with the solutions of Z and Z ′ related by
min{ Z } = − max { Z ′}
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
28
COMPLICATIONS IN THE SIMPLEX
METHODOLOGY
cj 0 0 0 2 0 3/2 constraint
cB basic
x1 x2 x3 x4 x5 x6 constants
variables
0 x1 1 1 –1 0 2
0 x2 1 2 0 1 4
0 x3 1 1 1 1 3
cT 0 0 0 2 0 3/2 Z = 0
29
COMPLICATIONS IN THE SIMPLEX
METHODOLOGY
3
cj 0 0 0 2 0
2 constraint
cB basic constants
variables x1 x2 x3 x4 x5 x6
2 x4 1 1 –1 2
0 x2 –2 1 2 1 0
0 x3 –1 1 1 1 1
cT –2 0 0 0 2 3/2 Z = 4
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
x1 = 0 x 2 = 0 x 3 = 1 x 4 = 2 x 5 = 0 x 6 = 0 ,
30
DEGENERACY
DEGENERACY
cj 0 0 0 2 0 3
2 constraint
cB basic
x1 x2 x3 x4 x5 x6 constants
variables
2 x4 1/2 1 1/2 2
0 x5 –1 1/2 1 1/2 0
0 x3 1 –1 1 0 1
cT 0 –1 0 0 0 1/2 Z = 4
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
31
DEGENERACY
DEGENERACY
32
MINIMUM RATIO RULE COMPLICATIONS
cj 2 3 0 0 constraint
cB basic
x1 x2 x3 x4 constants
variables
0 x3 1 –1 1 2
0 x4 –3 1 1 4
2 3 0 0 Z = 0
cT
33
MINIMUM RATIO RULE COMPLICATIONS
cj 2 3 0 0 constraint
cB basic constants
variables x1 x2 x3 x4
0 x3 –2 1 1 6
3 x2 –3 1 1 4
cT 11 0 0 –3 Z = 12
1
−2 x 1 + x 3 = 6 x1 = x − 3
2 3
1 4
−3 x 1 + x 2 = 4 x1 = x2 −
3 3
In fact, as x 1 increases so do x 2 and x 3 and Z
34
ECE-307
Duality Concepts in Linear Programming
George Gross
Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
DUALITY
max ≤
min ≥
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
1
DUALITY DEFINITIONS
We define the primal problem as
max Z = cT x
s.t.
Ax ≤ b (P)
x ≥ 0
The dual problem is therefore
min W = bTy
s.t.
AT y ≥ c (D)
y ≥ 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DUALITY DEFINITIONS
The problems (P ) and (D) are called the
symmetric dual LP
max Z = c1 x1 + c2 x 2 + ... + cn xn ⎫
⎪
s.t. ⎪
a11 x1 + a12 x 2 + ... + a1 n xn ≤ b1 ⎪
⎪⎪
a21 x1 + a22 x2 + ... + a2 n xn ≤ b2 ⎬ (P)
# ⎪
⎪
am 1 x1 + am 2 x2 + ... + amn xn ≤ bm ⎪
⎪
x1 ≥ 0, x2 ≥ 0, ..., xn ≥ 0 ⎪⎭
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
2
DUALITY DEFINITIONS
min W = b1 y1 + b2 y2 + ... + bm ym ⎫
⎪
s.t. ⎪
⎪
a11 y1 + a21 y2 + ... + am 1 ym ≥ c1 ⎪
⎪⎪
a12 y1 + a 22 y2 + ... + am 2 ym ≥ c2 ⎬ ( D)
⎪
# ⎪
⎪
a1 n y1 + a2 n y2 + ... + amn xm ≥ cn ⎪
⎪
y1 ≥ 0, y2 ≥ 0, ..., ym ≥ 0 ⎪⎭
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 1: MANUFACTURING
TRANSPORTATION PROBLEM
W1 2 4 3 R2
W2 5 3 4 W2
R3
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
3
EXAMPLE 1: MANUFACTURING
TRANSPORTATION PROBLEM
supplies @ W1 ≤ 300
W2 ≤ 600
demands @ R1 ≥ 200
R2 ≥ 300
R3 ≥ 400
The problem is to determine the least-cost
shipping schedule
xij = quantity shipped from Wi to Rj
i = 1, 2 j = 1, 2, 3
cij = elements of transportation cost matrix
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
FORMULATION STATEMENT
2 3
min Z = ∑∑ c
i =1 j =1
ij xij = 2 x11 + 4 x12 + 3 x13 + 5 x21 + 3 x22 + 4 x23
s.t.
x11 + x12 + x13 ≤ 300
x21 + x22 + x23 ≤ 600
x11 + x21 ≥ 200
x12 + x22 ≥ 300
x13 + x23 ≥ 400
xij ≥ 0 i = 1, 2 j = 1, 2, 3
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
4
DUAL PROBLEM SETUP
2 3
min Z = ∑∑ c
i =1 j =1
ij xij
s.t.
y1 ↔ − x11 − x12 − x13 ≥ −300
y2 ↔ − x21 − x22 − x23 ≥ −600
y3 ↔ x11 + x21 ≥ 200
y4 ↔ x12 + x22 ≥ 300
y5 ↔ x13 + x23 ≥ 400
xij ≥ 0 i = 1, 2 j = 1, 2, 3
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
5
INTERPRETATION OF DUAL PROBLEM
− y1 + y3 ≤ c11 = 2
− y1 + y4 ≤ c12 = 4
− y1 + y5 ≤ c13 = 3
− y2 + y3 ≤ c21 = 5
− y2 + y4 ≤ c22 = 3
− y2 + y5 ≤ c23 = 4
6
EXAMPLE 2: MANUFACTURING OF
FURNITURE PRODUCTS
Resource requirements
item sales price ($)
desks 60
tables 30
chairs 20
lumber board
requirements
finishing
labor
carpentry
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 2: MANUFACTURING OF
FURNITURE PRODUCTS
The Dakota Furniture Company manufactures:
resource desk table chair available
7
PRIMAL AND DUAL PROBLEM
FORMULATION
We define decision variables
x1 = number of desks produced
x2 = number of tables produced
x3 = number of chairs produced
The Dakota problem is
max Z = 60 x1 + 30 x2 + 20 x3
y1 ↔ 8 x1 + 6 x2 + x3 ≤ 48 lumber
y2 ↔ 4 x1 + 2 x2 + 1.5 x3 ≤ 20 finishing
y3 ↔ 2 x1 + 1.5 x2 + 0.5 x3 ≤ 8 carpentry
x1 , x2 , x3 ≥ 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
min W = 48 y1 + 20 y2 + 8 y3
8 y1 + 4 y2 + 2 y3 ≥ 60 desk
6 y1 + 2 y2 + 1.5 y3 ≥ 30 table
y1 + 1.5 y2 + 0.5 y3 ≥ 20 chair
y1 , y2 , y3 ≥ 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
8
PRIMAL AND DUAL PROBLEM
FORMULATION
max Z = 60 x1 + 30 x2 + 20 x3
y1 ↔ 8 x1 + 6 x2 + x3 ≤ 48 lumber
y2 ↔ 4 x1 + 2 x2 + 1.5 x3 ≤ 20 finishing
y3 ↔ 2 x1 + 1.5 x2 + 0.5 x3 ≤ 8 carpentry
x1 , x2 , x3 ≥ 0
min W = 48 y1 + 20 y2 + 8 y3
8 y1 + 4 y2 + 2 y3 ≥ 60 desk
6 y1 + 2 y2 + 1.5 y3 ≥ 30 table
y1 + 1.5 y2 + 0.5 y3 ≥ 20 chair
y1 , y2 , y3 ≥ 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
9
INTERPRETATION OF DUAL PROBLEM
To induce Dakota to sell the raw resources, the
resource prices must be set sufficiently high
For example, the entrepreneur must offer Dakota
at least $60 for a combination of resources that
includes 8ft of lumber board, 4h of finishing and
2h of carpentry since Dakota could use this
combination to sell a desk for $60
This implies the construction of the dual
constraint
8 y1 + 4 y2 + 2 y3 ≥ 60
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
constraint
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
10
EXAMPLE 3: DIET PROBLEM
A new diet requires that all food eaten come from
one of the four “basic food groups”: chocolate
cake, ice cream, soda and cheesecake
The four foods available for consumption are
given in the table
Requirements for each day are intakes of:
At least 500 cal
At least 6 oz chocolate
At least 10 oz sugar
At least 8 oz fat
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
brownie 400 3 2 2 50
chocolate
ice cream 200 2 2 4 20
(scoop)
cola
150 0 4 1 30
(bottle)
pineapple
cheeseca- 500 0 4 5 80
ke (piece)
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
11
PROBLEM FORMULATION
x1 = number of brownies
x2 = number of chocolate ice cream scoops
x3 = number of bottles of soda
x4 = number of pineapple cheesecake pieces
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
PROBLEM FORMULATION
min Z = 50 x1 + 20 x2 + 30 x3 + 80 x4
s.t.
400 x1 + 200 x2 + 150 x3 + 500 x4 ≥ 500 cal
3 x1 + 2 x2 ≥ 6oz
2 x1 + 2 x 2 + 4 x 3 + 4 x4 ≥ 10oz
2 x1 + 4 x 2 + x 3 + 5 x4 ≥ 8oz
xi ≥ 0 i = 1, 4
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
12
EXAMPLE 3: DIET PROBLEM
The dual problem is
max W = 500 y1 + 6 y2 + 10 y3 + 8 y4
s.t.
400 y1 + 3 y2 + 2 y3 + 2 y4 ≤ 50 brownie
200 y1 + 2 y2 + 2 y3 + 4 y4 ≤ 20 ice - cream
150 y1 + 4 y3 + y4 ≤ 30 soda
500 y1 + 4 y3 + 5 y4 ≤ 80 cheesecake
y1 , y2 , y3 , y4 ≥ 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
INTERPRETATION OF DUAL
13
INTERPRETATION OF DUAL
Now, the dieter can purchase a brownie for 50¢
and have 400cal, 30oz of chocolate, 2oz of sugar
and 2oz of fat
Salesperson must set yi sufficiently low to
entice the buyer to get the required nutrients
from the brownie:
brownie
400 y1 + 3 y2 + 2 y3 + 2 y4 ≤ 50
constraint
We derive similar constraints for the ice cream,
soda and cheesecake
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DUAL PROBLEMS
max Z = cT x
s.t.
Ax ≤ b (P)
x ≥ 0
min W = bTy
s.t.
AT y ≥ c (D)
y ≥ 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
14
WEAK DUALITY THEOREM
(D)
c T x ≤ bT y
Proof:
AT y ≥ c ⇒ c T ≤ yT A ⇒ c T x ≤ yT Ax
c T x ≤ yT Ax ≤ yT b = b T y
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
x feasible for ( P ) ⇒ c T x ≤ yT b
c T x ≤ y*T b = min W
cT x ≤ min W
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
15
COROLLARIES OF THE WEAK
DUALITY THEOREM
Corollary 2:
y feasible for ( D ) ⇒ c T x ≤ yT b
yT b ≥ maz Z
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
Z → −∞ .
Then, ( P ) is infeasible
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
16
DUALITY THEOREM APPLICATION
max Z = x1 + 2 x2 + 3 x3 + 4 x4 = [1, 2, 3, 4] x
c T
s.t.
(P )
⎡1 2 2 3 ⎤ ⎡ 20 ⎤
⎢ ⎥ x ≤ ⎢ ⎥
⎣
2 1 3 2⎦
⎣ 20 ⎦
N
A b
x ≥ 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
min W = bT y
s.t.
(D )
AT y ≥ c
y ≥ 0
17
DUALITY THEOREM APPLICATION
min W = 20 y1 + 20 y2
s.t.
y1 + 2 y2 ≥ 1
2 y1 + y2 ≥ 2
2 y1 + 3 y2 ≥ 3
3 y1 + 2 y2 ≥ 4
y1 ≥ 0, y2 ≥ 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
18
DUALITY THEOREM APPLICATION
Clearly,
Z ( x1 , x2 , x3 , x4 ) = 10 < 40 = W ( y1 , y2 )
Duality Theorem
Moreover, we have
Corollary 1 ⇒ 10 ≤ min W = W ( y *1 , y 2* )
Corollary 2 ⇒ max Z = Z ( x *1 , x 2* , x 3* , x 4* ) ≤ b T y = 40
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
ADDITIONAL CORROLARIES
Corollary 5:
(P) is unbounded
Corollary 6:
(D) is unbounded
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
19
EXAMPLE
EXAMPLE
− y1 − 2 y2 ≥ 1
y1 , y2 ≥ 0
Z →∞
20
OPTIMALITY CRITERION THEOREM
21
MAIN DUALITY THEOREM
c T x * = b T y*
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
COMPLEMENTARY SLACKNESS
CONDITIONS
x* and y * are optimal for (P) and (D) respectively,
if and only if
( ) (b− A x )
*T
0 = y *T A − c T x * + y *
= y*T b − c T x*
To prove this equivalence result, we define the
slack variables u ∈ \ m and v ∈ \ n such that x
and y are feasible; at the optimum,
A x * + u* = b x * , u* ≥ 0
AT y* − v * = c y* , v * ≥ 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
22
COMPLEMENTARY SLACKNESS
CONDITIONS
u* and v * correspond to x * , y *
Now,
y *T Ax* + y *T u* = y *T b = b T y *
x *T A T y * − x *T v * = x *T c = c T x *
y Ax *
*T
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
COMPLEMENTARY SLACKNESS
CONDITIONS
This implies that
y *T u* + v *T x* = b T y* − c T x *
only if
y *T u* + v *T x* = 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
23
COMPLEMENTARY SLACKNESS
CONDITIONS
However,
x * , y* are optimal
Main
⇒
Duality Theorem
c T x* = b T y ⇒ y u + v *T x* = 0
* *T *
also,
y *T u* + v *T x* = 0 ⇒ b T y* = c T x *
Optimality
⇒
Criterion Theorem
x* is optimal for ( P )
y* is optimal for ( D )
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
COMPLEMENTARY SLACKNESS
CONDITIONS
Note that
x * , y * , u * , v * > 0 ⇒ component - wise each element ≥ 0
y *T u* + v * x* = 0 ⇒ y *i u *i = 0 ∀i = 1, ..., m and
v *j x *j = 0 ∀j = 1, ..., n
At the optimum,
⎛ n ⎞
y ⎜ bi −
*
i ∑ a ij x j⎟ = 0
*
i = 1, ..., m
⎝ j =1 ⎠
and
⎛ m ⎞
x ⎜ ∑ a ji y i* − c j ⎟ = 0
*
j j = 1, ..., n
⎝ i =1 ⎠
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
24
COMPLEMENTARY SLACKNESS
CONDITIONS
Hence, for i = 1, 2, … , m
n
y > 0 ⇒ bi =
*
i ∑a
j =1
ij x *j
and
n
bi − ∑a
j =1
ij x *j > 0 ⇒ y i* = 0
Similarly for j = 1, 2, … , n
m
x *j > 0 ⇒ ∑a
i =1
ji y i* = c j
and
m
∑a
i =1
ji y i* − c j > 0 ⇒ x *j = 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE
max Z = x1 + 2 x2 + 3 x3 + 4 x4
s.t .
x1 + 2 x2 + 2 x3 + 3 x4 ≤ 20 ( P)
2 x1 + x2 + 3 x3 + 2 x4 ≤ 20
xi ≥ 0 i = 1,...,4
min W = 20 y1 + 20 y2
s.t .
y1 + 2 y2 ≥ 1
2 y1 + y2 ≥ 2
2 y1 + 3 y2 ≥ 3 ( D)
3 y1 + 2 y2 ≥ 4
y1 ≥ 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
25
EXAMPLE
x * , y* optimal ⇒
y *1 ( 20 − x *1 − 2 x 2* − 2 x 3* − 3 x 4* ) = 0
y 2* ( 20 − 2 x *1 − x 2* − 3 x 3* − 2 x 4* ) = 0
⎛ 1.2 ⎞
y* = ⎜ ⎟ is given as an optimal solution with
⎝ 0.2 ⎠
min W = 28
Then,
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE
x *1 + 2 x 2* + 2 x 3* + 3 x 4* = 20
2 x *1 + x 2* + 3 x 3* + 2 x 4* = 20
Also,
y *1 + 2 y 2* = 1.2 + 0.4 > 1 ⇒ x *1 = 0
2 y *1 + y 2* = 2.4 + 0.2 > 2 ⇒ x 2* = 0
2 y *1 + 3 y 2* = 2.4 + 0.6 = 3
3 y *1 + 2 y 2* = 3.6 + 0.4 = 4
therefore
2 x 3* + 3 x 4* = 20 ⇒ x 3* = 4
max Z = 28
3 x 3* + 2 x 4* = 20 ⇒ x 4* = 4
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
26
USES OF THE COMPLEMENTARY
SLACKNESS CONDITION
Key applications
finding optimal (P) solution given optimal (D)
solution and vice versa
verification of optimality of solution (whether
a feasible solution is optimal)
We can start with a feasible solution and attempt
to construct an optimal dual solution; if we
succeed, then the feasible prime solution is
optimal
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DUALITY
max Z = cT x
s.t.
Ax ≤ b (P)
x ≥ 0
min W = bTy
s.t.
AT y ≥ c (D)
y ≥ 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
27
DUALITY
Suppose the primal problem is minimization, then,
min Z = cT x
s.t.
Ax ≥ b (P)
x ≥ 0
max W = bTy
s.t.
AT y ≤ c (D)
y ≥ 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
INTERPRETATION
The economic interpretation is
Z * = max Z = c T x* = b T y* = W * = minW
b i − constrained quantities of the resources i = 1, 2, ..., m
y *i − optimal dual variables
Suppose,
bi → bi + Δbi ⇒ Δ Z = y *i Δbi
In words, the optimal dual variable for each
primal constraint gives the net change in the
optimal value of the objective function Z for a
one unit change in the constraint on resources
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
28
INTERPRETATION
Economists refer to this as a shadow price on
resource 2 is 0.2
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
29
GENERALIZED FORM OF THE DUAL
Let
y = y + − y−
(
x *T AT y* − c ) = 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 5
max Z = x1 − x2 + x3 − x4
s .t .
y1 ↔ x1 + x2 + x3 + x4 = 8
y2 ↔ x1 ≤ 8
y3 ↔ x2 ≤ 4
y4 ↔ − x2 ≤ 4 (P)
y5 ↔ x3 ≤ 4
y6 ↔ − x3 ≤ 2
y7 ↔ x4 ≤ 10
x1 , x4 ≥ 0
x2 , x3 unsigned
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
30
EXAMPLE 5
min W = 8 y1 + 8 y2 + 4 y3 + 4 y4 + 4 y5 + 2 y6 + 10 y7
s .t .
x1 ↔ y1 + y2 ≥ 1
x2 ↔ y1 + y3 − y4 = −1
x3 ↔ + y5 − y6 = 1
x4 ↔ + y7 ≥ − 1
y2 , ..., y7 ≥ 0
y1 unsigned
( D)
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 5
We are given
⎡ 8 ⎤
⎢− 4 ⎥
x* = ⎢ ⎥
⎢ 4 ⎥
⎢⎣ 0 ⎥⎦
x *1 ( y *1 + y 2* − 1) = 0
x *1 = 8 > 0 ⇒ y *1 + y 2* = 1
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
31
EXAMPLE 5
The other c.s. conditions obtain
⎛ 4 ⎞
y = ⎜ ∑ aij x *j − b i ⎟ = 0
*
i
⎝ j =1 ⎠
Now, x 4 = 0 implies x 4 − 10 < 0 and so
* *
y 7* = 0
Also, x 3* = 4 implies
y 6* = 0
Similarly, the c.s. conditions
⎛ 7 ⎞
x *j = ⎜ ∑ a ji y i* − c j ⎟ = 0
⎝ i =1 ⎠
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 5
y 3* = 0
y 1* > − 1
Since, x 1* = 8 we have
y 2* = 1 − y 1*
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
32
EXAMPLE 5
Also
y 1* + y 5* − y 6* = 1
implies
1 + y 5* = 1
and so
y 5* = 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 5
Suppose
y 1* = 1
and so,
y 2* = 0
Furthermore,
y 1* + y 3* − y 4* = 1 − y 4* = − 1 ⇒ y 4* = 2
implies
y 4* = 2
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
33
EXAMPLE 5
Therefore
( )
W y * = ( 8 )( 1) + ( 8 )( 0 ) + ( 4 )( 0 ) + ( 4 )( 2 ) +
( 4 )( 0 ) + ( 2 )( 0 ) + ( 10 )( 0 )
= 16
and so
W * = 16 = Z * ⇔ optimality of ( P ) and ( D )
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
34
ECE 307GG – Techniques for
Engineering Decisions
Networks and Flows
George Gross
Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
1
NETWORKS AND FLOWS
2
THE TRANSPORTATION PROBLEM
costs
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
⎪2 costs 2⎪
⎪
markets
⎪
⎪ .. cij .. ⎪
⎬
⎨
⎪
. . ⎪
⎪ ai bj ⎪
⎪i cij = ∞ whenever
j⎪
⎪
⎪
⎪
.. warehouse i cannot
.. ⎪
⎪
. . ⎪
⎪
⎪m am ship to market j bm
⎩ m⎪⎭
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
3
THE TRANSPORTATION PROBLEM
4
LP FORMULATION OF THE
TRANSPORTATION PROBLEM
The decision variables are
m n
min ∑ ∑ cij xij
i=1 j =1
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
LP FORMULATION OF THE
TRANSPORTATION PROBLEM
The constraints are:
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
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
5
LP FORMULATION OF THE
TRANSPORTATION PROBLEM
Note that feasibility requires
m n
∑
i =1
ai ≥ ∑
j =1
bj
When
m n
∑ ai =
i =1
∑
j =1
bj
STANDARD TRANSPORTATION
PROBLEM
m n
min ∑
i =1
∑
j =1
cij xij
∑
j =1
xij = ai
m i = 1,..., m
∑
i =1
xij = bj
j = 1,..., n
xij ≥ 0
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
6
TRANSPORTATION PROBLEM
EXAMPLE
market j M1 M2 M3 M4 supplies
w/h i
demands b1 b2 b3 b4
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
STANDARD TRANSPORTATION
PROBLEM
The standard transportation problem has
m n variables xij
m + n equality constraints
Since
m n m n
∑ ∑ xij
i =1 j = 1
= ∑
i =1
ai = ∑
j =1
bj
7
TRANSPORTATION PROBLEM
EXAMPLE
market j M1 M2 M3 M4 ai
w/h i
W1 3
2 2 2 1
W2 7
10 8 5 4
W3 5
7 6 6 8
bj 4 3 4 4
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
8
APPLICATION OF THE LEAST – COST
RULE
c14 is the lowest cij and we select x14 as a basic
variable
We choose x14 as large as possible without
violating any constraints:
min { a1 , b4 } = min { 3 , 4 } = 3
We set x14 = 3 and
x11 = x12 = x13 = 0
We delete row 1 from further consideration
since all supplies from W1 are exhausted
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
W1 3 3
2 2 2 1
W2 7
10 8 5 4
W3 5
7 6 6 8
bj 4 3 4 4
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
9
APPLICATION OF THE LEAST – COST
RULE
The remaining demand at M4 is
4–3 =1
M4
min { a2 , b4 } = min { 7 , 1 } = 1
x34 = 0
10
APPLICATION OF THE LEAST – COST
RULE
The remaining supply at W2 is
7–1 =6
solution
w/h i
W2 4 6
10 8 5
W3 0 5
7 6 6
bj 4 3 4
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
11
APPLICATION OF THE LEAST – COST
RULE
pick x23 to enter the basis
set
x23 = min { 6, 4 } = 4
and set x33 = 0
eliminate column 3 and reduce the supply
at W2 to
6–4 = 2
For the reduced tableau
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
w/h i
W2 0 2
10 8
W3 3 5
7 6
bj 4 3
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
12
APPLICATION OF THE LEAST – COST
RULE
pick x32 to enter the basis
set
x32 = min { 3, 5 } = 3
and set x22 = 0
eliminate column 2 in the reduced tableau
and reduce the supply at W3 to
5–3 = 2
The last reduced tableau is
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
w/h i
W2 2
10
W3 2 2
bj 4
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
13
APPLICATION OF THE LEAST – COST
RULE
pick x31 to enter the basis
set
x31 = min { 3, 5 } = 3
reduce the demand at M1 to
4–2 = 2
the value of
x21 = 2
is obtained by default
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
W1 3 3
2 2 2 1
W2 2 4 1 7
10 8 5 4
W3 2 3 5
7 6 6 8
bj 4 3 4 4
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
14
APPLICATION OF THE LEAST – COST
RULE
3 4
∑ ∑
i =1 j =1
c x
ij ij = 1 ⋅ 3 + 4 ⋅ 1 + 5 ⋅ 4 + 6 ⋅ 3 + 7 ⋅ 2 + 10 ⋅ 2 = 79
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
m n
⎫
⎪
min Z = ∑∑
i =1 j =1
cij xij ⎪
⎪
s .t . ⎪
⎪
n
⎪
ui ↔ ∑
j =1
xij = ai ⎬
⎪
(P)
m i = 1, ... , m ⎪
vj ↔ ∑
i =1
xij = bj ⎪
⎪
j = 1, ... , n ⎪
xij ≥ 0 ⎪⎭
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
15
THE STANDARD TRANSPORTATION
PROBLEM
The dual problem is
m n ⎫
max W = ∑ ai ui +
i =1
∑ bj v j
j =1
⎪
⎪
⎪
⎪
s.t . ⎪
⎪
⎬ ( D)
xij ↔ ui + v j ≤ cij i = 1, ... , m ⎪
⎪
⎪
j = 1, ... , n ⎪
⎪
ui , v j are unrestricted in sign ⎪⎭
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
16
THE TRANSPORTATION PROBLEM
satisfied
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
17
THE u-v METHOD
slackness conditions
18
THE u-v METHOD
Otherwise, there exists some nonbasic variable
x pq such that
c pq = c pq − ( u p + vq ) < 0
and we determine
c pq =
min
pq ∋ x pq
{c }pq
is nonbasic
We, then, select x pq to become a basic variable
and repeat the process for this new basic
feasible solution
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
STANDARD TRANSPORTATION
PROBLEM EXAMPLE
We apply the u – v scheme to the example
previously discussed
require
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
19
STANDARD TRANSPORTATION
PROBLEM EXAMPLE
We start with the basic feasible solution and
apply the complementary slackness conditions
u1 + v4 = 1 = c14
u2 + v4 = 4 = c24
u2 + v3 = 5 = c23
u3 + v2 = 6 = c32
u3 + v1 = 7 = c31
u2 + v1 = 10 = c21
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
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
20
STANDARD TRANSPORTATION
PROBLEM EXAMPLE
The cij for the nonbasic variables are
STANDARD TRANSPORTATION
PROBLEM EXAMPLE
We determine
c pq = min
= c11 = − 5
pq ∋ x pq
is nonbasic
21
STANDARD TRANSPORTATION
EXAMPLE
market j M1 M2 M3 M4 ai
w/h i
W1 θ 3-θ 3
W2 2-θ 4 1+θ 7
W3 2 3 5
bj 4 3 4 4
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
STANDARD TRANSPORTATION
EXAMPLE
Therefore,
max θ = min { 2, 3 } = 2
22
STANDARD TRANSPORTATION
EXAMPLE
market j v1 = 2 v2 = 1 v3 = 2 v4 = 1 ai
w/h i
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
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
STANDARD TRANSPORTATION
EXAMPLE
The complementary slackness conditions of the
u1 + v1 = c11 = 2
u1 + v4 = c14 = 1
u2 + v3 = c23 = 5
u2 + v4 = c24 = 4
u3 + v1 = c31 = 7
u3 + v2 = c32 = 6
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
23
STANDARD TRANSPORTATION
EXAMPLE
We set
u1 = 0
and therefore
v3 = 2 v1 = 2
u3 = 5 u3 = 5
v2 = 1 v2 = 0
STANDARD TRANSPORTATION
EXAMPLE
c12 = c12 − ( u1 + v2 ) = 2 − (0 + 1) = 1
c13 = c13 − ( u1 + v3 ) = 2 − (0 + 2) = 0
c21 = c21 − ( u2 + v1 ) = 10 − (3 + 2) = 5
c22 = c22 − ( u2 + v2 ) = 8 − (3 + 1) = 4
c33 = c33 − ( u3 + v3 ) = 6 − (5 + 2) = −1
c34 = c34 − ( u3 + v4 ) = 8 − (5 + 1) = 2
24
STANDARD TRANSPORTATION
EXAMPLE
market j M1 M2 M3 M4 ai
w/h i
W1 3
2+θ 1–θ
W2 7
4–θ 3+θ
W3 5
2–θ 3 θ
bj 4 3 4 4
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
STANDARD TRANSPORTATION
EXAMPLE
The limiting value of θ is
θ = min { 2, 4, 1 } = 1
25
STANDARD TRANSPORTATION
EXAMPLE
market j v1 = 2 v2 = 1 v3 = 1 v4 = 0 ai
w/h i
u1 = 0 3 3
2 2 2 1
u2 = 4 3 4 7
10 8 5 4
u3 = 5 1 3 1 5
7 6 6 8
bj 4 3 4 4
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
STANDARD TRANSPORTATION
EXAMPLE
We evaluate cij for each nonbasic variable;
cij < 0 and so we have an optimal solution with
shipping 3 from W1 to M 1 with costs 6
shipping 1 from W 3 to M 1 with costs 7
shipping 3 from W 3 to M 2 with costs 18
shipping 1 from W 3 to M 3 with costs 6
shipping 3 from W 2 to M 3 with costs 15
shipping 4 from W 2 to M 4 with costs 16
and resulting in the least total costs of 68
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
26
ELECTRICITY DISTRIBUTION
EXAMPLE
We consider in an electric utility system in which
4 cities
ELECTRICITY COSTS
to city supplies
from (10 6 kWh)
1 2 3 4
1 8 6 10 9 35
balanced
2 9 12 13 7 50
plant transportation
3 problem
14 9 16 5 40
demands 45 20 30 30 125
(10 6 kWh)
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
27
ELECTRICITY ALLOCATION EXAMPLE
We note that
3 4
∑
i =1
ai = ∑
j =1
bj
problem
least-cost rule
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
28
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION
And we set
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
29
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION
and so we set
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
30
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION
and therefore we set
x11 = 15 , x13 = 0
system
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
2 30 20
50
9 13
plant 3 10
0
14 16
demands 30 30
(10 6 kWh)
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
31
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION
x21 = 30 , x31 = 0
2 20 20
13
plant 3 10
10
16
demands 30
(10 6 kWh)
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
32
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION
which allows us to set
x23 = 20 , x33 = 10
Z = 30 · 5 + 20 · 6 + 15 · 8 + 30 · 9 + 20 · 13 + 10 · 16 = 1080
2 30 20 50
9 13
3 10 30 40
16 5
demands 45 20 30 30
(10 6 kWh)
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
33
STANDARD TRANSPORTATION
EXAMPLE
We compute, the possible improvements at
each nonbasic variable:
c31 = c31 − ( u3 + v1 ) = 14 − (4 + 8) = 2
c22 = c22 − ( u2 + v2 ) = 12 − (1 + 6) = 5
c32 = c32 − ( u3 + v2 ) = 9 − (4 + 6) = −1
c13 = c13 − ( u1 + v3 ) = 10 − (0 + 12) = −2
c14 = c14 − ( u1 + v4 ) = 9 − (0 + 1) = 8
c24 = c24 − ( u2 + v4 ) = 7 − (1 + 1) = 5
improvement possible
better possibility
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
STANDARD TRANSPORTATION
EXAMPLE
θ = min { 15, 20 } = 15
34
STANDARD TRANSPORTATION
EXAMPLE
cities 1 2 3 4 ai
plants
1 15 − θ 20 θ 35
2 30 + θ 20 – θ 50
3 10 30 40
bj 45 20 30 30
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
STANDARD TRANSPORTATION
EXAMPLE
The adjacent basic feasible solution is
x21 = 45, x12 = 20, x13 = 15, x23 = 5, x33 = 10, x34 = 30
Z = 20 · 6 + 15 · 10 + 45 · 9 + 5 · 13 + 10 · 16 + 30 · 5
35
STANDARD TRANSPORTATION
EXAMPLE
cities v1 = 6 v2 = 6 v3 = 10 v4 = -1 supplies
plants
20 15 35
u1 = 0
6 10
u2 = 3 45 5 50
9 13
u3 = 6 10 30 40
16 5
demands 45 20 30 30
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
STANDARD TRANSPORTATION
EXAMPLE
The complementary slackness conditions
obtain the possible improvements
c11 = c11 − ( u1 + v1 ) = 8 − (0 + 6) = 2
c31 = c31 − ( u3 + v1 ) = 14 − (6 + 6) = 2
c22 = c22 − ( u2 + v2 ) = 12 − (3 + 6) = 3
c32 = c32 − ( u3 + v2 ) = 9 − (6 + 6) = −3
c14 = c14 − ( u1 + v4 ) = 9 − (0 − 1) = 10
c24 = c24 − ( u2 + v4 ) = 7 − (3 − 1) = 5
only possible improvement
We bring x32 into the basis and determine its
value θ using
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
36
STANDARD TRANSPORTATION
EXAMPLE
plants 1 2 3 4 ai
cities
1 20 – θ 15 + θ 35
2 45 5 50
3 θ 10 – θ 30 40
bj 45 20 30 30
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
STANDARD TRANSPORTATION
EXAMPLE
and so
θ = min { 10, 20 } = 10
The adjacent basic feasible solution is
x21 = 45 x12 = 10 x32 = 10
x13 = 25 x23 = 5 x34 = 30
and the value of Z becomes
Z = 45 · 9 + 10 · 6 + 10 · 9 + 25 · 10 + 5 · 13 30 · 5 =1020
You are asked to prove, using complementary
slackness conditions, that this is the optimal
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
37
NONSTANDARD TRANSPORTATION
PROBLEM
NONSTANDARD TRANSPORTATION
PROBLEM
For the case
m n
∑
i =1
ai > ∑
j =1
bj
supply demand
we create a fictitious market Mn+1 to absorb all
⎛ m n ⎞
the excess supply ⎜ ∑ ai − ∑ b j ⎟⎟ ;we set ci n+1 = 0
⎜
⎝ i =1 j =1 ⎠
∀ i = 1, 2,..., m since M does not exist in reality
n+1
38
NONSTANDARD TRANSPORTATION
PROBLEM
For the case
n m
∑
j =1
bj > ∑
i =1
ai
demand supply
the problem is not , in effect, feasible since all
the demands cannot be met and therefore the
least-cost shipping schedule is that which will
supply as much as possible of the demands of
the markets
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
NONSTANDARD TRANSPORTATION
PROBLEM
⎡ n m ⎤
shortage ⎢ ∑ b j − ∑ ai ⎥ ; we set cm+1, j = 0
⎢⎣ j =1 i =1 ⎥ ⎦
39
NONSTANDARD TRANSPORTATION
PROBLEM
Note that the variable xm+1, j is the shortage at
supplies
Smith 200 10
Jones 300 9
Richard 400 8
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
40
EXAMPLE: CANNING OPERATIONS
SCHEDULING
and shipping costs in $ / ton given by
to plant
from A B
Smith 2 2.5
Jones 1 1.5
Richard 5 3
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
labor costs 25 20
( $ / ton )
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
41
EXAMPLE: CANNING OPERATIONS
SCHEDULING
The selling price for canned goods is 50 $ / ton
and the company can sell all it produces
The problem is to determine the maximum profit
schedule
Note that this is an unbalanced problem since
supply = 200 + 300 + 400 = 900 tons
demand = 450 + 550 = 1000 tons > 900 tons
Clearly, the decision variables are the amounts
purchased from each grower and shipped to
each plant
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
⎡ ⎤ ⎡ ⎤
+ ⎢
50 − 25 5 ⎥ x RA
− 8 −
+ ⎢
50 − 20 − 10 − 2.5
⎥
⎥ x SB
⎢ ⎥ ⎢
⎣ 12 ⎦ ⎣ 17.5 ⎦
⎡ ⎤ ⎡ ⎤
⎢
+
50 − 20 − 9 − 1.5 ⎥ ⎢ − 8 −
3 ⎥ x RB
⎢
⎥ xJB + ⎢
50 − 20
⎥
⎣ 19.5 ⎦ ⎣ 19 ⎦
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
42
EXAMPLE: CANNING OPERATIONS
SCHEDULING
The supply constraints are
x SA + x SB ≤ 200
x RA + x RB ≤ 400
The demand constraints are
x SA + xJA + x RA ≤ 450
x SB + xJA + x RB ≤ 550
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
43
EXAMPLE: CANING OPERATIONS
SCHEDULING
plant j A B supply
grower i
S 200
13 17.5
J 300
15 19.5
R 400
12 19
F 100
0 0
demand 450 550
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
44
EXAMPLE: CANING OPERATIONS
SCHEDULING
the selection of the nonbasic variable xij to
enter the basis is from those xij where the
corresponding
cij > ui + v j
and we evaluate and focus on all cij > 0 so
that xij is a candidate to enter the basis
we pick xpq
c pq = max
pq ∋ x pq
{c }pq
is nonbasic
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
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
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
45
EXAMPLE SOLUTION
u1 + v1 = 13 u2 + v2 = 19.5
u2 + v1 = 15 u3 + v2 = 19
u4 + v2 = 0
EXAMPLE SOLUTION
We evaluate the cij corresponding to the
nonbasic variables
46
EXAMPLE SOLUTION
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
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE SOLUTION
It follows that
x11 = 200, x21 = 150, x41 = 100, x22 = 150, x32 = 400
47
EXAMPLE SOLUTION
u1 + v1 = 13 u2 + v2 = 19.5
u2 + v1 = 15 u3 + v2 = 19
u4 + v1 = 0
v1 = 13 , u2 = 2 , v2 = 17.5 , u3 = 1.5 , u4 = – 13
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE SOLUTION
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
48
EXAMPLE SOLUTION
= 15,375 $
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
49
SCHEDULING PROBLEM AS A STANDARD
TRANSPORTATION PROBLEM
weekly plant capacity is 700
overtime is possible for weeks 2 and 3 with
- the production of additional 200 units
- additional cost per unit of $ 5
$ 3 for weekly storage of excess production
the objective is to minimize the total costs for
the 4 week schedule
The decision variables are
xij = production in week i for use in week j market
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
50
ASSIGNMENT PROBLEM
We are given
n machines M1 , M2 , … , Mn ↔ i
n jobs J 1 , J2 , … , Jn ↔ j
cij = cost of doing job j on machine i
cij = M if job j cannot be done on machine i
each machine can only do one job and we wish
to determine the optimal match, i.e., the
assignment with the lowest total costs of doing
all the jobs j on the n machines
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
ASSIGNMENT PROBLEM
choices
variables
⎧1 job j is assigned to machine i
xij = ⎪⎨
⎪⎩0 otherwise
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
51
ASSIGNMENT PROBLEM
and the problem constraints can be stated as
n
∑
j =1
xij = 1 ∀ i each machine does exactly 1 job
n
∑
i =1
xij = 1 ∀ j each job is assigned
to only 1 machine
ASSIGNMENT PROBLEM
ai = 1 ∀ i
bj = 1 ∀ j
n n
∑ ai =
i =1
∑
j =1
bj
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
52
NONSTANDARD ASSIGNMENT
PROBLEM
Suppose we have m machines and n jobs with
m ≠ n
NONSTANDARD ASSIGNMENT
PROBLEM
In the case m > n :
53
NONSTANDARD ASSIGNMENT
PROBLEM
NONSTANDARD ASSIGNMENT
PROBLEM
In principle, any assignment problem may be
solved using the transportation problem
technique; in practice , this is not good since
there exists degeneracy in every basic feasible
solution
We note that in the standard assignment
problem for m machines with m = n , there are
exactly m xij that are 1(nonzero) but every basic
feasible solution of the transportation problem
has (2m – 1) basic variables and therefore
contains (m – 1) zero valued basic variables
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
54
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
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
TRANSSHIPMENT PROBLEMS
1
FLOW NETWORK EXAMPLE
1
4
s 3 t
2 5
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
TRANSSHIPMENT PROBLEMS
2
MAX FLOW PROBLEM
on each arc (i , j)
The mathematical statement of the problem is
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
max Z = f
s.t .
0 ≤ f ij ≤ kij ∀ arc ( i , j ) that connects
nodes i and j
f = ∑fi
si at source s conservation
of flow
∑i f it = f at sink t relations
⎫⎪
∑i f ij = ∑k f jk ⎬ at each transshipment node j
⎪⎭
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
3
MAX FLOW PROBLEM
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
NETWORK DEFINITIONS
4
NETWORK DEFINITION
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 ) }
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
NETWORK DEFINITION
the definition is
N = { s , 1, 2, 3, 4, 5, t }
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
5
NETWORK CUT
NETWORK CUT
6
NETWORK CUT
Κ (S ,T ) = k4, t + k4, 5 + k3, 5 + k2, 5
Note : arc (5, 4) is directed from a node in T to a
node in S and is not included in the summation
max flow ≤ Κ (S , T ) ∀ S , T
and consequently
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
7
MAX FLOW MIN CUT THEOREM
MAX FLOW
8
LABELING PROCEDURE
9
EXAMPLE APPLICATION
7 1 9
s 3 t
9 8
2
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE APPLICATION
(1,7) 1 (0, 9)
s (1, 3) t
(0, 9) (1,8)
2
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
10
EXAMPLE APPLICATION
6 1
s 2 t
7
2
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE APPLICATION
(3,7) 1 (0, 9)
s (3, 3) t
(0, 9) (3, 8)
2
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
11
EXAMPLE APPLICATION
f = min { 5, 9 } = 5
s t
9 5
2
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE APPLICATION
(3,7) 1 (0, 9)
s t
(3, 3)
(5, 9) (8, 8)
2
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
12
EXAMPLE APPLICATION
f = min { 4, 9 } = 4
4 1 9
s t
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE APPLICATION
(7,7) 1 (4, 9)
s t
(3, 3)
(5, 9) (8, 8)
2
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
13
EXAMPLE APPLICATION
f = min { 4, 3, 5 } = 3
1 5
s t
3
4
2
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE APPLICATION
s (0, 3)
t
(8, 9) (8, 8)
2
14
UNDIRECTED NETWORKS
A network with undirected arcs is called an
undirected network: the flows on each arc ( i, j )
with the limit kij cannot violate the capacity
constraints in either direction
Mathematically, we require
f ij ≤ kij ⎫ interpretation of
⎪
f ji ≤ k ji ⎪⎬ unidirectional flow below
⎪
f ij f ji = 0 ⎪⎭ capacity limit
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLES OF AN UNDIRECTED
NETWORK WITH ARCS
Consider the network with the three unrestricted
arcs
30
1 3
40 50
s 15 20 25 t
30 30
2 4
50
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
15
EXAMPLE OF A NETWORK WITH
UNDIRECTED ARCS
To make the problems realistic, we assume that
the numbers represent traffic flow capacities:
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
1 30 3
40 50
s 15 15 20
25 25 t
20
30 30
2 4
50
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
16
EXAMPLE OF A NETWORK WITH
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
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
(30 ,30)
30
1 3 (30
(40 ,50)
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
50
(30 ,50)
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
17
EXAMPLE OF A NETWORK WITH
UNDIRECTED ARCS
flow: s 1 3 n = 30
flow: s 2 4 n = 30
flow: s 1 4 3 t = 10
18
NETWORKS WITH MULTIPLE
SOURCES AND MULTIPLE SINKS
s1 t1
n
e
t
ŝ s2 w t2 t̂
o
. . .
. . .
r
sm k
tn
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
1 3 5 6 10 8
20
5 5
sources 10 10
with
supply 20 4 5 7
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
19
MULTIPLE SOURCE / MULTIPLE SINK
NETWORK EXAMPLE
2 15 5
super sink
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
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
f = ∑
sinks
demands
20
MULTIPLE SOURCE / MULTIPLE SINK
NETWORK EXAMPLE
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
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
15 + 5 + 5 + 5 = 30
21
APPLICATION TO MANPOWER
SCHEDULING
Consider the case of a company that must comp-
lete 4 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
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
APPLICATION TO MANPOWER
SCHEDULING
There are the following additional constraints:
22
APPLICATION TO MANPOWER
SCHEDULING
The solution approach is to setup the problem
as a transshipment network
the sources are the 6 months
the sinks are the 4 projects
arcs ( i, j ) are introduced whenever a
feasible assignment of the engineers in
month i can be made to project j ; each arc
has capacity
kij = 2 i = 1, 2, …, 6 , j = A, B, C, D
there is no arc ( 1, C ) since project C cannot
start before month 2
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
APPLICATION TO MANPOWER
SCHEDULING
4 1
A 6
4 2
8
man / months
B
man / months
demands
4 3
supply
4 4 C 3
4 5
D 4
4 6 each arc has capacity 2
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
23
APPLICATION TO MANPOWER
SCHEDULING
APPLICATION TO MANPOWER
SCHEDULING
1 (2, 2)
(4, 4) (2, 2) (2, 2) A (6, 6)
(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)
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
24
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)
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
25
SHORTEST ROUTE PROBLEM
dij = ∞
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DIJKSTRA’S ALGORITHM
The solution is very efficiently performed using
Dijkstra’s algorithm
dij ≥ 0
26
DIJKSTRA’S ALGORITHM
node i
DIJKSTRA’S ALGORITHM
Step 0 : assign the permanent label 0 to node 1
Step 1 : assign the temporary labels to all the other
nodes
d1j if node j is directly connected to
node 1
∞ if node j is not directly connected
to node 1
and select the minimum of the temporary
labels and declare it permanent ; in case
of ties, the choice is arbitrary
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
27
DIJKSTRA’S ALGORITHM
Step 2 : let A be the node most recently assigned
a permanent label and consider each node
j with a temporary label; recompute the
label to be
⎪⎧ temporary label permanent label ⎪⎫
min ⎨ , + d Aj ⎬
⎪⎩ of node j of node A ⎪⎭
DIJKSTRA’S ALGORITHM
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
28
EXAMPLE : SHORTEST PATH
1 7 3 3
1 3
4
4 5
3
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
The problem is to
29
EXAMPLE : SHORTEST PATH
0
3,7,4,∞ ,∞ ⎤⎦
Steps 0 and 1 : L (0 ) = ⎡⎣0 ,,3,7,4,
1
L (4) = ⎡0,3,5,4,7,10 ⎤
⎣ ⎦
6
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
30
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 and we get the path
{ ( 1, 4 ) , ( 4, 5 ) , ( 5, 6 ) }
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
PATH RETRACING
We retrace the path from n back to 0 using the
scheme:
31
SHORTEST PATH BETWEEN ANY TWO
NODES
network
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
4 8 10
0 1 2 3 4
3 3 2 3
4 4 8
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
32
EXAMPLE : SHORTEST PATH
L (0 ) = 3,4,8,10,∞ ⎤⎦
⎡0 ,,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
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
L (3) = ⎡0 ,,3,4,6,8
⎣
3, 4, 6, 8 ⎤⎦
3
Retracing the path we get
8 = 4
O + d 24
node 2 4
33
EXAMPLE : PATH RETRACING
1 4 8 3 10
2
0 1 2 3 4 4
3 3 2 3
4 4 8
0
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
APPPLICATION : EQUIPMENT
REPLACEMENT PROBLEM
We consider the problem of replacing old
equipment or continuing its maintenance
34
APPPLICATION : EQUIPMENT
REPLACEMENT PROBLEM
in order to minimize
fixed variable
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EQUIPMENT REPLACEMENT
PROBLEM
Equipment replacement is planned during the
next 5 years
The cost elements are
pj = purchase costs in year j
sj = salvage value of original
equipment after j years of use
cj = O&M costs in year j of operation
of equipment with the property that
… cj < cj+1 < cj+2 < …
We formulate the equipment replacement
problem as a shortest route problem on a
directed network
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
35
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
beginning of d26
planning period
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
APPPLICATION : EQUIPMENT
REPLACEMENT PROBLEM
36
APPPLICATION : EQUIPMENT
REPLACEMENT PROBLEM
For example, if the purchase is made in year 1
5
d16 = p1 − s5 + ∑c
τ =1
τ
37
COMPACT BOOK STORAGE IN A
LIBRARY
Any book of height Hi may be shelved on a
shelf of height ≥ Hi
38
COMPACT BOOK STORAGE IN A
LIBRARY
For example, if we consider the problem with 2
height classes Hm and Hn with Hm < Hn
all books of height ≤ Hm are shelved in shelf
with height Hm
all other books are shelved on the shelf with
height Hn
The corresponding total costs are
⎡ m ⎤ ⎡ n ⎤
⎢ sm + c m H m
⎢⎣
∑ L j ⎥ + ⎢ sn + c n H n
⎥⎦ ⎢⎣
∑ Lj ⎥
⎥
j =1 j = m +1 ⎦
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
set of n + 1 nodes
N = { 1, 2, . . . , n }
corresponding to the n + 1 book heights with
39
COMPACT BOOK STORAGE IN A
LIBRARY
a total of n ( n + 1) arcs
2
⎧ j
⎪ s + cj H j
d ij = ⎨ j ∑
k = i +1
Lk if j > i
⎪ ∞ otherwise
⎩
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
{ ( 0, 7 ) , ( 7, 9 ) , ( 9, 15 ) , (1 5, 17 ) }
the interpretation of this solution is :
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
40
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
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
41
ECE 307 – Techniques for
Engineering Decisions
Dynamic Programming
George Gross
Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
DYNAMIC PROGRAMMING
making
1
STAGES AND STATES
decision
dn
variable
sn stage n
state
(input)
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
2
RETURN FUNCTION
A decision dn at the stage n transforms the state
sn at the current stage n into the state sn+1 at
the stage n + 1
The state sn and the decision dn are associated
with the value of the objective; the effect is
measured by the return function denoted by
rn ( s n , d n )
The optimal decision at stage n is the decision
d *n that optimizes the return function for state sn
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
RETURN FUNCTION
dn decision
variable
sn stage n
state return
rn ( d n, sn)
(input) function
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
3
ROAD TRIP EXAMPLE
A poor student is traveling from NY to LA
To minimize costs, the student plans to sleep
at friends’ houses each night in cities along the
trip
Based on past experience he can reach
Columbus, Nashville or Louisville after 1
day
Kansas City, Omaha or Dallas after 2 days
San Antonio or Denver after 3 days
LA after 4 days
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
680 610
2 Columbus 5 K. City 8 Denver
580
550 515 1030
790
900 6 Omaha
NY 1 3 Nashville 760 10 LA
700 790
770 510 1050 1390
940
660 790
830
4 Louisville 7 Dallas 9 S. Antonio
270
4
ROAD TRIP
⎧ ⎫
⎪ ⎪
stage 3 : f 3 (5) = min ⎨(610 + 1030),(790 + 1390)⎬ = 1640
⎪⎩ 1640 2180 ⎪⎭
⎧ ⎫
⎪ ⎪
f 3 (6) = min ⎨(540 + 1030),(940 + 1390)⎬ = 1570
⎪⎩ 1570 2330 ⎪⎭
⎧ ⎫
⎪ ⎪
f 3 (7) = min ⎨(790 + 1030),(270 + 1390)⎬ = 1660
⎪⎩ 1820 1660 ⎪⎭
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
5
ROAD TRIP EXAMPLE CALCULATIONS
stage 2 :
⎧⎪ ⎫⎪
f 2 (2) = min ⎨(680 + 1640) , (790 + 1570) , (1050 + 1660) ⎬ = 2320
⎩⎪ 2320 2360 2710 ⎭⎪
⎧⎪ ⎫⎪
f 2 (3) = min ⎨(580 + 1640) , (760 + 1570) , (660 + 1660)⎬ = 2220
⎩⎪ 2220 2330 2320 ⎭⎪
⎧⎪ ⎫⎪
f 2 (4) = min ⎨(510 + 1640) , (700 + 1570) , (830 + 1660)⎬ = 2150
⎩⎪ 2150 2270 2490 ⎭⎪
stage 1 :
⎧⎪ ⎫⎪
f1 (1) = min ⎨(1550 + 2320) , (900 + 2220) , (770 + 2150) ⎬ = 2870
⎩⎪ *2870* 3120 292 ⎭⎪
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
6
WORKING BACKWARDS: PICK UP
MATCHES GAME
There are 30 matches on a table and 2 players
match
win?
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
possible situations:
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
7
WORKING BACKWARDS: PICK UP
MATCHES GAME
1 ⇒ 4 left P1 removes 3
P2’s move is to pick 2 ⇒ 3 left P1 removes 2
3 ⇒ 2 left P1 removes 1
We can reason similarly for the cases of 9, 13,
17, 21, 25, and 29 matches
Therefore, P1 wins if P1 picks 30 – 29 = 1 match
in the first move
In this manner, we can assure a win for any
arbitrary number of matches in the game
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
8
OIL TRANSPORT TECHNOLOGY
intermediate
region
oil
substations
storage final
destinations
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
9
OIL TRANSPORT TECHNOLOGY
Possible approaches to solving such a problem
include:
enumeration: exhaustive evaluation of all
possible paths; too costly since there are
more than 100 possible paths
myopic decision rule: at each node, pick
as the next mode the one reachable by the
cheapest path (in case of ties the pick is
arbitrary) ; for example,
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
0 3 11 15 19 26 29 31 36
oil I-E II-E III-D IV-E V-D VI-D VII-C B
storage
but such a path is not unique and not
guaranteed to be optimal
serial dynamic programming (DP) : we
need to construct the problem solution by
defining the stages, states and decisions
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
10
DP SOLUTION
We define a stage to represent each pumping
region and so each stage corresponds to the
set of vertical nodes I, II, . . . , VII
We use backwards recursion: start from a final
destination and work backwards to the oil stage
We define a state to denote a particular
pumping station ↔ sk
A decision refers to the selection of the branch
from each state sk , so there are at most three
choices for a decision dk :
L ↔ left F ↔ forward R ↔ right
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
11
DP SOLUTION:
STAGE 1 REGION VII
optimal decision return
d1
s1 d *1 f *1 ( s1 )
R L F
A 7 R 7
B 6 3 F 3
C 7 5 6 L 5
D 6 5 3 F 3
E 7 8 5 F 5
F 4 2 6 L 2
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION
STAGE 2 REGION VI
optimal decision
cumulative cost in proceeding
from s2 to a final destination
d2
s2 d 2* f 2* ( s2 )
R L F
A 10 12 R 10
B 9 12 7 F 7
C 5 6 7 R 5
D 8 7 6 F 6
E 7 6 11 L 6
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
12
OIL TRANSPORT : STAGE 2
⎛ ⎞
f ( s2 ) = min r2 ( s2 , d 2 ) + f 1 ( s1 ) ⎟
* ⎜ *
d2 ⎜
⎟
2
⎝ ⎠
a function of only s1
⇓
for given d 2 , s1 is set
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION:
STAGE 3 REGION V
{
f 3* ( s3 ) = min r3 ( s3 , d 3 ) + f 2* ( s2 )
d3
}
d3
s3 d *3 f *3 ( s3 )
R L F
A 14 16 R 14
B 14 17 15 R 14
C 10 5 6 R 10
D 9 12 9 R, F 9
E 12 15 L 12
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
13
DP SOLUTION:
STAGE 4 REGION IV
{
f 4* ( s4 ) = min r4 ( s4 , d 4 ) + f 3* ( s3 )
d4
}
d4
s4 d 4* f 4* ( s4 )
R L F
B 17 18 23 R 17
C 15 22 16 R 15
D 18 17 16 F 16
E 16 21 L 16
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION:
STAGE 5 REGION III
{
f 5* ( s5 ) = min r5 ( s5 , d 5 ) + f 4* ( s4 )
d5
}
d5
s5 d *5 f *5 ( s5 )
R L F
A 19 R 19
B 18 18 R,F 18
C 24 23 17 F 17
D 20 19 25 L 19
E 21 17 F 17
F 20 L 20
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
14
DP SOLUTION:
STAGE 6 REGION II
{
f 6* ( s6 ) = min r6 ( s6 , d 6 ) + f 5* ( s5 )
d6
}
d6
s6 d *6 f 6* ( s6 )
R L F
A 25 R 19
B 21 25 18 R,F 18
C 28 21 23 F 17
D 27 26 29 L 19
E 26 23 22 F 17
F 18 23 L 20
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION:
STAGE 7 REGION I
{
f 7* ( s7 ) = min r7 ( s7 , d 7 ) + f 6* ( s6 )
d7
}
d7
s7 d *7 f 7* ( s7 )
R L F
A 27 32 R 27
B 26 33 26 R,F 26
C 34 25 27 L 25
D 25 27 33 R 25
E 27 35 30 R 27
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
15
THE OPTIMAL TRAJECTORY
f 8* ( s8 ) = min{27 + 6, 26 + 4, 25 + 7, 25 + 8, 27 + 3 }
= 30
oil
storage
I II III VI V VI VII
B A A B C D D
16
OIL TRANSPORT PROBLEM
SOLUTION
We obtain the diagram shown on the next slide
by retracing the steps at each stage
The solution
provides all the optimal solutions
is based on logically breaking up the problem
into stages with computation in each stage
being a function of the number of states in the
stage
provides all the suboptimal paths
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
3 3
6 3
9 6
oil substations
storage
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
17
OIL TRANSPORT PROBLEM
SOLUTION
different than D
2 7 final
VI - D VII - C destination
D
and so the sub optimal cost solution costs are 33
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
18
FACILITIES SELECTION
and considers:
3 location alternatives
building type
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
FACILITIES SELECTION
size
19
FACILITIES SELECTION
building size
B1 B2 B3 B4 none
site
R1 C1 R2 C2 R3 C3 R4 C4 R0 C0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
20
DP SOLUTION APPROACH
parameters
DP SOLUTION APPROACH
stage ↔ site
amount of funds available
state ↔
for construction
decision ↔ building type
profits attained, i.e., the
return function ↔
revenues
impact of a decision on the
transition function ↔
availablity of resources
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
21
DP SOLUTION APPROACH
As we move from stage n backwards to stage n-1
after a decision dn is taken the funds available
for construction are
sn−1 = sn − cn ← costs of decision d n
The recursion relation is
{
f n* ( sn ) = max f n ( sn , d n ) + f n−*1 ( sn−1 )
dn
} n = 1,2, 3
with
s n − 1 = sn − c n
and
f n ( sn , d n ) = rn ( sn , d n ) = Rn← profits of decision d n
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION APPROACH
We use backwards DP and start with site I, a
purely arbitrary choice, as stage 1, where this
stage 1 represents the last decision in the 3 -
stage sequence
22
DP SOLUTION : STAGE 1 SITE I
f1 ( s1 ) = max { r1 ( s1 , d1 )}
0 ≤ d1 ≤ 4 R1
s1 0 1 2 3 4 d 1* f 1* ( s1 )
21 ≥ s1 ≥ 5 0 .5 .65 .80 1.4 4 1.4
4 ≥ s1 ≥ 3 0 .5 .65 .80 3 .80
2 0 .5 .65 2 .65
1 0 .5 1 .50
0 0 0 0 0 0 0 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
f 2* ( s2 ) = max { r2 ( s2 , d 2 ) + f 1* ( s1 )}
0 ≤ d2 ≤ 4 R2
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
23
DP SOLUTION : STAGE 2 SITE II
s2 0 d2 1 2 3 4 dd **22 ff**22(S
( s 22))
21 ≥ s ≥ 13 1.40
2 2.02 2.18 2.36 3.20 4 3.20
12 1.40 2.02 2.18 2.36 2.60 4 2.60
11 1.40 2.02 2.18 2.36 2.60 4 2.60
10 1.40 2.02 2.18 1.76 2.45 4 2.45
9 1.40 2.02 1.58 1.61 2.30 4 2.30
8 1.40 2.02 1.58 1.61 1.80 1 2.02
7 1.40 2.02 1.43 1.61 1 2.02
6 1.40 1.42 1.28 1.46 3 1.46
5 1.40 1.42 0.78 0.96 1 1.42
4 0.80 1.27 1 1.27
3 0.80 1.12 1 1.12
2 0.65 0.62 0 0.65
1 0.50 0 0.50
0 0.00 0 0.00
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
SAMPLE CALCULATIONS
Consider the case s2 = 10 and d2 = 0 :
C2 = 0 and R2 = 0
then, s1 = 10 and d 1* = 4 so that
f 1* ( s1 ) = 1.4
consequently, f2(s2) = 1.4
Consider the case s2 = 10 and d2 = 4 :
C2 = 8 and R2 = 1.8
then, s1 = 2 and d 1* = 2 so that
f 1* ( s1 ) = .65
consequently, f2(s2) = 2.45
We can, then, show that
f 2* ( s2 ) = 2.45
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
24
DP SOLUTION : STAGE 3 SITE III
At stage 3 , the first actual decision is made and
so exactly 21 million is available and s3 = 21
We compute the elements in the table using
f 3* ( s3 ) = max{ r3 ( s3 , d 3 ) + f *2 ( s2 )}
d3 N
where R3
s2 = s 3 − C 3
d3
d 3* f *3 ( s3 )
s3 0 1 2 3 4
21 3.2 3.91 4.4 4.1 4.45 4 4.45
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
OPTIMAL SOLUTION
Optimal profits are 4.45 million
The optimal decision is obtained by retracing
steps from stage 3 to stage 1:
d *3 = 4 ↔ construct B2 at site III
s2 = s3 – C3 = 21 – 11 = 10
d *2 = 4 ↔ construct B4 at site II
s1 = s2 – C2 = 10 – 8 = 2
d 1* = 2 ↔ construct B2 at site 1
C1 = 5 and C1+C2+C3 = 21
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
25
SENSITIVITY CASE
We next consider the case where the maximum
investment available is 15 million
By inspection, the results in stages 1 and 2
remain unchanged; however, we must recom-
pute stage 3 results with the 15 million limit
d3
s3 d 3* f *3 ( s3 )
0 1 2 3 4
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
SENSITIVITY CASE
The optimal solution for this sensitivity case
obtains maximum profits of 3.31 million and the
decision is
d *3 = 1 ↔ construct B1 at site III
s 2 = s3 − C 3 = 15 − 4 = 11
d *2 = 4 ↔ construct B4 at site II
s1 = s2 − C 2 = 11 − 8 = 3
d 1* = 3 ↔ construct B3 at site I
C1 = 3 and C1 + C 2 + C 3 = 15
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
26
OPTIMAL CUTTING STOCK PROBLEM
A paper company gets an order for:
DP SOLUTION APPROACH
A stage is an order and since there are 4 orders
we construct a 4 – stage DP
d4 d3 d2 d1
r4 r2 r3
r1
A state in stage n is the remaining ft of paper
left for the order being processed at stage n and
all the remaining stages
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
27
DP SOLUTION APPROACH
A decision in stage n is the amount of rolls to
produce in stage n :
⎡F ⎤ F
d n = ⎢ 0 ⎥ , the largest integer in 0
⎣ Ln ⎦ Ln
where
Ln = length of order n ( ft )
DP SOLUTION APPROACH
The return function at stage n is the additional
revenues gained from producing dn rolls
The transition function measures amount of
paper remaining at stage n
sn − 1 = sn − d n Ln n = 2,3,4
s0 = s1 − d1 L1
⎡s ⎤
Clearly, d1 = ⎢ 1 ⎥
⎣ L1 ⎦
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
28
DP SOLUTION APPROACH
The recursion relation is
f n* ( sn ) = max {r ( s , d
n n n ) + f n−*1 ( sn−1 ) }
⎡ ⎤
0 ≤ dn ≤ ⎢ sn ⎥
L
⎣ n⎦
n = 1, … , 4
where
sn−1 = sn − d n Ln
and
f 0* ( s0 ) = 0
f n ( sn , d n ) = rnd n + f n−*1 ( sn − d n Ln )
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION APPROACH
stage n 1 2 3 4
length of
2.5 4 3 2
order ( ft )
29
DP SOLUTION : STAGE 1
f 1* ( s1 ) = max
0 ≤ d1 ≤ 5
{r1 ( s1 , d1 )} = max {3.10 d1 }
0 ≤ d1 ≤ 5
⎡ 13 ⎤
d1 ≤ ⎢ = 5
⎣ 2.5 ⎥⎦
s1
f *1 ( s 1 )
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP : SOLUTION STAGE 2
f *2 ( s2 ) = max
0 ≤ d2 ≤ 3
{5.25 d 2 + f 1* ( s2 − 4 d 2 ) }
⎡ 13 ⎤
d2 ≤ ⎢ ⎥ = 3
⎣4⎦
s2
f *2 ( s 2 )
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
30
DP SOLUTION : STAGE 3
f *3 ( s3 ) = max
0 ≤ d3 ≤ 4
{4.40 d 3 + f *2 ( s3 − 3 d 3 ) }
⎡ 13 ⎤
d3 ≤ ⎢ ⎥ = 4
⎣3⎦
s2
f *3 ( s 3 )
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION : STAGE 4
f *4 ( s4 ) = max
0 ≤ d4 ≤ 6
{ 2.5 d 4 + f *3 ( s4 − 2 d 4 ) }
⎡ 13 ⎤
d4 ≤ ⎢ ⎥ = 6
⎣2⎦
*
d4 0 1 2 3 4 5 6 d 4* f 4 ( s4 )
s4 = 13 18.45 17.5 18.2 17.15 16.2 16.9 15 0 18.45
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
31
DP OPTIMAL SOLUTION
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
SENSITIVITY CASE
32
SENSITIVITY CASE : STAGE 4′
⎡ 11 ⎤
d 4′ ≤ ⎢ ⎥ = 5
⎣2⎦
d 4′ 0 1 2 3 4 5 d 4*′ f 4*′ ( s4 )
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
$15.7
d 4*′ = 1, ↔ 1 roll of 2 ft
d 3*′ = 3 ↔ 3 rolls of 3 ft
d 2′ = d 1′ = 0 ↔ no rolls of 4 ft
* *
↔ no rolls of 2.5 ft
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
33
ANOTHER SENSITIVITY CASE
We consider the case with the initial 13 ft, but in
addition we get the constraint that at least 1 roll
of 2 ft must be produced:
d4 ≥ 1
and since s2 = s1 = 0
d 2*′′ = 0 ↔ 0 rolls of 4 ft
d 1*′′ = 0 ↔ 0 rolls of 2.5 ft
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
34
INVENTORY CONTROL PROBLEM
demand 40 60 30 40 30 20
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
lot size 10 20 30 40 50
discount
4 5 10 20 25
%
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
35
INVENTORY CONTROL PROBLEM
There are ordering costs: each order incurs
fixed costs of $ 2 and $ 8 for shipping, handling
and insurance
The storage limitations of the retailer require
that no more than 40 units be in inventory at the
end of the month and the storage charges are
0.2 $/unit; inventory at time 0 and inventory at the
e.o.p. 6 are 0
Assumption: demand occurs at a constant rate
throughout the month
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION APPROACH
backward process
stage
6 5 4 3 2 1
n
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
36
DP SOLUTION APPROACH
d6 d5 d4 d3 d2 d1
r6 r5 r4 r3 r2 r1
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION APPROACH
The state variable at stage n is defined as the
amount entering inventory given that there are
n months remaining – the present month n
plus months n – 1 , n – 2 , . . . , 1
The decision variable at stage n is the amount of
units ordered to satisfy demands for the n
months
The transition function is defined by
sn-1 = sn + dn – Dn n = 1, 2, . . . , 6
s0 = 0 s6 = 0 demand in month n
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
37
DP SOLUTION APPROACH
The return function at stage n is given by
rn ( d n , sn ) = φ ( d n ) + hn ( sn + d n − Dn )
0.2( sn + dn − Dn )
with storage costs
φ ( dn ) = 10
+ [1 − ρ ( d n ) ] d n
fixed discount
costs factor
d n = 10,20,30,40,50
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION APPROACH
dn 0 10 20 30 40 50
{
f n* ( sn ) = min φ (d n ) + hn ⎡⎣ sn + d n − Dn ⎤⎦ + f n−*1 ( sn−1 )
dn
}
n = 1,...,6
s0 = 0 and so f 0* ( s0 ) = 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
38
DP SOLUTION : STAGE 1
s0 = 0 ⎫
⎬ ⇒ s1 = 20, 10 or 0 ⇒ d *1 = 0 , 10 or 20
D1 = 20 ⎭
s1 20 10 0
d *1 0 10 20
φ ( d *1 ) 0 48 86
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION : STAGE 2
D2 = 30 and s1 = s2 + d 2 − 30
{
f *2 ( s2 ) = min φ (d 2 ) + 0.2 ⎡⎣ s2 + d 2 − 30⎤⎦ + φ (d *1 )
d2
}
d2
d *2 f 2* ( s2 )
s2 0 10 20 30 40 50
0 204 188 164 50 164
10 172 168 142 40 142
20 134 136 122 122 30 122
30 86 98 90 0 86
40 50 52 0 50
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
39
DP SOLUTION : STAGE 3
D3 = 40 and s2 = s3 + d 3 − 40
*
3
d3
{
f ( s3 ) = min φ (d 3 ) + 0.2 ⎡⎣ s3 + d 3 − 40⎤⎦ + f *2 ( s2 ) }
d3
d *3 f 3* ( s3 )
s3 0 10 20 30 40 50
0 302 304 40 302
10 282 282 286 30, 40 282
20 250 262 264 252 20 250
30 212 230 244 230 218 10 218
40 164 192 212 210 196 0 164
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION : STAGE 4
D4 = 30 and s3 = s4 + d 4 − 30
{
f *4 ( s4 ) = min φ (d 4 ) + 0.2 ⎡⎣ s4 + d 4 − 30⎤⎦ + f *3 ( s3 )
d4
}
d4
d 4* f 4* ( s4 )
s4 0 10 20 30 40 50
0 420 422 414 50 414
10 388 402 392 384 50 384
20 350 370 372 362 332 50 332
30 302 332 340 342 210 0 302
40 284 302 310 290 0 284
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
40
DP SOLUTION : STAGE 5
D5 = 20 and s4 = s5 + d 5 − 20
{
f 5* ( s5 ) = min φ (d 5 ) + 0.2 ⎡⎣ s5 + d 5 − 20⎤⎦ + f *5 ( s5 )
d5
}
d5
d 5* f *5 ( s5 )
s5 0 10 20 30 40 50
0 500 504 474 468 50 468
10 462 472 454 446 452 40 446
20 414 434 422 426 430 0 414
30 286 384 394 410 10 384
40 336 356 378 0 336
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION : STAGE 6
n=6 D6 = 40 and s6 = 0
s5 = s6 + d 6 − 40 = d 6 − 40
{
f *6 ( s6 ) = min φ (d 6 ) + 0.2 ⎡⎣ s6 + d 6 − 40⎤⎦ + f *5 ( s5 )
d
}
6
d6 0 10 20 30 40 50 d *6 f 6* ( s6 )
d *6 = 40 ⇒ d *5 = 50 ⇒ d *4 = 0 ⇒ d *3 = 40 ⇒ d *2 = 50 ⇒ d 1* = 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
41
OPTIMAL SOLUTION
d *6 = 40 which corresponds to s5 = 0 and costs 606
d 1* = 0 with costs 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
OPTIMAL SOLUTION
d *6 = 40 d *5 = 50 d *4 = 0 d *3 = 40 d *2 = 50 d *1 = 0
s6 = 0 s5 = 0 s4= 30 s3= 0 s2= 0 s1 = 20 s0=0
stage stage stage stage stage stage
6 5 4 3 2 1
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
42
OPTIMAL SOLUTION
optimal trajectory is
s0 = 0 s1 = 20 s2 = 0 s3 = 0 s4 = 30 s5 = 0
10 k$ invested in year 1
43
MUTUAL FUND INVESTMENT
STRATEGIES
We operate under the protocol that
once invested, the money cannot be
withdrawn until the end of the 5-year horizon
all short term gains may be reinvested in
either of the two funds or withdrawn in which
case the withdrawn funds earns no more
further interest
The objective is to maximize the total returns at
the end of 5 years
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
44
MUTUAL FUND INVESTMENT
STRATEGIES
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION APPROACH
d5 d4 d3 d2 d1
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
45
DP SOLUTION METHOD
For stage n , the state sn is the amount of capital
available for investment in the year 6 – n
DP SOLUTION METHOD
The use of backward recursion considers year 5
first and each of the previous years sequentially
Basic considerations:
for each year 6 – n
dn is invested in fund A returns d n i A ( SDT )
( sn − d n )is invested in fund B returns ( sn − d n )i B ( SDT )
for the year 6 – n + 1
sn−1 = d n i A + ( sn − d n ) iB + 1000 n = 2, 3,4,5
s5 = 10,000
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
46
THE OBJECTIVE
The objective is to maximize the total returns
5
max R = ∑r
n =1
n
DP SOLUTION : STAGE 1
For stage 1
r1
s1
d1
where
r1 = (1 + I A )d1 + (1 + I B )( s1 − d1 ) + i Ad1 + i B( s1 − d1 )
= ( I A + i A − I B − iB ) d1 + (1 + I B + i B ) s1
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
47
DP SOLUTION : STAGE 1
r1 = earnings in stage 1 (returns realized at
the end of 5 years)
⎧ d1 ( I A + i A − I B − i B ) + ⎫
f 1* ( s1 ) = max { r1 } = max ⎨ ⎬
d1 d1 ⎩ s1 (1 + I B + i B ) ⎭
⎧ d ( 0.04 + 0.025 − 0.03 − 0.04) + ⎫
= max ⎨ 1 ⎬
0 ≤ d1 ≤ s1 ⎩ s1 (1 + 0.03 + 0.04) ⎭
= max {d1 ( − 0.005) + s1 (1.07)} maximum
optimal d1
return in
decision stage 1
d *1 = 0 f 1* ( s1 ) = 1.07 s1
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION : STAGE 2
r2 = returns realized at the end of 5 years due to
the decision in stage 2
= d 2 (1 + I A )2 + ( s2 − d 2 )(1 + I B )2
= d 2 ⎡⎣(1 + I A )2 − (1 + I B )2 ⎤⎦ + s2 (1 + I B )2
s1 = s2 iB + d 2 ( i A − iB ) + 1,000
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
48
DP SOLUTION : STAGE 2
We select d 2* to maximize
f 2* ( s2 ) = max
d2
{r 2 + f 1* ( s1 ) }
= max
d2
{d 2 (1.042 − 1.032 ) + s2 (1.03)2 + f 1* ( s1 ) }
⎧ d 2 ( .0207) + 1.0609 s2 + ⎫
= max ⎨ ⎬
0 ≤ d2 ≤ s2 ⎩1.07[ .04 s2 + d 2 ( − .015) + 1,000]⎭
= max
d2
{d 2 (.0046) + 1.1037 s2 + 1070}
d 2* = s2 f 2* ( s2 ) = 1.108 s2 + 1070
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION : STAGE 3
r3 = returns realized at the end of 5 years due to
the decision d3
= d 3 (1 + I A )3 + ( s3 − d 3 )(1 + I B )3
= d 3 ⎡⎣(1 + I A )3 − (1 + I B )3 ⎤⎦ + s3 (1 + I B )3
s2 = s3 iB + d 3 ( i A − iB ) + 1,000
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
49
DP SOLUTION : STAGE 3
We select d 3* to maximize
f 3* ( s3 ) = max
d3
{r 3 + f 2* ( s2 ) }
⎧ d 3 (1.043 − 1.033 ) + s3 (1.03)3 + ⎫
= max ⎨ ⎬
d3
⎩1.108 s2 + 1,070 ⎭
= max {2,178 + 1.1481s3 + .0018d 3 }
0 ≤ d3 ≤ s3
d 3* = s3 f 3* ( s3 ) = 1.15 s3 + 2,178
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION : STAGE 4
= d 4 (1 + I A )4 + ( s4 − d 4 )(1 + I B )4
= d 4 ⎡⎣(1 + I A )4 − (1 + I B )4 ⎤⎦ + s4 (1 + I B )4
s3 = s4 i B + d 4 ( i A − iB ) + 1,000
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
50
DP SOLUTION : STAGE 4
We select d 4* to maximize
f 4* ( s4 ) = max
d4
{r + f
4
*
3 ( s3 )}
= max
d4
{d 4 (1.044 − 1.034 ) + s4 (1.03)4 + 1.15 s3 + 2,178 }
= max
0 ≤ d4 ≤ s4
{3328 + 1.1772 s4 + .0156d 4}
d 4* = s4 f 4* ( s4 ) = 1.193 s4 + 3,328
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DP SOLUTION : STAGE 5
r5 = returns realized at the end of 5 years due to
the decision d5
= d 5 (1 + I A )5 + ( s5 − d 5 )(1 + I B )5
s4 = s5 i B + d 5 ( i A − iB ) + 1,000
= 10,000 iB + d 5 ( i A − iB ) + 1,000
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
51
DP SOLUTION : STAGE 5
We select d 5* to maximize
⎧ ⎫
⎪ ⎪
f 5 ( s5 ) = max ⎨10,000(1.03) + d 5 (1.04 − 1.03 ) + f 4 ( s4 ) ⎬
* 5 5 5 *
0 ≤ d5 ≤ s4 ⎪
⎪⎭
⎩ 11,593 0.0574
⎡⎣1,000 + 600 + d 5 ( −.04)⎤⎦ 1.193 + 3,328
⎧ (.0574 − 0.048) ⎫
= max ⎨16,830 + d 5 ⎬
0 ≤ d5 ≤ s5 ⎩ 0.097 ⎭
= 16,830 + 0.097(10,000)
d 5* = 10,000 f 5* ( s5 ) = 16,927
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
OPTIMAL SOLUTION
optimal return at end of 5 years is 16,927 using
the following strategy
beginning investment in
of year fund A fund B
1 10,000 0
2 STD returns + 1,000 0
3 STD returns + 1,000 0
4 STD returns + 1,000 0
5 0 STD returns + 1,000
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
52
ECE 307 – Techniques for
Engineering Decisions
Combinatorial Analysis
George Gross
Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
COMBINATORIAL ANALYSIS
analysis
combinations
permutations
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
1
BASIC PRINCIPLE OF COUNTING
2
EXAMPLE 1 : PAIR FORMATION
girls
3
GENERALIZED VERSION OF THE
BASIC PRINCIPLE
There are
r
Π ni = n1 ⋅ n2 ⋅ n3 ...... ⋅ nr
i =1
r
there are Π ni possible branches in the
i =1
illustration
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 2 : SUBCOMMITTEE
CHOICES
The executive committee of an Engineering
Open House function consists of:
3 first year students
4 sophomores
5 juniors
2 seniors
We need to form a subcommittee of 4 with each
year represented:
There are 3 ⋅ 4 ⋅ 5 ⋅ 2 = 120 different subcommittees
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
4
EXAMPLE 3 : LICENSE PLATE
We consider possible combinations for a six-
place license plate with the first three places
consisting of letters and the last three places of
numbers
EXAMPLE 4 : n POINTS
function
f ( i ) ∈ {0 ,1} i = 1,2,...., n
5
PERMUTATIONS
A set of 3 objects{ A, B, C } may be arranged in 6
different ways:
BCA ABC CBA
BAC ACB CAB
Each arrangement is called a permutation
The total number of permutations is derived from
the Basic Principle:
there are 3 ways to pick the first element
there are 2 ways to pick the second element
there is 1 way to pick the third element
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
PERMUTATIONS
the 3 elements
into
n! = n ( n – 1 ) ( n – 2 ) . . . 1
different permutations
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
6
EXAMPLE 5 : BASEBALL
Number of possible batting orders for a baseball
team with nine members is
9! = 362,880
EXAMPLE 6 : CLASSROOM
A class with 6 boy and 4 girl students is ranked
in terms of weight ; assume that no two students
have the same weight
There are
10! = 3,628,800
possible rankings
If the boys (girls) are ranked among themselves,
the number of different possible rankings is
6!4! = 17,280
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
7
EXAMPLE 7 : BOOKS
EXAMPLE 8 : BOOKS
But, there are 4! possible orderings of the
subjects
4!4!3!2!1! = 6912
8
EXAMPLE 9 : PEPPER
distinct letters
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 9 : PEPPER
However, if we consider any single permutation
of the 6 letters – for example, P1 P2 E1 P3 E2 R –
provides the same word PPEPER as 11 other
permutations if we fail to distinguish between
the same letters
Therefore, there are 6! permutations for distinct
letters but only
6!
= 60
3!2!
permutations when repeated letters are not
distinct
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
9
GENERAL STATEMENT
Consider a set of n objects in which
n1 are alike ( category 1 )
n2 are alike ( category 2 )
.
.
.
nr are alike ( category r )
There are
n!
n1 ! n2 !.....nr !
different permutations
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
There are
11!
= 11,550
3!4!4!
possible arrangements
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
10
COMBINATIONS
COMBINATIONS
and, therefore, we can select
5 ⋅ 4 ⋅ 3 = 60
possible groups in which the order of the groups
is taken into account
But, if the order of the objects is not of interest,
i.e., we ignore that each group of three objects
can be arranged in 6 different permutations, the
total number of distinct groups is
5! 60
= = 10
2!3! 6
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
11
GENERAL STATEMENT ON
COMBINATIONS
The objective is to arrange n elements into
groups of r elements
We can select groups of r
n!
( n − r )!
different ways
But, each group of r has r ! permutations
The number of different combinations is
n!
( n − r )! r !
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
BINOMIAL COEFFICIENTS
⎛ n⎞ n!
⎜r ⎟ ( n − r )! r !
⎝ ⎠
a time
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
12
EXAMPLE 10 : COMMITTEE
SELECTION
We wish to select three persons to represent a
class of forty
There are
40! 40 ⋅ 39 ⋅ 38
= = 20 ⋅ 13 ⋅ 38 = 9880
37!3! 3⋅ 2⋅1
There are
13
GENERAL COMBINATORIAL IDENTITY
⎛ n⎞ ⎛ n − 1⎞ ⎛ n − 1⎞
⎜ ⎟ = ⎜ ⎟ + ⎜ ⎟
⎝r ⎠ ⎝r −1⎠ ⎝ r ⎠
MULTINOMIAL COEFFICIENTS
∑n
i =1
i = n
There are
⎛n ⎞
⎜n ⎟
⎝ 1⎠
14
MULTINOMIAL COEFFICIENTS
MULTINOMIAL COEFFICIENTS
n!
n1 !n2 ! ...nr !
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
15
MULTINOMIAL COEFFICIENTS
Let
n = n1 + n2 + n3 + . . . + nr
⎛ n ⎞ n!
⎜ n ,n , . . . ,n ⎟
⎝ 1 2 r ⎠ n1 ! n2 ! n3 ! . . . nr !
EXAMPLE 12 : POLICE
officers
reserve
16
EXAMPLE 13 : TEAM FORMATION
group of 10 boys
There are
10!
= 252
5!5!
possible divisions
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
17
EXAMPLE 14 : TEA PARTY
to a tea party
together?
18