Вы находитесь на странице: 1из 290

ECE 307 – Techniques for

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

‰ The course covers techniques that are useful


when combined with the appropriate technical
knowledge, for making engineering/economic
decisions
‰ Such decisions are typical of those made by
business firms, government-owned enterprises
and agencies and individuals
‰ We focus on the systematic evaluation of
alternatives before a decision is made
regarding a particular problem
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

1
EXAMPLES OF DECISION MAKING
PROBLEMS
‰ Introduction of a new product

‰ Expansion of production facilities/warehousing

‰ Adoption of new technology

‰ Implementation of a new production schedule

‰ Changes in the production mix

‰ Risk management in purchase/sale activities

‰ Optimal scheduling of processes/projects


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

BASIC THRUSTS

‰ Development of the analytical framework for


decision making on a sound and systematic basis
with the goal to enable the decision maker to
undertake an appropriate analysis and systematic
evaluation of various alternatives
‰ Provide training for engineers to play an
increasingly more prominent role in the decision
making processes in their work environment
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

2
THE UNDERLYING BASIS

‰ Decisions are made by selecting from possible


alternatives with reference to the future which is
inherently uncertain
‰ A common basis is set up by formulating the
decisions in economic terms
‰ A key aspect is the assumptions introduced to
enable the undertaking of the analysis and the
evaluation of alternatives
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

PRODUCT MIX OPTIMIZATION


PROBLEM
‰ A factory manufactures three different products

requiring various levels of resources and

providing different benefits (profits)

‰ The constraints on resources are given

‰ Problem: determine the optimal daily mix, i.e.,

the production schedule that maximizes profits

without violating any constraints


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

3
PRODUCT MIX OPTIMIZATION
PROBLEM

product A B C limit
resources required

labor (h) 1 1 1 100


unit of product

material (lb) 10 4 5 600


per

A&G (h) 2 2 6 300

profits per unit of product ($) 10 6 4

ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

PRODUCT MIX OPTIMIZATION


PROBLEM
‰ We formulate the decision problem by
introducing the decision variables:
xi = daily production level of product i, i = A, B, C
‰ We construct a programming problem for the
schedule by expressing
 the objective function
 the constraints
 the common sense requirements
in mathematical terms
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.

PRODUCT MIX OPTIMIZATION


PROBLEM
‰ The optimal solution is
x A* = 33.33 x B* = 66.67 xC* = 0

corresponding to maximum profits


Z * = $ 733.33
‰ The shadow prices corresponding to the
constraints give the change in profits for
additional resources:
labor : $ 3.33 material : $ 0.67 A&G : $ 0
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.

OPTIMAL TRAJECTORY PLANNING


‰ Mr. Jones has to travel from a fixed starting
point to a fixed destination with a choice of
which intermediate points to go through

2 5
8
1 3 6 10
9
4 7

stage 1 stage 2 stage 3 stage 4


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

6
OPTIMAL TRAJECTORY PLANNING

‰ The relative “costs” for the various possible


paths are given by

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

‰ The problem is to select the route that


minimizes the total costs of the trip
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

OPTIMAL TRAJECTORY PLANNING

‰ 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

 use some heuristic approach which allows to


sacrifice a little at one stage in the hope of
attaining savings thereafter: for example, the
path 1 4 6 has costs of 4 which are less
than those of the path 1 2 6, which are 6
‰ The optimal route is
1 3 5 8 10
with costs of 11
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

OPTIMAL TRAJECTORY PLANNING

‰ There are two additional routes whose costs are

11:

1 4 5 8 10

1 4 6 9 10

‰ Thus, this problem does not result in a unique

optimum
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

8
BUSING PROBLEM

‰ Three school districts in Busville have a

distribution of Caucasians (C ) and African

Americans ( A) as shown in the table

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

‰ Implementation of the Supreme Court ruling on


racial balance requires that each of the three
districts have exactly 300 students with identical
racial make-up, i.e., that

⎛ 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

‰ Given the distances between the districts,


determine the total minimum distance that
students must be bussed to satisfy the social
balance requirements

number of students distance to district


district
C A 2 3
1 210 120 3 5
2 210 30 — 4
3 180 150 4 —
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

THE ENVELOPE QUESTION

‰ On a television game show, the host subjects


contestants to unusual tests of mental skill
‰ On one, a contestant may choose one of two
identical envelopes – labeled A and B – each of
which contains an unknown amount of money
‰ The host reveals, though, that one envelope
contains twice as much money as the other
‰ After choosing A, the host suggests that the
contestant might want to switch; the host states:
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

10
THE ENVELOPE QUESTION

“Switching is clearly advantageous. Suppose


you have amount x in your envelope A. Then B
must contain either x/2 (with probability 0.5). In
fact, now that I think about it, I’ll only let you
switch if you give me a 10% cut of your
winnings. What do you say? You’ll still be
ahead.”
‰ The contestant replies,
“No deal. But I’ll be happy to switch for free. In
fact, I’ll even let you choose which envelope I
get. I won’t even charge you anything!”
‰ Who is right?
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

THE ENVELOPE QUESTION

‰ The host is proposing a decision tree that looks

like this:

keep x
0.5 x
switch
2
0.5 2x

which does not correctly represent the situation


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

11
THE ENVELOPE QUESTION

‰ Rather, we have for the two envelopes A and B


A has x (0.5)
x
keep A B has x/2 (0.5) x

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.

DECISION ANALYSIS PROTOTYPE


EXAMPLE
‰ The Greazy Company owns a tract of land that
may contain oil; the report of a consulting
geologist indicates that there is one chance in
four that oil exists
‰ Because of this prospect, another oil company
has offered to purchase the land for $ 90,000 but
Greazy is considering holding the land in order
to drill for oil itself: if oil is found, the profits are
expected to be $ 700,000 but if land is dry, the
losses are expected to be $ 100,000
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

drill for oil 700,000 (100,000)

sell the land 90,000 90,000

probability 0.25 0.75

ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

DECISION ANALYSIS PROTOTYPE


EXAMPLE
‰ Evaluation of the two alternative actions

action expected payoff (k$)

1 0.25 (700) + 0.75 (-100) = 100

2 0.25 (90) + 0.75 (90) = 90

and the better choice is to drill for oil


‰ The decision is strongly dependent on how good
is the knowledge of the probabilities
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.

DECISION ANALYSIS PROTOTYPE


EXAMPLE
oil 670
ill
dr
f
dry -130
le
ab c 60
or sel l
payoff in k$

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

‰ The decision maker must select an action from a


set of possible actions – the set of feasible
alternatives
‰ The underlying premise is that the choice of
action is made under uncertainty because the
outcome will be affected by random factors
outside the control of the decision maker; this
necessitates a classification of the possible
states of nature
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

A GENERAL FRAMEWORK FOR DECISION


MAKING UNDER UNCERTAINTY

‰ For each contribution of an action and state of

nature, the value to the decision maker of the

consequences of an outcome is established and

quantified in terms of the payoff

‰ The payoff is defined as the quantity measure of

the value to the decision maker of the

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

‰ The payoffs are used to select the optimal action


for the decision maker according to some
selected criterion
‰ Example: Bayes’ decision rule involves the use
of the best available estimates of the
probabilities of the states of nature to calculate
the expected value of the payoff for each
possible action and then to choose the action
with the maximum expected payoff
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

DECISION ANALYSIS

‰ We study decision analysis since its application


can lead to better decisions
‰ We need to differentiate between good decisions
and lucky outcomes
‰ Every decision may have a lucky outcome or an
unlucky outcome
‰ A good decision is one that gives the best
outcome
‰ The goal is to make effective decisions more
consistently
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

16
ECE 307

‰ Prerequisite : ECE 210


‰ Corequisite : ECE 413
‰ Texts
 A. Ravindran, D. T. Phillips and J. J. Solberg,
"Operations Research: Principles and
Practice," J. Wiley, New York, 1992
 R. T. Clemen, “Making Hard Decision: An
Introduction to Decision Analysis,” Duxbury
Press/Wadsworth Publishing Company, 1995
‰ Course Website:
http://energy.ece.uiuc.edu/gross/index_files/Page328.htm
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

GRADING POLICY

‰ Two exams: midterm and final


‰ Two team project presentations
‰ Grade Breakdown
component percentage
Homework 15
Projects 10
Midterm 25
Final 50
Total 100
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

ECE 307 TOPICAL OUTLINE


‰ Scheduling and assignment decisions using
network flow concepts: transshipment problem
formulation and solution; application to
matching decisions; network optimization;
scheduling applications
‰ Sequential decision making in a dynamic
programming framework: nature of dynamic
programming approach; problem formulation;
solution procedures; key limitations
‰ Probability theory: random variables; probability
distributions; expectation; conditional
probability; moments; convolution
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

18
ECE 307 TOPICAL OUTLINE

‰ Statistical concepts: data analysis; statistical


measures; estimation
‰ Application of probabilistic concepts to the
modeling of uncertainty in decision making:
modeling of the impacts of uncertainty;
applications to siting, investment and price
volatility problems
‰ Decision making under uncertainty: decision
trees; value of information; uses of data;
sensitivity analysis and statistics
‰ Case studies and presentations
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ The nature of a programming or optimization

problem

‰ The salient characteristics of a linear

programming (LP) problem

‰ The LP problem formulation

‰ The LP problem solution

‰ Extensive illustrations with numerical examples


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ You first quantify your assessment along the two


dimensions of looks and comfort and construct

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

⎧1 choose high ⎧1 choose low


xH = ⎨ xL = ⎨
⎩ 0 otherwise ⎩0 otherwise
‰ Formulate your objectives to maximize the

weighted assessment as

max {70% * esthetics + 30% * comfort}

‰ Use the defined variables to state the objective

max Z = x H ( 4.2 × 0.7 + 3.5 × 0.3 ) + x L ( 3.6 × 0.7 + 4.8 × 0.3 )


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

MODEL FORMULATION

‰ Next consider the problem constraints:

 only one pair of shoes can be selected

 the decision variables are nonnegative

‰ State the constraints in terms of x H and x L :

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:

⎧1 choose high ⎧1 choose low


xH = ⎨ xL = ⎨
⎩0 otherwise ⎩0 otherwise
‰ Objective function:
max Z = 3.99 x H + 3.96 x L
‰ Constraints:
xH + xL = 1
xH ≥ 0, xL ≥ 0
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

OPTIMAL SOLUTION

‰ We determine the values x *H and x *L which


result on the value of Z * such that

Z * = Z ( x *H , x *L ) ≥ Z ( x H , x L )

for all feasible ( x H , x L )


‰ We call such a solution an optimal solution
‰ A feasible solution is one that satisfies all the
constraints
*
‰ The optimal solution, denoted by , is chosen
from all the feasible solutions
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

PROGRAMMING PROBLEM CLASSES

‰ 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

‰ The supply department can provide daily up to 1


ton of metal
‰ We schedule the production so as to maximize
the profits of the company
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

PROBLEM ANALYSIS

‰ Determination of the objective: to maximize the


profits of the company
‰ Means of attaining this objective: decision of
how many units of product 1 and/or product 2 to
produce each day
‰ Consideration of the constraints: the daily
production capacity limits, the daily metal supply
limit and common sense requirements
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

7
MODEL CONSTRUCTION

‰ We define the decision variables to be

x1 = number of type 1 units produced per day


x2 = number of type 2 units produced per day
‰ We define the objective to be

Z = profits ($/day)
= 3 x1 + 5 x2

‰ Sanity check for units of the objective function


($/day) = ($/unit) • (unit/day)
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

CONSTRUCTION OF THE FEASIBLE


REGION

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.

CONSTRUCTION OF THE FEASIBLE


REGION

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

‰ We can graphically determine the optimal

solution

‰ The optimal solution of this problem is:

x *1 = 2 and x *2 = 6

‰ The objective value at the optimal solution is

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

A linear programming problem is an

optimization problem with a linear

objective function and linear constraints.

ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE 3: ONE-POTATO, TWO-


POTATO PROBLEM
‰ Mr. Spud manages the Potatoes-R-Us Co. which
processes potatoes into packages of freedom
fries ( F ), hash browns ( H ) and chips ( C )
‰ Mr. Spud can buy potatoes from two sources;
each source has distinct characteristics
‰ The problem is to determine the respective
quantities Mr. Spud should buy from source 1
and from source 2 to maximize profits
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

‰ The following assumptions hold:


 30% waste for each source
 production may not exceed sales limit
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

THE FEASIBLE REGION

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.

THE OPTIMAL SOLUTION

‰ The optimal solution of this problem is:

x *1 = 4.5 x *2 = 3

‰ The objective value at the optimal solution is:

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

‰ Constant Z lines are parallel and change


monotonically along the normal direction to the
contours of constant values of Z
‰ An optimal solution must be at one of the corner
points of the feasible region: fortuitously, there
are only a finite number of corner points
‰ If a particular corner point gives a better solution
(in terms of the objective function) than the ones
at all its adjacent corner points, then, it is an
optimal solution
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

SOLUTION PROCEDURE: SIMPLEX


METHOD
‰ Initialization step: start at a corner point

‰ Iteration step: move to a better adjacent corner

point and repeat this step as many times as

needed

‰ Stopping rule: stop when the corner point

solution is better than those at all its adjacent

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.

EXAMPLE 3 : APPLICATION OF THE


SIMPLEX METHOD

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.

EXAMPLE 3: THE SIMPLEX METHOD

1. Start at (0,0) with Z(0,0) = 0


2. (i) Move from (0,0) to (0,6), Z(0,6) = 36
(ii) Move from (0,6) to (4.5,3) and evaluate
Z(4.5,3) = 40.5
3. Compare the objective at (4.5,3) to values at (6,0)
and at (6,0):
Z(4.5,3) ≥ Z(6,0)
Z(4.5,3) ≥ Z(6,0)
therefore, (4.5,3) is optimal
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

19
REVIEW

‰ Key requirements of a programming problem:

 to make a decision and so to define decision

variables

 to achieve some objective and so to formulate

an objective function

 to ensure that the decision satisfies certain

constraints which are mathematically stated


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ Words of caution: care with units and attention to


not ignoring the implicit constraints such as
nonnegativity and common sense requirements
to an LP
‰ Graphical solution approach
 feasible region determination
 contours of constant Z
 identification of the vertex with optimal Z *
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE 4: INSPECTION OF GOODS


PRODUCED
‰ There are 8 grade 1 and 10 grade 2 inspectors
available for QC inspection; at least 1800
pieces must be inspected in each 8-hour day
‰ Problem data are summarized below:

grade speed accuracy wages


level (unit/hr) (%) ($/h)

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

‰ The problem is to determine the optimal

assignment of inspectors, i.e., the number of

inspectors of grade 1 and that of grade 2, respe-

ctively, to result in the least-cost inspection effort


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE 4: FORMULATION

‰ Definition of decision variables:

x1 = number of grade 1 inspectors assigned

x2 = number of grade 2 inspectors assigned

‰ Objective function

 optimal assignment ⇒ minimum costs

 costs = wages + errors


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

22
EXAMPLE 4: FORMULATION

• each grade 1 inspector costs:

4 + 2 (25)(0.02) = 5 $/hr

• each grade 2 inspector costs:

3 + 2 (15)(0.05) = 4.5 $/hr

• total daily inspection costs in $ are

Z = 8 [5 x1 + 4.5 x2] = 40 x1 + 36 x2 ($)


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

MULTI – PERIOD SCHEDULING

‰ More than one period is involved

‰ The result of each period affects the initial

conditions for the next period and therefore the

solution

‰ We need to define variables to take into account

the initial conditions in addition to the decision

variables of the problem


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

24
EXAMPLE 5: HYDROELECTRIC
POWER SYSTEM OPERATIONS
‰ We consider a single operator of a system

consisting of two water reservoirs with a

hydroelectric plant attached to each reservoir

‰ We schedule the two power plant operations over

a two–period horizon

‰ We are interested in a plan to maximize the total

revenues of the system operator


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

parameter reservoir A reservoir B


maximum capacity 2000 1500
predicted inflow in
200 40
period 1
predicted inflow in
130 15
period 2
minimum allowable
1200 800
level
level at start of period 1 1900 850
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE 5: SYSTEM
CHARACTERISTICS

plant A 1 kAf 400 MWh


plant A

plant B 1 kAf 200 MWh


plant B

reservoir max kAf for generation per period

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.

EXAMPLE 5: DECISION VARIABLES

variable quantity denoted units


x Hi energy sold at 20 $/MWh MWh
x Li energy sold at 14 $/MWh MWh
w iA plant A water supply for generation kAf
w Bi plant B water supply for generation kAf
s Ai reservoir A spill kAf
i
s B reservoir B spill kAf
i
rA
reservoir A end of period i level kAf
i
rB reservoir B end of period i level kAf

superscript i denotes period i, i = 1, 2


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

27
EXAMPLE 5: OBJECTIVE FUNCTION

maximize total revenues from sales

max Z = 20( x 1H + x H2 ) + 14( x 1L + x L2 )

4 of the 16 decision variables


2 for each period

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

 limitation on reservoir variables

• reservoir A:

1200 ≤ r A1 ≤ 2000 ( kAf )


• reservoir B:

800 ≤ r B1 ≤ 1500 ( kAf )


 sales constraint

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

 conservation of flow relations for each


reservoir
• reservoir A:
w A2 + s A2 + rA2 = rA1 + 130 ( kAf )

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

 limitation on reservoir variables

• reservoir A:

1200 ≤ rA2 ≤ 2000 ( kAf )


• reservoir B:

800 ≤ rB2 ≤ 1500 ( kAf )


 sales constraint

x H2 ≤ 50,000 ( kAf )
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE 5 : PROBLEM STATEMENT

‰ 16 decision variables:

x Hi , x Li , w Ai , w Bi , s Ai , sBi , r Ai , r Bi , i = 1, 2

‰ Objective function:

max Z = 20( x 1H + x H2 ) + 14( x 1L + x L2 )

‰ Constraints:

 20 constraints for the periods 1 and 2

 nonnegativity constraints on all variables


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

dishwasher Dt 2000 1300 3000 1000

washing
Wt 1200 1500 1000 1400
machine
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE 6: QUARTERLY COST


COMPONENTS
quarter t
cost component parameter unit costs ($)
1 2 3 4
dishwasher ct 125 130 125 126
manufacturing
($/unit) washing
vt 90 100 95 95
machine
dishwasher jt 5.0 4.5 4.5 4.0
storage
($/unit) washing
kt 4.3 3.8 3.8 3.3
machine
hourly labor ($ /hour) pt 6.0 6.0 6.8 6.8
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

32
EXAMPLE 6: CONSTRAINTS

‰ Each dishwasher uses 1.5 hours and each


washing machine uses 2 hours of labor
‰ The labor hours in each quarter cannot grow or
decrease by more than 10%; there were 5000
labor hours in the quarter preceding the first
quarter
‰ At the start of the first quarter, there are 750 dish-
washers and 50 washing machines in storage
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE 6: PROBLEM AIM

How to schedule the production in each of the

four quarters so as to minimize the costs while

meeting the sales targets?

ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

33
EXAMPLE 6: QUARTER t DECISION
VARIABLES

symbol variable

dt number of dishwashers produced

wt number of washing machines produced

rt final inventory of dishwashers

st final inventory of washing machines

ht available labor hours during Qt

t = 1, 2, 3, 4
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE 6: OBJECTIVE FUNCTION

minimize the total costs for the four quarters

manufacturing storage labor


costs costs costs

min Z = c1d 1 + v1 w1 + j1r1 + k1 s1 + p1h1 quarter 1


+ c2 d 2 + v 2 w 2 + j2 r2 + k 2 s2 + p2 h2 quarter 2
+ c3d 3 + v 3 w3 + j3 r3 + k 3 s3 + p3 h3 quarter 3
+ c4 d 4 + v4 w4 + j4 r4 + k4 s4 + p4 h4 quarter 4
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

34
EXAMPLE 6: CONSTRAINTS

‰ Quarterly flow balance relations:


d 1 , w1 d 2 , w2 d 3 , w3 d 4 , w4

r0 , s0 r1 , s1 r2 , s2 r3 , s3 r4 , s4
t=1 t=2 t=3 t=4

D1 ,W1 D2 ,W2 D3 ,W3 D4 ,W4

⎧ 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

‰ Quarterly labor 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.

LINEAR PROGRAMMING PROBLEM

max (min) Z = c1x1 + ... + cnxn


s.t.
a11 x1 + a12 x2 + ... + a1n xn = b1
a21 x1 + a22 x2 + ... + a2n xn = b2

# #
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.

CONVERSION OF LP INTO SFLP

‰ An inequality may be converted into an equality


by defining an additional nonnegative slack
variable

 xslack ≥ 0

 replace the given inequality ≤ b by

inequality + xslack = b

 replace the given inequality ≥ b by

inequality – xslack = b
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

37
CONVERSION OF LP INTO SFLP

‰ An unsigned variable xu is one whose sign is

unspecified

‰ xu is converted into two signed variables x+ and x-

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

‰ x is feasible if and only if x ≥ 0 and A x = b

‰ S = { x | A x = b , x ≥ 0} is the feasible region

‰ If S = Ø ⇒ LP is infeasible

‰ x* is optimal ⇒ cT x * ≥ cTx , ∀ x ∈ S

‰ x* may be unique, or may have multiple values

‰ 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.

SOLUTION OF SYSTEMS OF LINEAR


EQUATIONS

‰ We examine the solution of

Ax = b

using Gauss-Jordan elimination

‰ We first use a simple example and then

generalize to cases of general interest

‰ Consider the system of two equations in five

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 )

‰ For this simple example, the number of

unknowns exceeds the number of equations

and so the system has multiple solutions;

this is the principal reason that the LP solution

is nontrivial
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

SOLUTION OF SYSTEMS OF LINEAR


EQUATIONS
‰ The Gauss-Jordan elimination uses elementary
row operations:
 multiplication of any equation by a nonzero
constant
 addition to any equation of a constant
multiple of any other equation
‰ We transform S1 into the set S2 by multiplying
equation (i) by -1 and adding it to equation (ii)

⎧⎪ 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

‰ A pivot operation is the sequence of elementary


row operations that reduces a system of linear
equations into the form in which a specified
variable becomes basic
‰ A canonical system is a set of linear equations
obtained through pivot operations with the
property that the system has the same number of
basic variables as the number of equations in the
set
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ The basic solution is obtained from a canonical


system with all the nonbasic variables set to 0

‰ For the example, we set x 3 = x 4 = x 5 = 0 and so


x 1 = 6 and x 2 = 2
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

BASIC FEASIBLE SOLUTION


‰ A basic feasible solution is a basic solution in
which the values of all the basic variables are
nonnegative

‰ In the example of system S 2 , we may choose


any two variables to be basic

‰ In general for a system of m equations in n


⎛n⎞
unknowns there are ⎜ ⎟ combinations of
⎝m⎠
possible basic variables
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

4
BASIC FEASIBLE SOLUTION

‰ As n increases the number of combinations

becomes large (although finite)

‰ For the example, we have

⎛ 5⎞ 5!
⎜ ⎟ = = 10
2
⎝ ⎠ 3! 2!

combinations of possible choices


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

THE SIMPLEX SOLUTION METHOD

‰ We next use a simple example to construct the


simplex solution method

‰ The simplex method is a systematic and


efficient way of examining a subset of the basic
feasible solutions of the LP to hone in on an
optimal solution

‰ We apply the notions introduced in the


definitions above
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

THE SIMPLEX SOLUTION METHOD

‰ The canonical form of the example allows the


determination of a basic feasible solution

x1 = x 2 = x 3 = 0 x4 = 8, x5 = 7

‰ The corresponding value of the objective is

Z = − 8 + 7 = −1

‰ The next step is to improve the basic feasible


solution by finding an adjacent basic feasible
solution
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

6
ADJACENT FEASIBLE SOLUTION

‰ An adjacent feasible solution is one which

differs from the current basic feasible solution

in exactly one basic variable

‰ Note, we characterize a basic feasible solution

by the following traits


basic variable ≥ 0
nonbasic variable = 0
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

ADJACENT FEASIBLE SOLUTION


‰ The search of an adjacent basic feasible
solution uses the idea of making a nonbasic
variable into a basic variable by increasing its
value from 0 to the largest positive value
without violating any constraints

‰ To make the search efficient, we choose the


nonbasic variable that can improve the value of
Z by the largest amount
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

7
ADJACENT FEASIBLE SOLUTION

‰ In the example, consider the nonbasic variable

x 1 , we leave x 2 = x 3 = 0 and examine the

possibility of making x 1 into a basic variable

‰ The variable x 1 enters in both constraints

x1 + x 4 = 8
3 x1 + x5 = 7
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

ADJACENT FEASIBLE SOLUTION

‰ The largest value x 1 can assume without


making x 4 or x 5 negative is

⎧ 7⎫ 7
min ⎨8, ⎬ =
⎩ 3⎭ 3

‰ We have the new basic variable with the value


7
x1 = ,
3
and the previous basic variable
17
x4 = ,
3
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

8
ADJACENT FEASIBLE SOLUTION

and the three nonbasic variables are set to 0:

x 2 = x 3 = 0 and x 5 = 0

‰ Note that we have an improvement in Z since its


value becomes
7 17 18
Z =5 i − = = 6 > −1
3 3 3
‰ We next need to put the system of equations
into canonical form:
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

SIMPLEX METHODOLOGY EXAMPLE

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

 multiply equation (**) by −


1 and add to
3
equation (*)
2 5 1 17
x 2 + x 3 + x4 − x 5 =
3 3 3 3

 multiply equation (**) by 1


3
4 1 1 7
x1+ x2 + x + x5 =
3 3 3 3 3

ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

THE SIMPLEX SOLUTION METHOD


‰ We continue this process until the condition of
optimality is satisfied:

 in a maximization problem, a basic feasible


solution is optimal if and only if the relative
profits of each nonbasic variable is ≤ 0

 in a minimization problem, a basic feasible


solution is optimal if and only if the relative
costs of each nonbasic variable is ≥ 0
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

10
THE SIMPLEX SOLUTION METHOD

‰ The relative profits (costs) are given by the

change in Z corresponding to a unit change in a

nonbasic variable

ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

SIMPLEX ALGORITHM FOR


MAXIMIZATION
Step 1: start with an initial basic feasible
solution with all constraint equations in
canonical form
Step 2: check for optimality condition: if the
relative profits are < 0 for each
nonbasic variable, then the basic
feasible solution is optimal and stop;
else, go to Step 3
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.

THE SIMPLEX TABLEAU

‰ We use an efficient way to represent visually the

steps in the simplex method through a sequence

of so-called tableaus

‰ We illustrate the tableau for the simple example

for the initial basic feasible solution


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

12
THE SIMPLEX TABLEAU

coefficients of the coefficient of xj in Z


basic variables in Z

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.

THE SIMPLEX TABLEAU


‰ The optimality check requires the evaluation of
⎛ column corresponding ⎞
c j = c j − ⎜⎜ c TB i to x in canonical form ⎟⎟
⎝ j ⎠
‰ For each nonbasic variable j, for our example,
we have
⎡1 ⎤
c1 = 5 − ⎡⎣−1, 1⎤⎦ i ⎢ ⎥ = 3
⎣ 3⎦
⎡ 2⎤
c 2 = 2 − ⎡⎣−1, 1⎤⎦ i ⎢ ⎥ = 0
⎣4 ⎦
⎡ 2⎤
c 3 = 3 − ⎡⎣−1, 1⎤⎦ i ⎢ ⎥ = 4
⎣1 ⎦
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

‰ Note that the optimality test indicates that

c1 = 3 > 0 and c3 = 4 > 0


and so the initial basic feasible solution is non-
optimal

‰ Since c 3 > c1 , we pick x 3 as the nonbasic


variable to become a basic variable

‰ We examine the limiting solution for x 3 in the


two constraint equations:
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

14
THE SIMPLEX TABLEAU

equation limiting basic upper limit on


variable x3
1 x4 (8/2) = 4

2 x5 (7/1) = 7

and so the limiting value is

min { 4, 7 } = 4

‰ We replace the basic variable x 4 by x 3


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

SIMPLEX METHODOLOGY EXAMPLE

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

€ multiplying (*) by 1 to produce (*†)


2
€ subtract (*†) from (**) to produce (**†)
1 1
x1 + x 2 + x 3 + x = 4 (* †)
2 2 4
5 1
x1 + 3 x 2 − x + x 5 = 3 (* * †)
2 2 4
‰ The adjacent basic feasible solution is
x1 = x2 = x4 = 0 x3 = 4, x5 = 3
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

THE SIMPLEX TABLEAU

‰ We prepare the corresponding tableau

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

‰ Since c 1 > 0 , the basic feasible solution is non-


optimal
‰ We examine how to bring x1 into the basis

equation limiting basic upper limit on


variable x1
(*†) x3 4/(1/2) = 8
(**†) x5 3/(5/2) = 6/5

ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

THE SIMPLEX TABLEAU


‰ The variable x1 enters the basis with the value
⎧ 6⎫ 6
min ⎨ 8, ⎬ =
⎩ 5⎭ 5
and x5 is replaced as a basic variable by x 1
‰ We need to put the equations
1 1
x1 + x 2 + x 3 + x = 4 (*†)
2 2 4
5 1
x1 + 3 x 2 − x + x 5 = 3 (**†)
2 2 4
into canonical form for the basic variables
x 3 and x 1
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

 multiply (**†) by – 1/5 and add to (*)


2 3 1 17
x + x3 + x − x =
5 2 5 4 5 5 5
 multiply (**†) by 2/5
6 1 2 6
x1 + x − x + x =
5 2 5 4 5 5 5

and construct the corresponding tableau


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

THE SIMPLEX TABLEAU

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

5 x1 1 6/5 – 1/5 2/5 6/5

cT 0 – 26/5 0 – 9/5 – 2/5 Z = 81/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.

SIMPLEX TABLEAU EXAMPLE

‰ We put this problem into standard form:


max Z = 3 x 1 + 2 x 2 canonical form
s .t .

− x1 + 2 x 2 + x 3 = 4 ⎪
⎪⎪
x1 + 2 x 2 + x4 = 14 ⎬

x1 − x 2 + x5 = 3 ⎪
⎪⎭

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.

SIMPLEX TABLEAU EXAMPLE


‰ The data in c T indicates that the highest relative
profits correspond to x 1 so want to make x 1 a
basic variable
‰ To bring x 1 into the basis requires to evaluate
⎧ 14 ⎫
min ⎨∞ , , 3⎬ = 3
⎩ 3 ⎭
and so x 1 replaces x 5 with the value 3
‰ We evaluate the basic variable at the adjacent
basic feasible solution and convert into
canonical form; the new tableau becomes
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.

SIMPLEX TABLEAU EXAMPLE

‰ We reproduce here the calculation of the c T

components

c j = c j −( c T
B i column corresponding to x j )
for each nonbasic variable x j

‰ Note that ci = 0 for each basic variable x i by

definition
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

21
SIMPLEX TABLEAU EXAMPLE

‰ The calculations give


c1 = 0 by definition since x 1 is in the basis
⎡1⎤
⎢ ⎥ indicates possible
c 2 = 2 − ⎡⎣0 0 3⎤⎦ ⎢ 5 ⎥ = 5 improvement
⎢ ⎥
⎣ − 1⎦
c 3 = 0 by definition since x 3 is in the basis
c 4 = 0 by definition since x 4 is in the basis
⎡ 1 ⎤
⎢ ⎥
c 5 = 0 − ⎡⎣0 0 3⎤⎦ ⎢ − 3⎥ = − 3
⎢ ⎥
⎣ 1 ⎦
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

SIMPLEX TABLEAU EXAMPLE

‰ Clearly, the only choice is to get x 2 into the


basis and so we need to establish the limiting
condition from the three equations by evaluating

min {7 , 1, ∞} = 1

and so x 2 replaces x 4 , which becomes a


nonbasic variable

‰ We need to rewrite the equations into canonical


form and construct the new tableau
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

SIMPLEX TABLEAU EXAMPLE

‰ An optimum is at the solution of


canonical form

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

‰ Consider the following LP


max Z = 3 x1 + 2 x 2

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.

LINEAR PROGRAMMING EXAMPLE

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

‰ The tableau approach leads to C which is an


optimal solution with
x 1 = 4, x 2 = 1, x 3 = 6, x 4 = 0, x 5 = 0
‰ Note that any point along CD has Z = 14 and as
such D is another optimal solution correspon-
ding to an adjacent basic feasible solution
‰ We may obtain D from C by bringing into the
basis the nonbasic variable x 5 in Tableau 3;
note that c5 = 0
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

LINEAR PROGRAMMING EXAMPLE

‰ We may choose x 5 as a basic variable without

effecting Z since the relative profits are 0 ; we

compute the limiting value of x 5

‰ The limit is imposed by x 3 which, consequent-

ly, leaves the basis

‰ The corresponding tableau is:


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

3 x1 1 –1/4 1/4 5/2

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.

LINEAR PROGRAMMING EXAMPLE

‰ The adjacent feasible solution is given by

5 13 15
x1 = , x2 = , x3 = x4 = 0 , x5 =
2 4 4

‰ Note that at this basic feasible solution,

cj ≤ 0 ∀ j

and so this is also an optimal solution

ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

26
ALTERNATE OPTIMAL SOLUTION

In general, an alternate optimal solutions is

indicated whenever there exists a nonbasic

variable x j with c j = 0 in an optimal tableau

ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

MINIMIZATION LP

‰ Consider a minimization problem


n
min Z = ∑ ci xi
i =1

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

Every minimization LP may be solved as a


maximization LP because of equivalence

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.

COMPLICATIONS IN THE SIMPLEX


METHODOLOGY

‰ Two variables x j and x k are tied in the selection


of the nonbasic variables to replace a current
basic variable when c j = c k ; the choice of the
new nonbasic variable to enter the basis is
arbitrary
‰ Two or more constraints may give rise to the
same minimum ratio value in selecting the basic
variable to be replaced
‰ We consider the example of the following tableau
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

candidate for basic variable


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

COMPLICATIONS IN THE SIMPLEX


METHODOLOGY
 in selecting the nonbasic variable x 4 to
enter the basis, we observe that the first
two constraints give the same minimum
ratio: this means that when x 4 is first
increased to 2 , both the basic variables x 1
and x 2 will reduce to zero even though only
one of them can be made a nonbasic
variable
 we arbitrarily decide to remove x 1 from the
basis to get the new basic feasible solution:
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

COMPLICATIONS IN THE SIMPLEX


METHODOLOGY

 in the new basic feasible solution

x1 = 0 x 2 = 0 x 3 = 1 x 4 = 2 x 5 = 0 x 6 = 0 ,

we treat x 2 as a basic variable whose value is

0, the same as if it were a nonbasic variable


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

30
DEGENERACY

‰ A degenerate basic feasible solution is one


where one or more basic variables is 0
‰ Degeneracy may lead to a number of
complications in the simplex approach: an
important implication is a minimum ratio of 0 , so
that no new nonbasic variable maybe included in
the basis and therefore the basis remains
unchanged
‰ We consider the following example tableau
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

the logical choice being the nonbasic variable


x 6 to enter the basis; this leads to finding the
limiting constraint from two equations
1
x = 2 − x4
2 6
1
x = 0 − x5
2 6
and no constraint in the third equation; thus
x 6 = min {4, 0 , ∞ }
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

DEGENERACY

‰ Degeneracy may result in the construction of


new tableaus without improvement in the
objective function value, thereby reducing the
efficiency of the computations: theoretically, an
infinite loop, the so-called cycling, is possible
‰ Whenever ties occur in the minimum ratio rule,
an arbitrary decision is made regarding which
basic variable is replaced, ignoring the
theoretical consequences of degeneracy and
cycling
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

32
MINIMUM RATIO RULE COMPLICATIONS

‰ The minimum ratio rule may not be able to


determine the basic variable to be replaced:
this is the case when all equations lead to ∞
as the limit
‰ Consider the example and corresponding tableau
max Z = 2 x1 + 3 x 2
s.t .
x1 − x 2 + x 3 = 2
− 3 x1 + x 2 + x4 = 4
x i ≥ 0, i = 1,...,4
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ The nonbasic variable x 2 enters the basis to

replacing x 4 and the new tableau is


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ We select x 1 to enter the basis but we are


unable to get limiting constraints from the two
equations
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

MINIMUM RATIO RULE COMPLICATIONS

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

and therefore, the solution is unbounded

‰ The failure of the minimum ratio rule to result in

a bound at any simplex tableau implies that the

problem has an unbounded solution


ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

34
ECE-307
Duality Concepts in Linear Programming

George Gross
Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign

© 2006 University of Illinois Board of Trustees, All Rights Reserved


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

DUALITY

‰ Definition: A LP is in symmetric form if all the

variables are restricted to be nonnegative and

all the constraints are inequalities:


corresponding
objective type
inequality type

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

discount / cost coefficients R1


retail stores
warehouses
R1 R2 R3 W1

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.

DUAL PROBLEM SETUP


maxW = − 300 y1 − 600 y2 + 200 y3 + 300 y4 + 400 y5
s.t.
− y1 + y3 ≤ c11 = 2
− y1 + y4 ≤ c12 = 4
− y1 + y5 ≤ c13 = 3
− y2 + y 3 ≤ c21 = 5
− y2 + y4 ≤ c22 = 3
− y2 + y5 ≤ c23 = 4
yi ≥ 0 i = 1, 2, ..., 5
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

5
INTERPRETATION OF DUAL PROBLEM

‰ The moving company approaches the manufac-


turer with the following proposition to:
buy all the 300 units at W1 for y1 /unit
buy all the 600 units at W2 for y2 /unit
sell all the 200 units at R1 at y3 /unit
sell all the 300 units at R 2 at y4 /unit
sell all the 400 units at R 3 at y5 /unit
‰ To convince the manufacturer to get his
business, the mover ensures that he can deliver
for less than the transportation costs the
manufacturer would incur (the dual constraints)
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ The mover wishes to maximize profits


revenues − costs ⇒ dual cost objective function
maxW = − 300 y1 − 600 y2 + 200 y3 + 300 y4 + 400 y5
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

lumber board (ft) 8 6 1 48

finishing (h) 4 2 1.5 20

carpentry (h) 2 1.5 0.5 8

‰ We assume that the demand for desks, tables


and chairs is unlimited and the available resour-
ces are already purchased
‰ The decision problem is to maximize total
revenues
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

PRIMAL AND DUAL PROBLEM


FORMULATION
‰ The dual problem is

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.

INTERPRETATION OF DUAL PROBLEM

‰ An entrepreneur wishes to purchase all of


Dakota’s resources
‰ He thus needs to determine the price to pay for
each unit of the resources
y1 = price paid for 1 lumber board ft
y2 = price paid for 1 h of finishing
y3 = price paid for 1 h of carpentry

‰ We solve the Dakota dual problem to determine


y1, y2, y3
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.

INTERPRETATION OF DUAL PROBLEM

‰ In the same way we obtain the two additional

constraints for a table and for a chair

‰ In the same way, the ith primal variable corresp-

onds to the dual variable of the ith constraint in

the dual problem statement

‰ The ith dual variable corresponds to the ith primal

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.

EXAMPLE 3: DIET PROBLEM


chocolate costs
food calories sugar (oz) fat (oz)
(oz) (cents)

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

‰ Objective of the problem is to minimize the costs


of the diet
‰ Decision variables are defined for each day’s
purchases

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

‰ The problem statement is

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

‰ Consider we have a sales person of “nutrients”


who is interested in assuming that each dieter
meets daily requirements by purchasing
calories, sugar, fat and chocolate
‰ The key decision is to determine the prices
yi = price per unit charged to dieter
‰ Objective of sales person is to set the prices yi
so as to maximize revenues from selling to the
dieter the daily ration of required nutrients
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ Far any x feasible for ( P ) and any y feasible for

(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.

COROLLARIES OF THE WEAK


DUALITY THEOREM
‰ Corollary 1:

x feasible for ( P ) ⇒ c T x ≤ yT b

for any feasible y for ( D )

c T x ≤ y*T b = min W

For any feasible x for ( P ) ,

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

for every feasible x for ( P )

max Z = max c T x = c T x* < y*T b

For any feasible y of ( D ) ,

yT b ≥ maz Z
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

COROLLARIES OF THE WEAK


DUALITY THEOREM: 3
‰ Corollary 3:
( P ) is feasible and max Z is unbounded, i.e.,
Z → +∞ .
Then, ( D ) has no feasible solution.
‰ Corollary 4:
( D ) is feasible and min Z is unbounded, i.e.,

Z → −∞ .
Then, ( P ) is infeasible
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

16
DUALITY THEOREM APPLICATION

‰ Consider the maximization problem

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.

DUALITY THEOREM APPLICATION

‰ The corresponding dual is given by

min W = bT y

s.t.
(D )
AT y ≥ c

y ≥ 0

‰ With the approximate substitutions, we have


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

GENERALIZED FORM OF THE DUAL

‰ Consider the primal decision


x i = 1, i = 1, 2, 3, 4

which is feasible for (P) with


Z = c T x = 10

and the dual decision


y i = 1, i = 1, 2,

which is feasible for (D) with


W = b T y = 40
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 )

and so clearly, (P) and (D) satisfy the Weak

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 feasible and (D) is infeasible. Then,

(P) is unbounded

‰ Corollary 6:

(D) is feasible and (P) is infeasible. Then,

(D) is unbounded
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

19
EXAMPLE

‰ Consider the primal dual problems:


max Z = x1 + x2 min W = 2 y1 + y2
s.t . s.t .
− x1 + x2 + x3 ≤ 2 ( P ) − y1 − 2 y2 ≥ 1 ( D)
−2 x1 + x2 − x3 ≤ 1 y1 + y2 ≥ 1
x1 , x2 , x3 ≥ 0 y1 − y2 ≥ 0
y1 , y2 ≥ 0
‰ Now
x = 0 is feasible for ( P )
but
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE

− y1 − 2 y2 ≥ 1

is impossible for (D) since it is inconsistent with

y1 , y2 ≥ 0

‰ It follows from Corollary 5 that (D) is infeasible

Z →∞

‰ You should be able to show this result by

solving (P) using the simplex


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

20
OPTIMALITY CRITERION THEOREM

‰ We consider the primal-dual problems (P) and (D)


with
x 0 is feasible for ( P ) x 0 is optimal for ( P )
y 0 is feasible for ( D ) ⇒ and
c T x 0 = bT x 0 y 0 is optimal for ( D )

‰ We next provide the proof:

x 0 is feasible for ( P ) Weak Duality


⇒ c T x 0 ≤ bT y 0
y is feasible for ( D )
0
Theorem
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

OPTIMALITY CRITERION THEOREM

but we are given that


cT x 0 = b t y 0
and so it follows that
∀ feasible x , y 0 feasible c T x ≤ bT y 0 = c T x 0
and therefore
x 0 is optimal
Similarly
∀ feasible y , x 0 feasible bT y ≥ c T x 0 = bT y 0
so it follows that
y 0 is optimal
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

21
MAIN DUALITY THEOREM

Given that (P) is feasible and (D) is feasible;

∃ x * feasible for ( P ) which is optimal and


then,

∃ y* feasible for ( D ) which is optimal such that

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

where the optimal values of the slack variables

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 *

‰ We need to prove optimality which is true if and

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

the constraint resource

‰ The shadow price determines the value/worth of

having an additional quantity of a resource

‰ In the previous example, the optimal dual

variables indicate that the worth of another unit

of resource 1 is 1.2 and that of another unit of

resource 2 is 0.2
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

GENERALIZED FORM OF THE DUAL

‰ We start out with


max Z = cT x
s.t.
Ax = b (P)
x ≥ 0
‰ To find (D), we first put (P ) in symmetric form
y+ ↔ Ax ≤ b
⎡ A⎤ x ⎡ b⎤ symmetric
y− ↔ − Ax ≤ − b ⎢− A ⎥ ≤ ⎢− b ⎥
⎣ ⎦ ⎣ ⎦ form
x ≥ 0
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

29
GENERALIZED FORM OF THE DUAL

‰ Let
y = y + − y−

‰ We rewrite the problem as


min W = b T y
s.t .
AT y ≥ c
y is unsigned

‰ The c.s. conditions apply

(
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 ⎥⎦

is optimal for (P)


‰ Then the c.s. conditions obtain

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

have implications on the y i* variable

‰ Since, x 2* = − 4 then, we have

y 3* = 0

‰ Now, with y 7* = 0 we have

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.

PRIMAL – DUAL TABLE

primal (maximize) dual (minimize)


A (coefficient matrix) A T (transpose of the coefficient matrix)
b (right-hand side vector) b (cost vector)
c (price vector) c (right hand side vector)
i th constraint is = type the dual variable y i is unrestricted in sign
i th constraint is ≤ type the dual variable y i ≥ 0
i th constraint is ≥ type the dual variable y i ≤ 0
x j is unrestricted j th dual constraint is = type
xj ≥ 0 j th dual constraint is ≥ type
xj ≤ 0 j th dual constraint is ≤ type

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.

NETWORKS AND FLOWS

‰ A network is a system of lines or channels


connecting different points
‰ Examples abound in nearly all aspects of life:
 electrical systems
 communication networks
 airline web
 local area networks
 distribution systems
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

1
NETWORKS AND FLOWS

‰ The network structure is also common to many


other systems that at first glance are not
necessarily viewed as networks
 distribution system consisting of
manufacturing plants, warehouses and retail
outlets
 matching problems such as work to people,
assignments to machines and computer
dating
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

NETWORKS AND FLOWS

 river systems with pondage for electric


generation

 mail delivery networks

 project management of multiple tasks in a


large undertaking such as construction or a
space flight

‰ We consider a broad range of network and


network flow problems
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

2
THE TRANSPORTATION PROBLEM

‰ The basic idea of the transportation problem is

illustrated with the problem of distribution of a

specified homogenous product from several

sources to a number of localities at least cost

‰ We consider a system with m warehouses, n

markets and links between them with specified

costs
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

THE TRANSPORTATION PROBLEM


supply demand
⎧ a1 b1 ⎫
⎪1 transportation 1 ⎪⎪

⎪ links with ⎪
⎪ ⎪
a2 b2 ⎪
warehouses

⎪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

 all the supply comes from the m ware-


houses; we associate the index i with a
warehouse i = 1, 2, …, m

 all the demand is at the n markets: we


associate the index j with a market
j = 1, 2, …, n

 shipping costs of cij for each unit from


warehouse i to market j
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

THE TRANSPORTATION PROBLEM

‰ The transportation problem is to determine the

optimal shipping schedule that minimizes

shipping costs for the set of m warehouses to

the set of n markets


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

4
LP FORMULATION OF THE
TRANSPORTATION PROBLEM
‰ The decision variables are

quantity shipped from


xij =
warehouse i to market j

‰ The objective function is

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

every available unit of supply at the m ware-


houses is shipped to meet all the demands of
the n markets; this problem is known as the
standard transportation problem
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

W1 x11 x12 x13 x14 a1


c11 c12 c13 c14

W2 x21 x22 x23 x24 a2


c21 c22 c23 c24

W3 x31 x32 x33 x34 a3


c31 c32 c33 c34

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

there are at most m + n – 1 independent


constraints and consequently at most
m + n – 1 independent variables xij
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

THE LEAST – COST RULE


PROCEDURE

‰ This scheme is used to generate an initial basic

feasible solution which has no more than

m + n – 1 positive valued basic variables

‰ The key idea of the scheme is to select, at each

step, the variable xij with the lowest shipping

costs cij as the next basic variable


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.

APPLICATION OF THE LEAST COST


RULE
market j M1 M2 M3 M4 ai
w/h i

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

which is the value for the modified demand at

M4

‰ We again apply the criterion selection for the

reduced tableau: c24 is the lowest cij is for

i = 2, j = 4 and we select x24 as a basic variable


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

APPLICATION OF THE LEAST – COST


RULE
‰ We choose x24 as large as possible without

violating any constraints:

min { a2 , b4 } = min { 7 , 1 } = 1

and we set x24 = 1 and

x34 = 0

‰ We delete column 4 from further consideration

since no more demand remains at M4


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

10
APPLICATION OF THE LEAST – COST
RULE
‰ The remaining supply at W2 is

7–1 =6

which is the value for the modified supply at W2

‰ We repeat these steps until we find the nonzero

basic variables and obtain a basic feasible

solution

‰ For the reduced tableau


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

APPLICATION OF THE LEAST – COST


RULE
market j M1 M2 M3 ai

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.

APPLICATION OF THE LEAST – COST


RULE
market j M1 M2 ai

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.

APPLICATION OF THE LEAST – COST


RULE
market j M1 ai

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.

INITIAL BASIC FEASIBLE SOLUTION


market j M1 M2 M3 M4 ai
w/h i

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

‰ The feasible solution involves only the basic

variables and results in total costs of

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.

THE STANDARD TRANSPORTATION


PROBLEM
‰ The primal problem is

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.

THE STANDARD TRANSPORTATION


PROBLEM
‰ The complementary slackness conditions are

xij* [ ui* + v *j − cij* ] = 0

‰ And due to the equalities in ( P ) the other

complementary slackness conditions fail to

provide additional information


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

16
THE TRANSPORTATION PROBLEM

‰ The complementary slackness conditions obtain

xij* > 0 ⇒ ui* + v*j = cij

ui* + v *j < cij ⇒ xij* = 0

‰ We make use of the duality characteristics to

develop the u – v method for solving the

standard transportation problem


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

THE u-v METHOD

‰ The u-v method starts with a basic feasible

solution for the primal problem, obtains the

corresponding dual variables (as if the solution

were optimal) and uses the duals to determine

the adjacent basic feasible solution; the process

continues until the optimality condition is

satisfied
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

17
THE u-v METHOD

‰ For a basic feasible solution, we find the dual

variable ui and vj using the complementary

slackness conditions

ui + v j = cij ∀ basic xij

with ui and vj being unrestricted in sign


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

THE u-v METHOD


‰ We compute using
cij = cij − ( ui + v j ) ∀ nonbasic xij

the step is the analogue of computing c T in the


simplex tableau approach

‰ The complementary-slackness-based optimality


test is performed :
if cij ≥ 0 ∀ nonbasic xij ⎡⎣ xij = 0 ⎤⎦ ,
then the basic feasible solution is optimal
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ The basic step from the dual formulation is to

require

ui + v j = cij ∀ basic xij

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

‰ We have 6 equations in 7 unknowns and so there


is an infinite number of solutions
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

x11 : c11 = c11 − ( u1 + v1 ) = 2 − (1 + 6) = − 5

x12 : c12 = c12 − ( u1 + v2 ) = 2 − (1 + 5) = − 4

x13 : c13 = c13 − ( u1 + v3 ) = 2 − (1 + 1) = 0

x34 : c34 = c34 − ( u3 + v4 ) = 8 − (1 + 0 ) = 7

x33 : c33 = c33 − ( u3 + v3 ) = 6 − (1 + 1) = 4


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

STANDARD TRANSPORTATION
PROBLEM EXAMPLE
‰ We determine
c pq = min

 = c11 = − 5
pq ∋ x pq
is nonbasic

and consequently the nonbasic variable x11 is

introduced into the basis

‰ We determine the maximal value of x11 by

setting x11 = θ from the tableau


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ Consequently, x21 = 0 and leaves the basis

‰ We obtain the basic feasible solution

x14 = 1, x11 = 2, x31 = 2, x32 = 3, x23 = 4, x24 = 3

and repeat to solve the u – v problem for this

new basic feasible solution


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

nonzero valued basic variables obtain

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

‰ We compute cij for each nonbasic variable xij


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

only possible improvement


‰ We introduce x33 as a basic variable and
determine its nonnegative value θ from the
tableau
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ Consequently, x14 leaves the basis and x33

enters the basis with the value 1

‰ We obtain the adjacent basic feasible solution in


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

3 power plants are used to supply the demand of

4 cities

‰ The supplies available from the 3 plants are given

‰ The demands of the 4 cities are specified

‰ The costs of supplying each 10 6 kWh are given


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

and so we have a balanced transportation

problem

‰ We find a basic feasible solution using the

least-cost rule
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

ELECTRICITY ALLOCATION EXAMPLE:


SOLUTION
to city supplies
from (10 6 kWh)
1 2 3 4
1 0 35
8 6 10 9
2 0 50
plant
9 12 13 7
3 30 10
40
14 9 16 5
demands 45 20 30 30 125
(10 6 kWh)
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

28
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION

‰ And we set

x34 = 30 , x14 = x24 = 0

and remove column 4 from further consideration

‰ We continue with the reduced system

ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

ELECTRICITY ALLOCATION EXAMPLE:


SOLUTION
to city supplies
from (10 6 kWh)
1 2 3
1 20 15
35
8 6 10
2 0 50
plant
9 12 13
3 0 10
14 9 16
demands 45 20 30
(10 6 kWh)
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

29
ELECTRICITY ALLOCATION EXAMPLE:
SOLUTION

and so we set

x12 = 20 , x22 = x32 = 0

and remove column 2 from further consideration

‰ The new reduced system obtains

ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

ELECTRICITY ALLOCATION EXAMPLE:


SOLUTION
to city supplies
from (10 6 kWh)
1 3
1 15 0 15
8 10
2 50
plant
9 13
3 10
14 16
demands 30
45 30
(10 6 kWh)
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

and remove row 1 from further consideration

‰ The operation is repeated for the further reduced

system
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

ELECTRICITY ALLOCATION EXAMPLE:


SOLUTION
to city supplies
from (10 6 kWh)
1 3

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

and therefore we set

x21 = 30 , x31 = 0

and remove column 1 from further consideration

‰ We are finally left with


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

ELECTRICITY ALLOCATION EXAMPLE:


SOLUTION
to city supplies
(10 6 kWh)
from 3

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

‰ The basic feasible solution has the costs

Z = 30 · 5 + 20 · 6 + 15 · 8 + 30 · 9 + 20 · 13 + 10 · 16 = 1080

‰ We improve this solution by using the u - v


scheme

‰ The first tableau corresponding to the initial


basic feasible solution is:
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

ELECTRICITY ALLOCATION EXAMPLE:


SOLUTION
to city supplies
from
3 4 (10 6 kWh)
1 2
1 15 20 35
8 6
plant

2 30 20 50
9 13
3 10 30 40
16 5
demands 45 20 30 30
(10 6 kWh)
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

‰ We bring x13 into the basis and determine the

value of θ using the tableau structure

‰ From the tableau we conclude that

θ = min { 15, 20 } = 15

and therefore x11 leaves the basis


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

and the new value of Z is

Z = 20 · 6 + 15 · 10 + 45 · 9 + 5 · 13 + 10 · 16 + 30 · 5

= 1050 < 1080

‰ We again pursue u-v improvement and start with


the tableau
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ The nonstandard transportation problem arises

when supply and demand are unbalanced: either

supply exceeds demand or vice versa

‰ The approach is to create a fictitious entity and

thereby restore the problem to balanced status


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

and the problem is then in standard form with


j = 1,ECE… , n+1
307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ For the overdemand case, we introduce the

fictitious warehouse Wm+1 to supply the

⎡ n m ⎤
shortage ⎢ ∑ b j − ∑ ai ⎥ ; we set cm+1, j = 0
⎢⎣ j =1 i =1 ⎥ ⎦

for j = 1, 2, …, n and the problem is in standard

form with i = 1,…, m + 1


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

39
NONSTANDARD TRANSPORTATION
PROBLEM
‰ Note that the variable xm+1, j is the shortage at

market j and is the shortfall in the demand bj

experienced by the market Mj due to inadequate

supplies

‰ For each market j , xm+1, j is a measure of the

infeasibility of the problem


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE: CANNING OPERATIONS


SCHEDULING
‰ This problem is concerned with the schedule of
2 plants A and B in the purchase of the raw
supplies from 3 growers

grower availability (ton) price ( $ / ton )

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.

EXAMPLE: CANNING OPERATIONS


SCHEDULING
‰ The plants’ labor costs and capacity limits are
plant A B

capacity 450 550


( ton )

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.

EXAMPLE: CANING OPERATIONS


SCHEDULING
‰ The objectives is formulated as
⎡ ⎤ ⎡ ⎤
max Z = ⎢ 50 − 25 − 10 − 2 ⎥ x ⎢ − 9 −
1 ⎥ xJA
⎢ 
⎥ SA + ⎢ 
50 − 25

⎣ 13 ⎦ ⎣ 15 ⎦

⎡ ⎤ ⎡ ⎤
+ ⎢ 
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

xJA + xJB ≤ 300

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.

EXAMPLE: CANING OPERATIONS


SCHEDULING

‰ Clearly, all decision variables are nonnegative

‰ The unbalanced nature of the problem requires

the introduction of a fictitious grower F with the

supply 100 corresponding to the supply shortage

‰ We set up the standard transportation problem


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.

EXAMPLE: CANNING OPERATIONS


SCHEDULING

‰ Please note that the objective is a maximization

rather than a minimization

‰ As a homework exercise, show that the duality

complementary slackness conditions allow us to

change the u-v algorithm in the following way:


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

‰ We construct the u - v relations for this solution

u1 + v1 = 13 u2 + v2 = 19.5

u2 + v1 = 15 u3 + v2 = 19

u4 + v2 = 0

‰ We arbitrarily set u1 = 0 and compute

v1 = 13, u2 = 2, v2 = 17.5, u3 = 1.5, u4 = – 17.5


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE SOLUTION
‰ We evaluate the cij corresponding to the

nonbasic variables

c31 = c31 − ( u3 + v1 ) = 12 − (1.5 + 13) = − 2.5

c41 = c41 − ( u4 + v1 ) = 0 − ( − 17.5 + 13) = 4.5

c12 = c12 − ( u1 + v2 ) = 17.5 − (0 + 17.5) = 0


single possible improvement
‰ Thus, x41 enters the basis and we determine θ
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

θ = min { 250, 100 } = 100

and so the adjacent basic feasible solution is

x11 = 200, x21 = 150, x41 = 100, x22 = 150, x32 = 400

‰ We repeat the u - v procedure to obtain


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

47
EXAMPLE SOLUTION

u1 + v1 = 13 u2 + v2 = 19.5

u2 + v1 = 15 u3 + v2 = 19

u4 + v1 = 0

‰ We solve by arbitrarily setting u1 = 0 and obtain

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

‰ We compute the cij for the nonbasic variables

c12 = 17.5 − ( 0 + 17.5) = 0

c31 = 12 − (1.5 + 13) = − 2.5

c42 = 0 − ( − 13 + 17.5) = − 4.5

ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

48
EXAMPLE SOLUTION

‰ Since each cij is ≤ 0 no more improvement in

the maximization is possible and so the

maximum profits are

Z = (200)13 + (150)15 + (100)0 +(150)19.5 + (400)19

= 15,375 $

ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

SCHEDULING PROBLEM AS A STANDARD


TRANSPORTATION PROBLEM
‰ The problem is concerned with the weekly
production scheduling over a 4-week period
 production costs from each item
first two weeks $ 10

last two weeks $ 15

 demands that need to be met are


week 1 2 3 4

demand 300 700 900 800

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.

SCHEDULING PROBLEM AS A STANDARD


TRANSPORTATION PROBLEM
mkt. 1 2 3 4 F supply
production
M is a very large number
1 700
10 13 16 19 0
normal 700
M 10 13 16 0
2 o/t 200
M 15 18 21
3200
normal 700
M M 15 18 0
3 o/t 200
M M 203200 - 23 0
2700 2700
4 700
M M M 15 0
demand 300 700 900 800 500
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

‰ The brute force approach is simply enumeration:

consider n = 10 and there are 3, 628, 800 possible

choices

‰ We can, however, introduce categorical decision

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

‰ The objective, then, is


n n
min Z = ∑∑ cij xij
i =1 j =1
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

ASSIGNMENT PROBLEM

‰ This assignment problem is a standard

transportation problem with

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

‰ We may convert this into an equivalent standard

assignment problem with equal number of

machines and jobs

‰ The conversion requires the introduction of

either fictitious jobs or fictitious machines


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

NONSTANDARD ASSIGNMENT
PROBLEM
‰ In the case m > n :

we create ( m – n ) fictitious jobs and we have


m machines and n + m – n = m jobs; we
assign the machinery costs for the fictitious
goods to be 0 : note that there is no change
in the objective function since a fictitious job
assigned to a machine is, in effect, a
machine that is idle
ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

53
NONSTANDARD ASSIGNMENT
PROBLEM

‰ For the case n > m :

we create ( n – m ) fictitious machines with

machine costs of 0 and the solution

obtained has the ( n – m ) jobs that cannot be

done due to lack of machines


ECE 307GG © 2005 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ We consider the shipment of a certain homo-


geneous commodity from a specified point or
source to a particular destination or sink
‰ In general, the source and the sink need not be
directly connected; rather, the flow goes through
the transshipment points or intermediate nodes
‰ The objective is to determine the maximal flow
from the source to the sink
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

 nodes 1, 2, 3, 4 and 5 are the transshipment


points
 arcs of the network are ( s, 1 ), ( s, 2 ), ( 1, 2 ),
( 1, 3 ), ( 2, 5 ), ( 3, 4 ), ( 3, 5 ),( 4, 5 ), ( 5, 4 ) ( 4, t ),
( 5, t ) ; the existence of an arc from 4 to 5 and
from 5 to 4 allows bidirectional flows between
the two nodes
 each arc may be constrained in terms of a
limit on the flow through the arc
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

2
MAX FLOW PROBLEM

‰ We denote by fij the flow from i to j and this


equals the commodity amount shipped from i
to j on an arc (i , j) that directly connects the
nodes i and j
‰ The problem is to determine the maximal flow f

from s to t taking into account the flow limits kij

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 FLOW PROBLEM

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

‰ While the simplex approach can solve the max

flow problem, it is possible to construct a highly

efficient network method to find f directly

ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

NETWORK DEFINITIONS

‰ Each arc is directed and so for an arc (i, j), fij ≥ 0


‰ A forward arc at a node i is one that leaves
node i to some node j and is denoted by (i, j)
‰ A backward arc at node i is one that enters
node i from some node j and is denoted by (j, i)
‰ A path connecting node i to node j is a
sequence of arcs starting at node i and
terminating at node j
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

4
NETWORK DEFINITION

 we denote a path by

P = { ( i, k ), ( k, l ), …, ( m, j ) }

 in the example network

( 1, 2 ), ( 2, 5 ), ( 5, 4 ) is a path from 1 to 4

( 1, 3 ), ( 3, 4 ) is another path from 1 to 4

‰ A cycle is a path with i = j , i.e.,

P = { ( i, k ), ( k, l ), …, ( m, i ) }
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

NETWORK DEFINITION

‰ We denote the set of nodes of the network by N

 the definition is

N = { i : i is a node of the network }

 In the example network

N = { s , 1, 2, 3, 4, 5, t }
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

5
NETWORK CUT

‰ A cut is a partitioning of nodes into two distinct


subsets S and T with
N = S ∪ T and S ∩ T = φ
‰ We are interested in cuts with the property that
s ∈ S and t ∈ T
 the sets S and T are said to provide an s - t
cut
 in the example network,
S = { s, 1, 2 } and T = { 3, 4, 5, t }
provide an s - t cut
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

NETWORK CUT

‰ The capacity of a cut is


Κ (S ,T ) = ∑ kij
i ∈S
j∈T
‰ In the example network with
S = { s, 1, 2 } and T = { 3, 4, 5, t }
we have
Κ (S , T ) = k13 + k25
but for the cut with
S = {s, 1, 2, 3, 4 } and T = { 5, t }
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ An important characteristic of the s - t cuts of

interest is that if all the arcs in the cut are


removed then no path exists from s to t

‰ Consequently no flow is possible since any flow


from s to t must go through the arcs in a cut and
thus the flow is limited by the capacity of the cut
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

NETWORK CUT LEMMA

‰ Lemma: for any directed network the flow f

from s to t is constrained by an s to t cut

f ≤ Κ (S , T ) for any cut S , T

‰ Clearly, this lemma implies that

max flow ≤ Κ (S , T ) ∀ S , T

and consequently

max flow ≤ min Κ (S , T )


S ,T

ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

7
MAX FLOW MIN CUT THEOREM

‰ For any network, the value of the maximal flow

from s to t is equal to the minimal cut, i.e., the


cut S , T with the smallest capacity

‰ The max-flow min-cut theorem allows us, in

principle, to find the maximal flow in a network

by finding the capacities of all the cuts and

choosing the minimum capacity cut


ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

MAX FLOW

‰ The maximal flow algorithm is based on finding


a path through which a positive flow from s to t
can be sent, the so called flow augmenting
path; the procedure is continued until no such
flow augmenting path can be found and
therefore we have the maximal flow

‰ The labeling procedure is used to find a flow


augmenting path from s to t
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

8
LABELING PROCEDURE

Step 0 : start with node s


Step 1 : label node j : node j can be labeled if
and only if flow can be sent from s to t ;
we label node j given that node i is
labeled only if
(i) either there exists an arc (i, j) and
fij < kij
(ii) or there exists an arc ( j, i ) and
fji < 0
Step 2 : if j = t , stop; else, go to Step 1
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

THE MAX FLOW ALGORITHM


Step 0 : start with a feasible flow
Step 1 : use the labeling procedure to find a flow
augmenting path
Step 2 : determine the maximum value δ for the
max increase (decrease) of flow on all
forward (backward) arcs
Step 3 : use the labeling procedure to find a flow
augmenting path; if no such path exists,
stop; else, go to Step 2
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

9
EXAMPLE APPLICATION

‰ Consider the simple network with the flow


capacities on each arc indicated

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

‰ We initialize the network with a flow 1


f = 1

(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

‰ We apply the labeling procedure


f = min { 6, 2, 7 } = 2

6 1

s 2 t

7
2

ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE APPLICATION

‰ Consider the simple network with the flow


capacities on each arc indicated f = 3

(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

‰ We repeat application of the labeling procedure

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

‰ We increase the flow by 5


f = 8

(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

‰ We repeat application of the labeling procedure

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

‰ We increase the flow by 4


f = 12

(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

‰ We repeat application of the labeling procedure

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

‰ We increase the flow by 3


f = 15
(7,7) 1 (7, 9)

s (0, 3)
t

(8, 9) (8, 8)
2

no possibility of flow augmenting path


ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ The procedure is to replace each undirected arc


by two directed arcs ( i, j ) and ( j, i ) to deter-
mine the maximal s – t flow
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE OF A NETWORK WITH


UNDIRECTED ARCS
‰ Consider the network with the three unrestricted
arcs

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.

EXAMPLE OF A NETWORK WITH


UNDIRECTED ARCS

(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

and so the maximum flow is 30 + 30 + 10 = 70


one way signs should be put from 1 4 and 4 3
an alternative routing of a flow of 10 is the path
s 1 2 4 3 t which would require one
way signs from 1 2 and 4 3
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

NETWORKS WITH MULTIPLE


SOURCES AND MULTIPLE SINKS

‰ We next consider a network with several supply

and several demand points

‰ We introduce a super source ŝ linking to all the

sources and a super sink t̂ linking all the sinks

‰ We can consequently apply the max flow

algorithm to the modified network


ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

MULTIPLE SOURCE / MULTIPLE SINK


NETWORK EXAMPLE
15 sink with
2 5 demand 15
10 sink with
5
10 5 demand 20

1 3 5 6 10 8
20

5 5
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.

MULTIPLE SOURCE / MULTIPLE SINK


NETWORK EXAMPLE
‰ The transshipment problem is feasible if and

only if the maximal sˆ − t̂ flow f satisfies

f = ∑
sinks
demands

‰ Show that the transshipment problem is infeas-

ible since the network cannot accommodate the

total demand of 35 ; also determine the small-

est shortage for this problem


ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

MULTIPLE SOURCE / MULTIPLE SINK


NETWORK EXAMPLE

‰ The minimum cut is shown and has capacity

15 + 5 + 5 + 5 = 30

and the maximum flow is, therefore, 30

‰ Since the maximum flow fails to meet the total

demand of 35 units, the problem is infeasible;

the minimum shortage is 5


ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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:

 the company has only 4 engineers

 at most 2 engineers may be assigned to any


one project in a given month

 no engineer maybe assigned to more than


one project at any time

‰ The question is whether there is a feasible


assignment
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ The transshipment problem is feasible if the total

demand 6 + 8 + 3 + 4 = 21 can be met

‰ As a homework problem, determine whether a

feasible schedule exists and if so, find it


ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

SHORTEST ROUTE PROBLEM


‰ The problem is to determine the shortest path
from s to t for a network with a set of nodes
N = { s = 1, 2, …, n = t }
and arcs ( i, j ) where for each arc ( i, j ) of the
network
dij = distance or transit time
‰ The determination of the shortest path from 1 to
n requires the specification of the path
{ ( 1, i1 ) , ( i1, i2 ) , …, ( iq , n ) }
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

25
SHORTEST ROUTE PROBLEM

‰ We can write an LP formulation of this problem in


the form of a transshipment problem:

ship 1 unit from node 1 to node n by


minimizing the shipping costs given the
parameters

dij = shipping costs for 1 unit from i to j ;


for i and j are not directly connected,

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

‰ The assumptions are

 dij is given for each pair of nodes

 dij ≥ 0

‰ The scheme is basically a label assignment


procedure, which assigns nodes with either a
permanent or a temporary label
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

26
DIJKSTRA’S ALGORITHM

‰ The temporary label of node i is the upper

bound on the shortest distance from node 1 to

node i

‰ The permanent label is the actual shortest

distance from node 1 to node i


ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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 ⎪⎭

Step 3 : select the smallest of the temporary labels


and declare it permanent ; in case of ties,
the choice is arbitrary
Step 4 : if this is node n , stop; else, go to Step 2
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

DIJKSTRA’S ALGORITHM

‰ The shortest path is obtained by retracing the

sequence of permanently labeled nodes back

from n to the node 1

‰ The path is then given in the forward direction

ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

28
EXAMPLE : SHORTEST PATH

‰ Consider the undirected network


9
2 6
3 6
2

1 7 3 3

1 3
4
4 5
3
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE : SHORTEST PATH

‰ The problem is to

 find the shortest path from 1 to 6

 compute the length of the shortest path

‰ We apply the Dijkstra algorithm and assign

successively a permanent label to each node


ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

29
EXAMPLE : SHORTEST PATH

0
3,7,4,∞ ,∞ ⎤⎦
Steps 0 and 1 : L (0 ) = ⎡⎣0 ,,3,7,4,
1

Steps 2 : L (1) = 3, 5, 4, ∞ ,12 ⎤⎦


⎡0 ,,3,5,4,

2

Steps 2,3 and 4 : L (2) = ⎡0 ,3,5,4,7,12



, 3, 5, 4,7,12⎤⎦
3
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE : SHORTEST PATH

Steps 2,3 and 4 : L (3) = ⎡0 ,,3,5,4,7,11



3, 5, 4, 7,11⎤⎦
4

Steps 2,3 and 4 : L (4) = ⎡0 ,,3,5,4,7,10



3, 5, 4, 7,10⎤⎦
5

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:

pick node j preceding node n as the node


with the property

permanent label of shortest


+ djn =
node j distance

‰ In the retracing scheme, certain nodes may be


skipped
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

31
SHORTEST PATH BETWEEN ANY TWO
NODES

‰ Dijkstra’s algorithm may be applied to

determine the shortest distance between any

pair of nodes i , j by taking i as the source

and j as the sink

‰ Consider as an example the following five node

network
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE : PATH RETRACING

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.

EXAMPLE : SHORTEST PATH

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

and so the path is


0 →2→4
gives the shortest distance from 0 to every other
node
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ As equipment ages, the level of maintenance


required increases and typically, this results in
increased operating costs

‰ O&M costs may be reduced by replacing aging


equipment; however this increases capital
investment costs
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

34
APPPLICATION : EQUIPMENT
REPLACEMENT PROBLEM

‰ The problem is how often to replace equipment

in order to minimize

total capital O&M


= +
costs costs costs

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

where, the “distances” dij are defined to be


finite if i < j , i.e., year i precedes the year j ,
with
j−i
d ij = pi − s j−i + ∑ cτ
τ =1
j > i
 

purchase salvage value O&M costs


price in after j – i for j - i years
year i years of use of operation
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

36
APPPLICATION : EQUIPMENT
REPLACEMENT PROBLEM
‰ For example, if the purchase is made in year 1
5
d16 = p1 − s5 + ∑c
τ =1
τ

‰ The solution is the shortest distance path from


year 1 to year 6 ; if for example the path is
{ ( 1, 2) , (2, 3) , (3, 4) , (4, 5) , (5, 6) }
then the solution is interpreted as the replace-
ment of the equipment each year with
5
total costs = ∑
i =1
pi − 5 s1 + 5c1
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

COMPACT BOOK STORAGE IN A


LIBRARY
‰ This problem concerns the storage of books in a
limited size library

‰ Books are stored according to their size, in


terms of height and thickness, with books
placed in groups of same or higher height; the
set of book heights { Hi } is arranged in
ascending order

H1 < H2 < … < Hn


ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

37
COMPACT BOOK STORAGE IN A
LIBRARY
‰ Any book of height Hi may be shelved on a
shelf of height ≥ Hi

‰ The length Li of shelving required for height


class i is computed given the thickness of each
book; the total shelf area required is ∑i H i Li

if only 1 height class [ corresponding to the


tallest book ] exists, total shelf area required
is the total length of the thickness of all
books times the height of the tallest book
ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

COMPACT BOOK STORAGE IN A


LIBRARY
 if 2 or more height classes are considered,
the total area required is less than the total
area required for a single class

‰ The costs of construction of shelf areas for each


height class Hi have the components

si fixed costs [ independent of shelf area ]

ci variable costs / unit area


ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

COMPACT BOOK STORAGE IN A


LIBRARY
‰ The problem is to find the set of shelf heights and
lengths to minimize the total shelving costs

‰ The solution approach is to use a network flow


model for a network with the

 set of n + 1 nodes
N = { 1, 2, . . . , n }
corresponding to the n + 1 book heights with

1 ↔ H1 < H2 < … < Hn ↔ n


ECE 307© 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

39
COMPACT BOOK STORAGE IN A
LIBRARY

 directed arcs ( i , j ) only if j > i resulting in

a total of n ( n + 1) arcs
2

 “distance” dij on each arc given by

⎧ 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.

COMPACT BOOK STORAGE IN A


LIBRARY
‰ For this network, we solve the shortest route

problem for the specified “distances” dij

‰ Suppose that for a problem with n = 17 , we

determine the optimal trajectory to be

{ ( 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

© 2006 University of Illinois Board of Trustees, All Rights Reserved


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

DYNAMIC PROGRAMMING

‰ Multi-step problem solving technique

‰ Systematic approach to sequential decision

making

‰ Key characteristic: ability to to separate

problem into stages


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

1
STAGES AND STATES

‰ We consider the problem to be composed of


multiple stages
‰ A stage is the point in time, space, geographic
location or structural element at which we make
a decision; this point is associated with a
number of states
‰ A state of the system describes a possible
configuration of the system at a given stage
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

ROAD TRIP EXAMPLE

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

stage 1 stage 2 stage 3 stage 4 stage 5


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

4
ROAD TRIP

‰ The student wishes to minimize the number of


miles driven and so he wishes to determine the
shortest path between NY and LA
‰ To solve the problem, he works backwards
‰ We adopt the following notation
cij = distance between states i and j
fk( i ) = distance of the shortest path to
LA from state i in stage k
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

ROAD TRIP EXAMPLE CALCULATIONS

stage 4 : f 4 (8) = 1030 f 4 (9) = 1390

⎧ ⎫
⎪ ⎪
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.

ROAD TRIP EXAMPLE

‰ The shortest path is 2,870 miles and corresponds


to the trajectory { (1, 2) , ( 2, 5 ) , ( 5, 8 ) , ( 8, 10 ) } ,
i.e., from New York, the student reaches
Columbus on the first day, Kansas city on the
second day, Denver the third day and then Los
Angeles
‰ Any other trajectory to LA leads to higher costs
and so is, by definition, suboptimal
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

‰ Each player can pick up 1, 2, or 3 matches and

continue until the last match is picked up

‰ The loser is the person who picks up the last

match

‰ How can the player P1 who goes first ensure a

win?
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

WORKING BACKWARDS: PICK UP


MATCHES GAME

‰ We solve this problem by reasoning in a back-

wards fashion so as to ensure that when a

single match remains, P2 has the turn

‰ Consider the situation where 5 matches remain

and it is P2’s turn; for P1 to win we, consider all

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.

OIL TRANSPORT TECHNOLOGY

‰ We consider the development of a transport


network from north slope of Alaska to one of 6
possible shipping points in the U.S
‰ The network must meet the problem feasibility
requirements
 7 pumping stations from a north slope
ground storage plant to a shipping port
 use of only those paths that are physically
and environmentally feasible
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.

OIL TRANSPORT TECHNOLOGY

‰ Objective: determine a feasible pumping

configuration that minimizes the

construction costs of branches


total
= of network of the feasible
costs
pumping configuration

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.

OIL TRANSPORT TECHNOLOGY

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.

OIL TRANSPORT TECHNOLOGY :


DP SOLUTION
‰ The return function is defined as the costs
associated with the decision at the state
dk ↔ rk ( sk , d k )
‰ The transition function is the total costs in
proceeding from one stage to another
‰ We proceed to solve the problem by moving
backwards from each final state to the states in
the previous stage
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

‰ For the last stage


I-A I-B I-C I-D I-E

f 8* ( s8 ) = min{27 + 6, 26 + 4, 25 + 7, 25 + 8, 27 + 3 }
= 30

‰ To find trajectory we retrace forwards through

the stages 7, 6, . . . , 1 and obtain


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

THE OPTIMAL TRAJECTORY

d8=L d7=R d6=F d5=R d4=R d3=R d2=F

oil
storage
I II III VI V VI VII
B A A B C D D

‰ In addition to this optimal solution, others are

possible since the path need not be unique


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

OIL TRANSPORT PROBLEM


SOLUTION final destinations

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

‰ For example, we may calculate the least cost

optimal path to any sub optimal shipping point

different than D

‰ From the solution, we can also determine the

sub optimal path if the construction of a feasible

path is not undertaken


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

OIL TRANSPORT : SENSITIVITY CASE


‰ Consider the case where we got to stage VI but
the arc VI – D to VII – D cannot be built due to
some environmental intervention
‰ We determine, then, the least-cost path from VI –
D to find the final destination D whose value is 9
instead of 6

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

‰ A company is expanding to meet a wider market

and considers:

 3 location alternatives

 4 different building types (sizes) at each site

‰ Revenues and costs vary with each location and

building type
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

FACILITIES SELECTION

‰ Revenues R increase monotonically with

building size; these are net revenues or profits

‰ Costs C increase monotonically with building

size

‰ The data for building sizes, revenues and costs

are given in the table


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

19
FACILITIES SELECTION

building size
B1 B2 B3 B4 none

site
R1 C1 R2 C2 R3 C3 R4 C4 R0 C0

I 0.50 1 0.65 2 0.8 3 1.4 5 0 0

II 0.62 2 0.8 5 0.96 6 1.8 8 0 0

III 0.71 4 1.2 7 1.6 9 2 11 0 0

ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

THE FACILITIES SELECTION PROBLEM

‰ The company can afford to invest at most 21

million $ in the total expansion project

‰ Determine the optimal expansion policy, i.e., the

buildings to be built at each site


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

20
DP SOLUTION APPROACH

‰ We use the DP approach to solve this problem;

first, however, we need to define the DP

parameters

‰ For the facilities siting problem we realize that

without the choice of a site, the building type is

irrelevant and so the elements that control the

entire decision process are building sites


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ The amount of funds available is unknown since


the decision at sites II and III are assumed to
have been previously made, but, clearly,
0 ≤ s1 ≤ 21
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

DP SOLUTION : STAGE 2 SITE II

‰ The amount of funds s2 available is unknown

since the decision at site III is assumed to have

been already made

‰ The value of d2 is a function of s2 and we

construct a decision table using

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

15 3.2 3.31 3.22 3.06 3.27 1 3.31

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:

 8 rolls of 2 ft paper at 2.50 $/roll

 6 rolls of 2.5 ft paper at 3.10 $/roll

 5 rolls of 4 ft paper at 5.25 $/roll

 4 rolls of 3 ft paper at 4.40 $/roll

‰ The company only has 13 ft of paper to fill these


orders; partial orders can be filled

‰ Determine how to fill orders to maximize profits


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

DP SOLUTION APPROACH
‰ A stage is an order and since there are 4 orders
we construct a 4 – stage DP
d4 d3 d2 d1

s4 stage s3 stage s2 stage s1 stage


4 3 2 1

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 )

F0 = length of available paper ( ft )


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

and s0 should be as close as possible to 0

⎡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

‰ Arbitrary order of the stages and we pick

stage n 1 2 3 4
length of
2.5 4 3 2
order ( ft )

‰ We proceed backwards from stage 1 to stage 4

and we know that


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ The maximum profits are $18.45

‰ The optimal solution is obtained by retracing

f 4* ( s4 = 13) = 18.45 with d 4* = 0 ↔ no rolls of 2 ft

f 3* ( s3 = 13) = 18.45 with d 3* = 3 ↔ 3 rolls of 3 ft

f 2* ( s2 = 4) = 5.25 with d 2* = 1 ↔ 1 roll of 4 ft

f 1* ( s1 = 0 ) = 0 with d 1* = 0 ↔ no rolls of 2.5 ft

ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

SENSITIVITY CASE

‰ Consider the case that due to an incorrect

measurement, in truth, there are only 11 ft

available for the rolls

‰ We note that the solution for the original 13 ft

covers this possibility in the stages 1, 2 and 3 but

we need to recompute the results of stage 4,

which we now call stage 4′


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

32
SENSITIVITY CASE : STAGE 4′

‰ The stage 4′ computations become

⎡ 11 ⎤
d 4′ ≤ ⎢ ⎥ = 5
⎣2⎦

d 4′ 0 1 2 3 4 5 d 4*′ f 4*′ ( s4 )

s4 = 11 15 15.7 14.65 13.7 14.4 12.5 1 15.7

ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

SENSITIVITY CASE OPTIMUM

‰ The optimal profits in this sensitivity case are

$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

‰ Note that no additional work is needed since the


computations in the first tables have all the
necessary data
‰ This sensitivity case optimum profits are $18.2
‰ The optimum solution is :
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

OPTIMAL CUTTING STOCK PROBLEM

f 4*′′ ( s4 = 13) = 18.2 with d 4*′′ = 2 ↔ 2 rolls of 2 ft


f 3*′′ ( s3 = 9) = 13.2 with d 3*′′ = 3 ↔ 3 rolls of 3 ft

and since s2 = s1 = 0
d 2*′′ = 0 ↔ 0 rolls of 4 ft
d 1*′′ = 0 ↔ 0 rolls of 2.5 ft

‰ The constraint reduces optimum from $ 18.45 to

$18.2 and so it costs $ .25

ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

34
INVENTORY CONTROL PROBLEM

‰ This problem is concerned with the development

of an optimal ordering policy for a retailer

‰ The sales of a seasonal item has the demands

month Oct Nov Dec Jan Feb Mar

demand 40 60 30 40 30 20

ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

INVENTORY CONTROL PROBLEM

‰ All units sold are purchased from a vendor at

4 $/unit `; units are sold in lots of 10, 20, 30, 40 or

50 with the corresponding discount

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

‰ We formulate the problem as a DP and use a

backward process

‰ Each stage corresponds to a month

month Oct Nov Dec Jan Feb Mar

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

s6 stage s5 stage s4 stage s3 stage s2 stage s1 stage s0


6 5 4 3 2 1

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

φ (d n ) 0 48 86 118 138 160

‰ In the DP approach, at each stage we minimize

{
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 ⎭

f 1* ( s1 ) = min{ φ (d1 ) + 0 } = φ (d1* )


d1

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 )

f6(s6) 606 608 40 606

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 *5 = 50 which corresponds to s4 = 30 and costs 468

d *4 = 0 which corresponds to s3 = 0 and costs 414

d *3 = 40 which corresponds to s2 = 0 and costs 302

d *2 = 50 which corresponds to s1 = 20 and costs 164

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

r6 (40,0) r4 (0,30) r2 (50,0)


= 138 r5 (50,0) =0 r3 (40,0) = 164 r1 (0,20)
= 166 = 138 =0

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

with total costs

0 + 164 + 138 + 0 + 166 + 138 = 606


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

MUTUAL FUND INVESTMENT


STRATEGIES
‰ We consider a 5-year investment of

 10 k$ invested in year 1

 1 k$ invested in each year 2, 3, 4 and 5

into 2 mutual funds with different yields for


both the short-term (1 year) and the long-term
(up to 5 years)

‰ A decision at the beginning of each year is the


allocation of investment in each fund
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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.

MUTUAL FUND INVESTMENT


STRATEGIES
‰ The earnings on the investment are

 LTD : the long-term dividend specified as


% return / year on the accumulated capital

 STD : the short-term interest dividend is the


cash returned to the investor at the end of
the period; cash may be reinvested and any
money not invested in one of the funds earns
nothing
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

44
MUTUAL FUND INVESTMENT
STRATEGIES

STD rate in for year n


LTD
fund
1 2 3 4 5 rate I

A 0.02 0.0225 0.0225 0.025 0.025 0.04

B 0.06 0.0475 0.05 0.04 0.04 0.03

ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

DP SOLUTION APPROACH

‰ We use backwards DP to solve the problem

‰ The stages are the 5 investment periods

stage n Δ year 6 − n n = 1,2,3,4,5


r5 r4 r3 r2 r1

s5 stage s4 stage s3 stage s2 stage s1 stage s0


5 4 3 2 1

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

‰ The decision dn is the amount of capital


invested in fund A in year 6 – n ; the amount of
capital invested in fund B in the year 6 – n is
therefore sn – dn

‰ In each year, we need to determine the amount


to invest in each fund
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ We express all returns in end of the year 5


dollars : rn is the future value of long term
earnings in the years 1, 2, 3 and 4
rn = (1 + I A )n d n + (1 + I B )n ( sn − d n ) n = 1, ... ,5
‰ But for n = 1, r1 is the present value of all earn-
ings in stage 1
r1 = (1 + I A ) d1 + (1 + I B ) ( s1 − d1 ) + i A d1 + i B ( s1 − d1 )
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ r4 = returns realized at the end of 5 years due to


the decision d4

= 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

= d 5 ⎡⎣1.045 − 1.035 ⎤⎦ + s5 (1.03)5

s5 = 10,000 ← capital available for investment

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

‰ Many problems in probability theory can be

solved by simply counting the number of ways a

certain event may occur

‰ We review some basic aspects of combinatorial

analysis

 combinations

 permutations
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

1
BASIC PRINCIPLE OF COUNTING

‰ Suppose that two experiments are to be


performed:
 experiment 1 may result in any one of the m
possible outcomes
 for each outcome of experiment 1, there exist
n possible outcomes of experiment 2
‰ Therefore, there are mn possible outcomes of the
two experiments
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

BASIC PRINCIPLE OF COUNTING


‰ The basic principle is easy to prove by
exhaustive enumeration
(1, 1), (1, 2), (1, 3), ... (1, n)
(2, 1), (2, 2), (2, 3), ... (2, n)
.
.
.
(m, 1), (m, 2), (m, 3), . . . (m, n)
where, (i , j) is the notation we use to refer to
outcome i in experiment 1 and outcome j in
experiment 2
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

2
EXAMPLE 1 : PAIR FORMATION

‰ Pairs need to be formed consisting of 1 boy and

1 girl by choosing from a group of 7 boys and 9

girls

‰ There exist (7)(9)= 63 possible pairs since there

are 7 ways to pick a boy and 9 ways to pick a girl


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

GENERALIZED VERSION OF THE


BASIC PRINCIPLE
‰ For r experiments with the first experiment
having n1 possible outcomes; for every outcome
of the first experiment, there are n2 possible
outcomes for the second experiment, and so on
.......
1
2
2
. .......
n1 . 2
1 .
.......
2
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

3
GENERALIZED VERSION OF THE
BASIC PRINCIPLE
‰ There are

r
Π ni = n1 ⋅ n2 ⋅ n3 ...... ⋅ nr
i =1

possible outcomes for the r experiments, i.e.,

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

‰ Number of combinations with repeats allowed is

(26) (26) (26) (10) (10) (10) = 17,576,000

‰ Combination number if no repetition allowed is

(26) (25) (24) (10) (9) (8) = 11,232,000


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE 4 : n POINTS

‰ Consider n points at which we evaluate the

function

f ( i ) ∈ {0 ,1} i = 1,2,...., n

‰ Therefore, there are 2n possible function values


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ Therefore, there are 3 ⋅ 2 ⋅ 1 = 6 ways to arrange

the 3 elements

‰ In general, a set of n objects can be arranged

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

‰ Suppose that the team, however, has altogether


12 members; the number of possible batting
orders is the product of the number of team
formations and the number of permutations is
12! 12!
i 9! = = 2(11!) = 79,833,600
3! 9! 3!
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ A student has 10 books to put on the shelf:

4 EE, 3 Math, 2 Econ, and 1 Decision

‰ Student arranges books so that all books in

each category are together

‰ There are 4!3!2!1! arrangements so that all EE

books are first in line, then the Math books, Econ

books, and Decision book


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE 8 : BOOKS
‰ But, there are 4! possible orderings of the

subjects

‰ Therefore, there are

4!4!3!2!1! = 6912

permutations of arranging the 10 books


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

8
EXAMPLE 9 : PEPPER

‰ We wish to determine the number of different

letter arrangements in the word PEPPER

‰ Consider first the letters P1 E1 P2 P3 E2 R where we

distinguish the repeated letters among

themselves: there are 6! permutations of the 6

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.

EXAMPLE 9 : COLORED BALLS

‰ We have 3 white, 4 red, and 4 black balls which

we arrange in a row; similarly colored balls are

indistinguishable from each other

‰ 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

‰ Given n objects, we form groups of r objects


and establish the number of different groups
we can form

‰ For example, consider 5 objects denoted as


A,B,C,D and E and form groups of 3 objects;

we can pick the first item in exactly 5 ways

we can pick the second item in exactly 4 ways

we can pick the third item in exactly 3 ways


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

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

‰ We define the term

⎛ n⎞ n!
⎜r ⎟ ( n − r )! r !
⎝ ⎠

as the binomial coefficient of n and r

‰ A binomial coefficient gives the number of

possible combinations of n elements taken r at

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

possible committee selections


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE 11 : GROUP FORMATION

‰ Given a group of 5 boys and 7 girls, form sets

consisting of 2 boys and 3 girls

‰ There are

⎛ 5⎞⎛ 7⎞ 5! 7 ! 5⋅4 7⋅6⋅5


⎜ 2 ⎟ ⎜ 3 ⎟ = 3!2! 4!3! = 2 ⋅
= 350
⎝ ⎠⎝ ⎠ 3 2

possible ways to form such groups


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

13
GENERAL COMBINATORIAL IDENTITY

⎛ n⎞ ⎛ n − 1⎞ ⎛ n − 1⎞
⎜ ⎟ = ⎜ ⎟ + ⎜ ⎟
⎝r ⎠ ⎝r −1⎠ ⎝ r ⎠

number of number of number of


ways of ways of ways of
selecting selecting selecting
groups of r groups of r – 1 groups of r
from n from n from n – 1
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

MULTINOMIAL COEFFICIENTS

‰ Given a set of n distinct items, form r distinct

groups of respective sizes n1, n2, . . . , and nr with


r

∑n
i =1
i = n

‰ There are
⎛n ⎞
⎜n ⎟
⎝ 1⎠

possible choices for the first group


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

14
MULTINOMIAL COEFFICIENTS

‰ For each choice of the first group, there are


⎛ n − n1 ⎞
⎜ ⎟
⎝ n2 ⎠
possible choices for the second group

‰ We continue with this reasoning and we

conclude that there are


n!
n1 ! n2 ! ... nr !
possible groups
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

MULTINOMIAL COEFFICIENTS

‰ The previous conclusion was gained by realizing


that
⎛ n ⎞ ⎛ n − n1 ⎞ ⎛ n − n1 − n2 ⎞ ⎛ n − n1 − n2 − . . . nr −1 ⎞
⎜ n ⎟⎜ n ⎟⎜ n ⎟ . . .⎜ ⎟=
⎝ 1 ⎠⎝ 2 ⎠ ⎝ 3 ⎠ ⎝ n r ⎠
n! (n − n1 )! n − n1 − n2 − ...nr −1
... =
(n − n1 )!n1! (n − n1 − n2 )!n2 ! 0 !nr !

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

we define the multinomial coefficient

⎛ n ⎞ n!
⎜ n ,n , . . . ,n ⎟
⎝ 1 2 r ⎠ n1 ! n2 ! n3 ! . . . nr !

‰ A multinomial coefficient represents the number

of possible divisions of n distinct objects into r

distinct groups of respective sizes n, n2, . . . , nr


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

EXAMPLE 12 : POLICE

‰ A police department of a small town has 10

officers

‰ The department policy is to have 5 members on

street patrol, 2 members at the station and 3 on

reserve

‰ The number of possible divisions is


10!
= 2,520
5!3!2!
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

16
EXAMPLE 13 : TEAM FORMATION

‰ We need to form two teams, the A team and the

B team, with each team having 5 boys from a

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.

EXAMPLE 13 : TEAM FORMATION

‰ Suppose that these two teams are to play


against one another
‰ In this case, the order of the two teams is
irrelevant since there is no team A and team B
per se but simply a division of 10 boys into 2
groups of 5 each
‰ The number of ways to form the two teams is
1 ⎛ 10! ⎞
⎜ ⎟ = 126
2! ⎝ 5!5! ⎠
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

17
EXAMPLE 14 : TEA PARTY

‰ A woman has 8 friends of whom she will invite 5

to a tea party

‰ How many choices does she have if 2 of the

friends are feuding and refuse to attend

together?

‰ How many choices does she have if 2 of her

friends will only attend together?


ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.

18

Вам также может понравиться