56:171 Operations Research
Instructor: Prof. Yong Chen
TA: Qingyu Yang
M/W/F 12:30 - 1:20
Fall 2005
1
• INSTRUCTOR—Yong Chen
- Background
- Availability
•
TEXT
- Text Book
- Lecture Notes
• COURSE
- Web site, Email list
- Computing
- Attendance Policy
- Prerequisites
- Grading Policy
• TA
•
Lab/Recitation
2
B. E. in computer science, Tsinghua
University, China, 1998
Ph. D., 2003, Industrial and Operations
Engineering, University of Michigan
Assistant professor, Dept. of Mechanical and Industrial Engineering, 2003—now
Research area: Quality and reliability engineering; Sensor system design and analysis
3
Basic linear algebra and calculus knowledge
Basic probability and statistics knowledge
Basic computing skills
4
How many “Yes” do you get?
Do you know how to solve a system of linear equations using Gaussian elimination?
Can you draw a line on x-y plane given its equation?
Do you know the meaning of convex and concave functions?
Can you calculate the first and second derivatives of a given function?
Do you know what is conditional probability?
Do you know what is probability density function?
Do you know the definition of expectation and variance of a random variable?
Do you know how to use Excel to do some simple calculation?
5
Attendance/participation 5%
Homework 20%
Exam 1
Exam 2
25%
25%
Exam 3 25%
- Grade for attendance is based on random quizzes in lectures and labs
- Homework should be submitted in-class on the due date;
No late homework is acceptable;
but one HW grade is not counted in the final grading.
6
Deterministic
Linear “programming”
Transportation models
Assignment models
Integer programming
Nonlinear programming
Network models
PERT/CPM
Stochastic
Markov chains
Queueing theory
7
What is Operations
Research?
From military: research on (military) operations
Today, operations research means a scientific approach to decision making, which seeks to determine how best to design and operate a system, usually under conditions requiring the allocation of scarce resources.
8
We all make decisions, all of the time
Day-to-day choices
Business decisions
Public policy decisions
Feasibility vs. optimality decisions
Easy vs. difficult
9
Course Selection Example
You have to decide your choice of courses for all the semesters that you are here
Your choices are restricted by a number of rules
You have to achieve a minimum number of credit hours
You have to take each of the required courses at some point during the program
10
Course Selection
Example, Cont.
You can take a course only if you have taken its pre-reqs
You can not take two courses with time conflict
You can not take more than a maximum number of credits each semester
You have to take enough GEC courses from specified categories
You have to satisfy the EFA requirements
You can not take classes before 9 because you hate getting up early
11
Course Selection Example,
Cont.
The rules limit the possible choices you have, but there are still a large number of choices!
How can you pick the “best” set of courses for yourself?
12
Course Selection Example,
Cont.
You need to decide your choice of courses
There are a large number of choices which satisfy the given rules
You need to find the courses that maximize some measure of your performance, e.g., expected GPA
This is an optimization problem
13
Another Example: The Diet
Problem
Given a collection of foods (e.g. milk, chocolate, orange juice, pizza), determine how much of each food to eat in a given day
Goal is to minimize cost or calories, or maximize “satisfaction”
Have to satisfy rules limiting our choices
14
The Diet Problem, Cont.
An example:
Minimize the cost of my diet, subject to satisfying minimum requirements of protein, and maximum limits on calories and fat
15
The Diet Problem, Cont.
Decisions:
Milk Chocolate
Orange juice Pizza
Objective:
Rules:
Minimize cost
Minimum protein requirement
Maximum calories limit
Maximum fat limit
16
The Diet Problem, Cont.
Stigler 1945
Posed problem
Solved heuristically
Dantzig 1963, 1990
Solved optimally in 1947 using simplex method
Appears in many Operations Research texts
New journal articles still appearing
17
The Diet Problem, cont.
IDEAL DIET
1.31 cups wheat flour 1.32 cups rolled oats
16 oz. milk
7.28 tbsp lard
3.86 tbsp peanut butter
0.0108 oz. beef
1.77 bananas
0.707 cups cabbage
0.387 potatoes
0.0824 oranges
0.314 carrots
0.53 cups pork and beans
18
Optimization Problem
Optimization problem
Decisions
Means of comparing decisions
Rules governing interactions between decisions
19
Mathematical Models
Once an optimization problem is defined in words, we need to find an appropriate mathematical model to analyze/solve it
A mathematical model captures the essence of the problem
An idealized version/approximation of the problem
20
Formulation or model
– mathematical representation of an optimization problem
Decision variables
Objective function
Constraints
Parameters (Constants)
21
The Diet Problem—Decision
Variables
Decision variables: a number of variables whose values are to be determined
Define the decision variables as: x m
= Gallons of milk consumed daily x c
= Bars of chocolate consumed daily x o
= Gallons of orange juice consumed daily x p
= Pizzas consumed daily
22
The Diet Problem—Objective
Function
Objective: minimize daily cost
Let c i
, for i = m , c , o , p be the current cost per unit for item i
Objective function: c m x m
+ c c x c
+ c o x o
+ c p x p
Objective function: the measure of performance expressed as a function of the decision variables
23
The Diet Problem—
Constraints
Constraints: Restrictions on the values that can be assigned to the decision variables
We may want to limit our diet so that:
total fat content in the diet does not exceed some limit
total calories do not exceed some limit
total protein intake is at least some minimum amount
We need the data for the fat, calorie, and protein value per unit of each item and the limits we want to meet
24
The Diet Problem—
Constraints, Cont.
Suppose f i
, w i
, p i
, for i = m
, …, p are the values of fat, calories, and proteins per unit of item i , respectively
Suppose F , W , and P are the daily limits on fat, calories, and protein, respectively
We have all the data to write our constraints
25
The Diet Problem—
Constraints, Cont.
We want
Daily fat intake: f m x m
Daily calorie intake: w
+ f c x c m x m
+
+ f o x o w c x c
+ f p x p
F
+ w o x o
+ w p x p
W
Daily protein intake: p m x m
+ p c x c
+ p o x o
+ p p x p
P
And, none of the intake amounts for each food is negative
26
The Diet Problem—
Parameters
Parameters: the constants used to specify the objective function and the constraints
For the diet problem, c i
, f i
, w i
, p i
, F , W , and
P are parameters
In practice, it is difficult to determine the parameters exactly
Sensitivity analysis is needed
27
The Diet Problem—Complete
Model
Minimize c m x m
+ c c x c
+ c o x o
+ c p x p
Subject to
f m x m
+ f c x c
+ f o x o
+ f p x p
F w x m m x p m x m m
+ w c x c
+ p
0, x c c x
c
+ w o x o
+ p o x o
+
+ w p x p p p x p
P
W
0, x o
0, x p
0
28
Other Applications
Optimization has been used in a number of serious applications yielding huge profits
A good place to find information about these applications is the Interfaces journal
Available electronically
29
Applications from Interfaces
Recovering from major airline disruptions
(Horner 2002)
Reducing travel costs and player fatigue in NBA
(Bean and Birge 1980)
Assigning managers to construction projects
(LeBlanc et al. 2000)
Managing consumer credit delinquency (Makuch et al. 1992)
Manufacturing of beer cans (Katok and Ott 2000)
30
More Applications
Scheduling prototype vehicle testing at Ford
(Chelst et al. 2001)
Portfolio construction (Bertsimas et al. 1999)
Scheduling police patrol officers (Taylor and
Huxley 1989)
Planning closure and realignment of army bases
(Dell 1999)
Assigning restoration capacity in a telecommunication network (Ambs et al. 2000)
Crew scheduling for airlines (Butchers 2000)
31
Ch. 3 Introduction to Linear
Programming
The Linear Programming Model
Examples
Assumptions of Linear Programming
Graphic Solutions of LP
Excel Solver
Suggested Readings: 3.1-3.6 of H&L
32
Start of Linear Programming
George Dantzig (1914 – 2005),
“Father” of Linear Programming
Junior Statistician U.S.
Bureau of Labor Statistics
(1937-39)
Head of USAF Combat
Analysis Branch (1941-46)
PhD Mathematics, Cal Berkeley (1946)
Invented “Simplex” method for solving linear programs (1947)
Medal of Science, 1975, for his work in LP
33
Linear Programs
Programming means planning
Linear programs (LPs) have:
Linear objective function
Linear constraints
Continuous variables
Typically very easy to solve, even when quite large
34
Why Linear Programs?
Many real-world problems can be modeled as LPs
Many other problems can be approximated as LPs
LP solution techniques provide the foundation for solution methods for many other structures of Mathematical Programs
(MPs)
35
Function Types
Linear functions have the general form: f(x
1
, x
2 where c
, …, x n
1
, c
2
) = c
1 x
, …, c n
1
+ c
2 x
2
+ …+c are constants n x n
Linear functions are simple
36
Function Types (Cont.)
Examples of non-linear functions
Polynomial: f(x, y,z) = x 2 + y 2 + z 2
Cross terms: f(x, y, z) = xy
Exponential: f(x) = e x
Maximum: f(x, y, z) = max {x, y, z}
Absolute: f(x) = |x|
More complex
37
Linear Constraints
Linear constraints are of three types
“ ”
p m x m
+ p c x c
+ p o x o quantity of proteins
+ p p x p
P, must have a minimum
“ ”
f m x m
+ the diet f c x c
+ f o x o
+ f p x p
F, at most F units of fat in
“=”
P. 46 of textbook—radiation therapy example
38
General Form of Linear
Constraints
Any linear constraint has the following general form: a linear function of decision variables
= a constant
39
Examples
x 2 + y 2
1
xy + y + 2z
1
(x + y + z) is integer
Again, more complex
Not “linear Constraints”
40
Example 1: Wyndor Glass
Wyndor makes doors and windows. They have three plants. A batch of doors requires
1 hour at Plant 1 plus 3 hours at Plant 3. A batch of windows requires 2 hours at Plant
2 plus 2 hours at Plant 3. Plant 1 is available for 4 hours per week, Plant 2 for
12 hours per week, and Plant 3 for 18 hours per week. The profit per door batch is
$3000 and the profit per window batch is
$5000. What should Wyndor manufacture to maximize profits?
41
Wyndor Glass—Resource
Consumption
Production Time per Batch, hours
Product Production time
Plant Door Window Available hours per week
1 1 0 4
2 0 2 12
3 3 2 18
42
Wyndor Glass (Cont.)
What are our decisions?
How many doors should we make?
How many windows should we make?
What is our goal?
Maximize profits
What are our rules?
Don’t exceed capacity at plant 1
Don’t exceed capacity at plant 2
Don’t exceed capacity at plant 3
43
Wyndor Glass—LP Model
What are our decisions—Decision Variables
x
1
> 0: # batches of doors per week
x
2
> 0: # batches of windows per week
What is our goal—Objective Function
Maximize 3000 x
1
+ 5000 x
2
What are our rules—Constraints
(Plant 1)
(Plant 2) x
1
+ 2x
2
(Plant 3)
(Non-negativity)
3x
1 x
1
+ 2x
0, x
2
2
0
4
12
18
44
Example 2: Lego Chair and
Table
Make tables and chairs to maximize profits.
Profit: $16 for each Table, $10 for each Chair
Each table uses 2 large blocks and 2 small blocks
Each chair uses 1 large block and 2 small blocks
You are limited by the availability of material. You only have 6 large blocks and 8 small blocks.
How many tables and chairs should you make to maximize profit?
45
How to Make the Chair and
Table?
46
Decision variables:
t: # of tables
c: # of chairs
Objective function:
Maximize 16*t+10*c
Constraints:
6 (large legos)
8 (small legos)
2*t + c <= 6
2*t + 2*c <= 8
Model
47
# of tables:
# of chairs:
Total profit:
Optimal Solution of Lego
Game
2
2
$52
48
Product Mix
There are n different products that I can produce. Each of these products consumes certain quantity of m different resources.
Every unit of a product i , for i
= 1,…, n uses a ij units of resource j , for j
= 1,…, m . I can make a profit of $ p i per unit of item i
The amount of resource j available is u j
.
What should I do to maximize my profit?
.
49
Connection
Product mix is a general version of Wyndor
Glass example and Lego chair and table example
Wyndor glass: n = 2, m = 3
Lego chair and table: n =2, m =2
Many business resource allocation problems take this form
50
Product Mix: General Model
Decision variables:
x i
= Amount of item i produced daily
Objective function:
maximize profit = p
1 x
1
+ p
2 x
2
+ … + p n x n
Constraints:
(Resource Availability) a
1 j x
1
+ a
2 j x
2
+ … + a nj x n
u j for j
= 1,…, m
(Non-negativity) x i
0 for i
= 1,…, n
51
Assumption of LPs
When we write a problem as a linear program, we are making a few assumptions about the underlying process
Proportionality: The contribution of a decision variable to the objective function or any one of the constraints is proportional to its value, e.g.,
The daily fat in-take from the pizza is proportional to the amount of pizza eaten daily
# of small blocks used is proportional to the number of chairs made
The total profit is proportional to the number of chairs or tables made
52
Assumptions (Cont.)
Additivity: The total contribution to the objective and left hand side of each constraint is the sum of individual contributions of each activity
The total cost of daily food is the sum of costs from individual food items
The total profit is the sum of profits from chair and table
Divisibility: Each decision can take any real value
Daily amount of milk consumption
Amount invested in a one-year CD at the beginning of year 1
53
Assumptions (Cont.)
Big assumption – Certainty
The value of each parameter needed in the linear programming is known with certainty
This assumption is almost never satisfied
Sensitivity analysis can help to find out the robustness of our optimal solutions to uncertainty of data
54
LP Model—A Standard Form
Max c
1 x
1 subject to
+ c
2 x
2
+ … + c n x n
(functional constraints) a a
11
21
… x x
1
1
+ a
12 x
+ a
22 x
2
2
+ … + a
1 n x n
+ … + a
2 n x n
b
1
b
2 a m 1 x
1
+ a m 2 x
2
+ … + a mn x n
b m
(nonnegativity constraints) x
1
0, x
2
0, …, x n
0
The number of variables is n and the number of constraints is m + n
55
Notation
We can use some notation to write linear programs compactly
We can write c
1 x
1
+ c
2 x
2
+ … + c n x n as
n i 1
We can write each constraint a j 1 x
1 a jn x n
b j as
+ a j 2 x
2
+ … + i n
1 a ji x i
b j for j
1, ..., m
56
Standard Form
Using the previous notation, the standard form of LP can be written as max i n
1 c i x i st i n
1 a ji x i x i
0 ,
b j for i for j
1, ..., m
1, ..., n
57
Some Terminology
Any specification of values for the decision variables ( x
1
,…, x n
) is called a solution .
A feasible solution is a solution for which all the constraints are satisfied.
An infeasible solution is a solution for which at least one constraint is violated.
A feasible solution is called an optimal solution if there is no other feasible solution with objective function value better than it
The optimal value of a problem is the objective value of an optimal solution to the problem
58
Example
Min 2 x
1
+ 3 x
2 subject to x
1
+ 5 x
2
= 3
3 x
1 x
1
0, x
2
= 2
0
In this case, x
1
= 2/3 and x
2 solution for the problem
= (3-2/3)/5 = 7/15 is a feasible
In fact, it is the only solution to the problem
So it is also the optimal solution to the problem as well
Optimal value of the problem is 2(2/3)+3(7/15)=2.73
59
Wyndor Glass Co. Problem max Z=3x s.t. x
1
1
+ 5x
2
(in $K)
4
+ 2x
2
12
(2)
3x
1
(3) x
1
+ 2x
0, x
2
0
2
18
(1)
x
1
= 0, x
2
= 0 is a feasible solution with Z=0
Is it optimal?
x
1
= 0, x
2 than (0, 0)
= 4 is a feasible solution with Z=20, better
Is this the optimal solution?
60
Feasible Region
The feasible region is the collection of all feasible solutions x
2 x
1
4
(0,9)
(0,6) (2,6)
2x
2
12
(4,3)
3x
1
+2x
2
18
(0,0)
(4, 0) (6, 0) x
1
61
Moving Isovalue Line
Now that we have the feasible region, how do we find the best solution?
(0,4) has value 20, all solutions with value 20 lie on the isovalue line 3x
1 x
2
+ 5x
2
= 20
3x
1
+ 5x
2
= 36
3x
1
+ 5x
2
= 20
?
3x
1
+ 5x
2
= 10 x
1
62
x
2
3x
1
+ 5x
2
= 36
3x
1
+ 5x
2
= 20
Finding the Optimal Point
?
3x
1
+ 5x
2
= 10 x
1
The optimal point occurs at the intersection of these two lines:
2x
2
=12 Plant 2
3x
1
+2x
2
= 18 Plant 3 x x
1
2
= 2
= 6
Optimal value: Z=3x
1
+5x
2
=36—Maximal profit is $36K
63
Graphical Solutions
Min -2x - y
St x + y < 3 x < 2 y < 2 x, y > 0 y
-2x - y = -1 x
64
Graphical Solutions
Min -2x - y
St x + y < 3 x < 2 y < 2 x, y > 0 y
-2x - y = -2 x
65
Min -2x - y
St x + y < 3 x < 2 y < 2 x, y > 0 y
Graphical Solutions
-2x - y = -4 x
66
Min -2x - y
St x + y < 3 x < 2 y < 2 x, y > 0 y
Graphical Solutions
-2x - y = -5 x
67
Solving LP’s Graphically
Procedures:
Identify feasible region
Plot an isovalue line corresponding to a feasible solution
Move line in improving direction and find the last isovalue line touching the feasible region
Any point(s) on the intersection of the last isovalue line and feasible region are optimal solutions
68
Finding Optimal Solutions
Min3 x
1
– x
2 s.t.
x
1
+ x
2
< 6 x
1
< 4 x
2
< 4 x
1
, x
2
> 0
Which point is optimal?
x
2
(0,4) (2,4)
(0,0)
(4,2)
(4,0) x
1
69
Finding Optimal Solutions
Min -2 x
1
– x
2 s.t.
x
1
+ x
2
< 6 x
1
< 4 x
2
< 4 x
1
, x
2
> 0
Which point is optimal?
x
2
(0,4) (2,4)
(0,0)
(4,2)
(4,0) x
1
70
Finding Optimal Solutions
Max x
1
+ x
2 s.t.
x
1
+ x
2
< 6 x
1
< 4 x
2
< 4 x
1
, x
2
> 0
Which point is optimal?
x
2
(0,4) (2,4)
(0,0)
(4,2)
(4,0) x
1
71
Graphical LP Solutions
Works well for 2 decision variables
“Possible” for 3 decision variables
Impossible for 4+ variables
Other solution approaches necessary
Good to illustrate concepts, aid in conceptual understanding
72
Example
3.2-2(a) of H&L: The colored area in the following graph represents the feasible region of a LP problem whose objective function is to be maximized. Label the following statement as
True or False and give an example of an objective function that illustrates your answer.
(a) If (3,3) produces a larger value of the objective function than
(0, 2) and (6, 3), then (3,3) must be an optimal solution.
x
2
(3, 3) (6, 3)
(0, 2)
(0, 0)
(6, 0) x
1 73
Property of Optimal Solution
In all cases there is a corner point of the feasible solution region that is an optimal solution
Is this a coincidence?
NO!
Important result: Whenever a linear program has an optimal solution and it has a corner, there is always an optimal solution on one of the corners of the feasible region
Note that the statement does not say that a linear program always has an optimal solution, it does not say that all optimal solutions have to be on the corners, in fact it does not presume that there will be corner points!
74
Pathological Cases
What are the possibilities that a linear program does not have an optimal solution at a corner point?
Infeasibility: There is no feasible solution to the linear program, e.g.,
Min x
1 s.t. x
1
-1 x
1
0
There is no real value that is simultaneously less than –1 and greater than 0
75
Infeasible LP’s
76
Pathological Cases
Unboundedness: The linear program is feasible but the optimal value is not finite, e.g., x
2 max x
1 s.t.
+ x
2 x
1
3 x
2 x
1
,
4 x
2
0
(0,4) x
2
4 x
1
3
(0,0) (3,0) x
1
+ x
2 x
1
77
Unbounded LP’s
78
Pathological Cases
No corner points: The feasible region has no corner points min x
1 s.t. x
1
0 x
2 is free
Any solution with x
1
= 0 is optimal!
This case can never happen for LPs in a standard form x
2
(0,0) x
1
79
Pathological Cases
Are there other possibilities when a linear program may not have an optimal solution at a corner point?
NO!
Any linear program falls under one of the four cases: (i) infeasible, (ii) unbounded,
(iii) no corner point, (iv) has an optimal solution at a corner point
There can be multiple optimal solutions to a linear program
80
Multiple Optima x
2
(0,6)
(0,0)
What if the objective function of the
Wyndor problem was 3x
1
+ 2x
2 instead of
3x
1
+ 5x
2
?
(2,6)
(3,9/2)
(4,3)
The optimal value of 18 is achieved by all the solutions on the line segment joining
(2,6) and (4,3)!
3x
1
3x
1
+ 2x
2
(4,0)
+ 2x
2
3x
1
= 12
+ 5x
= 18
2
= 20 x
1
81
Multiple Optima
82
Summary
A linear program always satisfies one of the four cases
Pathological cases
It is infeasible
It is unbounded
It has no corner points but it has optimal solutions
Normal case
It has an optimal solution at one of the corner point feasible solution (among possibly many others)
83
Summary
We shall always transform a linear program into one of the standard forms before solving it
We don’t need to worry about the third pathological possibility
We only need to worry about infeasibility and unboundedness
When our LP (in standard form) is not infeasible or unbounded, there is a corner point feasible solution which is an optimal solution
84
85
Loading Solver
Standard with every version of Excel
Insert MS Office or Excel master CD
Click on “Add/Delete” components
Open “Add-In” tools
Click on “Solver” or “add all”
Click “OK”
Solver should now appear in the “Tools” menu
86
56:171 Operations Research
Ch. 4 Solving Linear Programs:
The Simplex Method
87
Outline
The Simplex Method
Simplex Method for Standard Form
Theory of the Simplex Method
Simplex Method for other LP problems
Suggested Reading: 4.1, 4.2, 4.4, 4.5, 4.6
88
Review of Wyndor Glass
Example
Product Mix LP.
Wyndor makes doors and windows. They have three plants. A batch of doors requires 1 hour at Plant 1 plus 3 hours at Plant 3. A batch of windows requires 2 hours at
Plant 2 plus 2 hours at Plant 3. Plant 1 is available for 4 hours per week, Plant 2 for 12 hours per week, and Plant 3 for 18 hours per week. The profit per door batch is $3000 and the profit per window batch is $5000. What should Wyndor manufacture to maximize profits?
Max Z = 3x
1 s.t.
+ 5x
2 profits (in thousands of $)
1x
3x
1 x
1
1
+ 2x
2
4 Plant 1
12 Plant 2
, x
2
+ 2x
2
0
18 Plant 3 non-negativity
89
Standard & Augmented
Forms
Standard Form with Nonnegative RHS
Max Z = 3x
1 s.t.
+ 5x
2
1x
3x
1 x
1
1
+ 2x
2
, x
2
+ 2x
2
0
4
12
18
Augmented Form
Max Z = 3x
1 s.t.
+ 5x
2
1x
1
3x
1 x
1
+ 2x
2
+ 2x
2
, x
2
, s
1
+ s
1
, s
2
,
+ s
2 s
3
0
+ s
3
= 4
= 12
= 18
90
x
2
(0,9)
(0,6) (2,6)
Geometric Representation of
Simplex Method
Max Z = 3x
1 s.t.
+ 5x
1x
1
3x
1 x
1
+ 2x
+ 2x
2
, x
2
, s
2
1
2
+ s
1
, s
2
, s
3
+ s
2
0
+ s
3
= 4
= 12
= 18
(4,3)
(0,0) (4, 0) (6, 0) x
1
91
x
2
(0,9)
(0,6)
(0,0)
(2,6)
Geometric Representation of
Simplex Method
Max Z = 3x
1 s.t.
+ 5x
1x
1
3x
1 x
1
+ 2x
+ 2x
2
, x
2
, s
2
1
2
+ s
1
, s
2
, s
3
+ s
2
0
+ s
3
= 4
= 12
= 18
(4,3)
(4, 0) (6, 0) x
1 x
1 x
2 s
1 s
2
= 0
= 0 s
3
= 4
= 12
= 18
Z = 0
92
x
2
(0,9)
(0,6)
?
(0,0)
(2,6)
Geometric Representation of
Simplex Method
Max Z = 3x
1 s.t.
+ 5 x
1x
1
3x
1 x
1
+ 2x
+ 2x
2
, x
2
, s
2
1
2
+ s
1
, s
2
, s
3
+ s
2
0
+ s
3
= 4
= 12
= 18
(4,3)
(4, 0) (6, 0) x
1 x
1 x
2 s
1 s
2
= 0
= 6 s
3
= 4
= 0
= 6
Z = 30
93
x
2
(0,9)
(0,6)
(0,0)
(2,6)
Geometric Representation of
Simplex Method
Max Z = s.t.
3 x
1
+ 5x
2
1x
1
3x
1 x
1
+ 2x
+ 2x
2
, x
2
, s
2
1
+ s
1
, s
2
, s
3
+ s
2
0
+ s
3
= 4
= 12
= 18
(4,3)
(4, 0) (6, 0) x
1 x
1 x
2 s
1 s
2
= 2
= 6 s
3
= 2
= 0
= 0
Z = 36
94
Algebraic Representation
Max Z = 3x
1 s.t.
+ 5x
1x
1
3x
1 x
1
, x
+ 2x
2
+ 2x
2
, s
2
1
2
+ s
1
, s
2
, s
3
+ s
2
0
+ s
3
= 4
= 12
= 18
3 equations in 5 unknowns
Multiple solutions
Guided search to move to optimal solution
“Simplex Method”
95
Tabular Representation
Max Z = 3x
1 s.t.
+ 5x
1x
1
3x
1 x
1
, x
+ 2x
2
+ 2x
2
, s
2
1
2
+ s
1
, s
2
, s
3
+ s
2
0
+ s
3
Initial Simplex Method Tableau
Z s
1 s
2 s
3
1
0 x
1
-3
3
0
2 x
2
-5
2
1
0 s
1
0
0
0
1 s
2
0
0
0
0 s
3
0
1
= 4
= 12
= 18
RHS
0
4
12
18
96
Z s
1 s
2 s
3 x
1
-3
1
0
3 x
-5
0
2
2
2
1
0 s
1
0
0
Simplex Method (Tabular
0
1 s
2
0
0
0
0 s
3
0
1
RHS
Form)
12
18
0
4
s
1
, s
2 and s
3 in this tableau represent basic variables x
1 and x
2 are non-basic variables
Basic solutions are obtained by setting the non-basic variables to zero and solve the basic variables
Basic solutions represent corner points
Systematically change basic solution to improve objective function …
… while maintaining feasibility!
97
Z s
1 s
2 s
3
0
3 x
1
-3
1
2
2 x
2
-5
0
0
0 s
1
0
1
Basic Variables in Simplex
1
0 s
2
0
0
0
1 s
3
0
0
RHS
12
18
0
4
Tableaux
Any column corresponding to a basic variable in Simplex tableaux should have one and only one nonzero element, which is equal to “1”
The collection of the basic variables is called the basis
98
Each Iteration of Simplex
Method
Optimality Test : the current basic solution is optimal if and only if every coefficient in row 0 is nonnegative (
0)
Determine the entering basic variable by selecting the variable with the “most negative” coefficient in row 0.
Determine the leaving basic variable by applying the minimum ratio test :
Pick each coefficient in pivot column that is >0
Divide each of them into the RHS
Identify the row with smallest ratio
Solve the new basic solution by using elementary row operations (multiply a row by a constant; or add/subtract a multiple of the pivot row to/from another row)
99
Z s
1 s
2 s
3
Max Z = 2x
1 s.t.
3x
1 x
1 x
1
x
2
+ x
3
+ x
x
+ x
2
2
+ x
3
+ 2x
2
x x
1
, x
2
3
, x
3
3
60
10
20
0
More Simplex Examples
1
1 x
1
-2
3
-1
1 x
2
1
1
2
-1 x
3
-1
1
0
0 s
1
0
1
1
0 s
2
0
0
0
1 s
3
0
0
RHS
0
60
10
20
100
More Simplex Examples s
3 s
4 s
1 s
2
Z
Max Z = 60x
1 s.t.
8x
1
4x
1
2x
1
+ 30x
2
+ 20x
3
+ 6x
2
+ 2x
2
+ x
+ 1.5x
+ 1.5x
2
+0.5x
3
3 x
2 x
1
, x
2
, x
3
3
48
20
8
5
0 x
1
-60 x
2 x
3
-30 -20 s
1
0
8
4
2
0
6
2
1
1.5
1.5
0.5
1 0
1
0
0
0
1
0 s
2
0
0
0 s
3 s
0 0
4
0 0
0 0
1 0
0 1
RHS
0
48
20
8
5
101
Theory of the Simplex
For any LP with feasible solutions and a bounded
Method feasible region:
If there is exactly one optimal solution, then it must be a corner-point feasible (CPF) solution
If there are multiple optimal solutions, then at least two must be adjacent CPF solutions
There are a finite number of CPF solutions
A CPF solution is optimal if there are no other adjacent CPF solutions that are better
102
X
Corner Point Feasible
Solutions
X
Interior Point Solution
• Feasible? Yes
• Optimal? Never
103
Alternate Optima
104
Finite Number of CPF
Solutions
An upper bound of the number of CPF solutions:
# variables
#
# constraint
variables s
n m
( m
n )!
m !
n !
Example : m=50 constraints , n=100 decision variables
( m
n )!
m !
n !
( 50
100 )!
50 !
100 !
2 .
01
10
40
Greater than the number of atoms in
Universe!
105
x
2
Adjacent CPF Solutions
X larger Z smaller Z x
1
106
107
Finding a Feasible Solution?
Constraints in
Form &
Minimization Problems
X Not Feasible!
Equality Constraints
108
Equality Constraints
2
3
Max Z = 2 x s.t.
1
1 x x x
+ 3
1
1
1
+ 2
+
, x
2 x x x
2
2
2
0
4
= 3
(2,1)
X
3 4
Note: x
1 is
= x
2
= 0 not feasible
How to achieve feasibility?
109
Big M Method
Max Z = 2 x s.t.
1
1 x x x
+ 3
1
1
1
+ 2
+
, x
2 x x x
2
2
2
0
4
= 3
Strategy: Start with artificial variables, then remove artificial variables from the basic variables using penalty
M
Add
Max Z = 2 x s.t.
1 artificial variable a
1
1 x x x
+ 3
1
1
+ 2
+
1
, x
2 x
2 x
2 x
2
+ s
, s
1, a
1
1
M a
+
0 a
1
1
= 4
= 3
M >0 is a VERY big number
Note: x
1
= x is now
2
= 0 feasible
110
Big M Simplex Tableaux
Z s
1 a
1
Max Z = 2 x s.t.
1
1 x x x
+ 3
1
1
+ 2
+
1
, x
2 x
2 x
2 x
2
–
+ s
, s
1, a
1
1
M a
+
0 a
1
1
= 0
= 4
= 3 x
1 x
2
-2 -3
1
1
2
1 s
0
1
0
1 a
M
0
1
1
An extra
Nonzero
Element; need
To remove!
RHS
0
4
3
111
Z –( x
1
M s1 1 a1 1
+2) –( x
M
2
1
2
+3) s
0
1
0
1 a
0
0
1
1
Big M Simplex Tableau
RHS
–3
4
3
M
Initial
Solution x x s a
2
1
= 0
1
= 0
= 4
1
= 3
112
Constraints
Max Z = 2 x s.t.
1
1
2 x x x
1
1
1
+ 5
– 2
+ 4
, x
2 x x
,
2
2 x x
3
2
+ 3
+ x x
3
+
0
3 x
3
20
= 50
Subtract surplus variable to create equality
1 x
1
– 2 x
2
+ x
3
– s
1
= 20
Add artificial variable for equality…
1 x
1
– 2 x
2
+ x
3
– s
1
+ a
1
= 20 artificial variables?
big M method
113
Big M
Max Z = 2 x s.t.
1
1
2 x x x
+ 5
1
1
1
,
– 2
+ 4 x
2
, x
2 x
2 x
2
+ 3 x x
3
+
+
, s x x
3
3
1
,
3
– M a
1
– M a
2
– s
1
+
1
+ + a
1
, a
2 a
0 a
2
= 20
= 50
Tableau with revised row 0: x
1 x
2 x
3 s
1 a
1
Z -(3M+2) -(2M+5) -(2M+3) 1M 0 a1 1 -2 1 -1 1 a2 2 4 1 0 0 a
2
RHS
0 -70M
0 20
1 50
114
Variables Allowed to be
Negative x j allowed to be any value (+ or –)
Substitute x j
= x j
+ – x j
– x j
+ , x j
– 0
115
Negative RHS’s
0.4
x
1
– 0.3
x
2
– 10
Is exactly equivalent to Multiply by –1
– 0.4
x
1
+ 0.3
x
2
10
Change sign of the inequality and use corresponding methods for the new constraint
116
Minimization Problems
Min Z = 0.4
x
1
+ 0.3
x
2
Is exactly equivalent to
Max -Z = – 0.4
x
1
– 0.3
x
2
Multiply by –1
117
Summary of All Types of LP
Situations Solutions
constraint Slack variable
Equality constraint Artificial variable + Big M
Method
constraint Surplus variables + artificial variables + Big M
Variables allowed to be negative
Change of variables
Negative RHS Multiply both sides by -1
Initial Basic
Variables
Slack variable
Artificial variable
Artificial variable
(NOT surplus var.)
Minimization problems
Multiply objective function by -1
Combination of cases: use Big M method last
118
Unbounded Solutions
No Feasible Solutions
LP Solution Problems
119
Z s
1 s
3
1
3 x
1
-3 x
2
-5
0
-2
1
0 s
1
0
0
1 s
3
0
Unbounded Solutions
RHS
0
4
6
No coefficient in pivot column is positive
No leaving basic variable
Can bring in unlimited x
2
Z increases without limit!
LP is “unbounded”
120
x
2 unbounded
Unbounded Solutions
(0,0) (4, 0) x
1
121
Example
Breadco Bakeries bake two kinds of bread: french and sourdough. Each loaf of french bread can be sold for 36cents, and each loaf of sourdough bread for 30cents. A loaf of french bread requires 1 yeast packet and 6 oz of flour; sourdough requires 1 yeast packet and 5 oz of flour. At present Breadco has 5 yeast packets and 10 oz of flour. Additional yeast packets can be purchased at 3 cents each, and additional flour at 4 cents/oz. Formulate and solve an LP that can be used to maximize
Breadco’s profits.
122
No Feasible Solutions
Min Z = 2x
1 s.t.
+ 3x
2
½x
1 x
1
+ ¼x
2
+ 3x
2 x
1 x
+ x
2
1
, x
2
= 10
0
4
36
An LP is infeasible if an artificial variable is greater than zero in a final solution x
1 x
-Z 2M-1 0
2 s
1 a
1 x
2
1/4
-2
1
0
0
1
1
0 s
1
0
0
0
-1 s
2
M
0 a
1 a
2
RHS
0 4M-3 -30-6M
0 -1/4 3/2
1 -3 6
0 1 10
123
x
2
(0,9)
(0,6)
(2,6)
(0,0)
(4,3)
(4, 0) (6, 0)
Introduction to Interior Point
Solution Approach
Starts at inner feasible point
Moves through interior of feasible region
Always improves objective function
Longer computer time per iteration
Less iterations for large problems
Faster than Simplex method for huge problems x
1
124
125
Outline
Binding vs. Slack Constraints
LP Sensitivity
Ranges of optimality
Shadow prices
LP Duality
Suggested Readings: 4.7, parts of 6.1, 6.2,
6.6
126
Binding vs. Slack Constraints
127
Slack
Constraint
Binding vs. Slack Constraints
Binding
Constraints
128
Ranges of Optimality
Objective function (OF) coefficients
Right-hand sides (RHS)
129
Review of Wyndor Glass
Example
Product Mix LP.
Wyndor makes doors and windows. They have three plants. A batch of doors requires 1 hour at Plant 1 plus 3 hours at Plant 3. A batch of windows requires 2 hours at
Plant 2 plus 2 hours at Plant 3. Plant 1 is available for 4 hours per week, Plant 2 for 12 hours per week, and Plant 3 for 18 hours per week. The profit per door batch is $3000 and the profit per window batch is $5000. What should Wyndor manufacture to maximize profits?
Max Z = 3x
1 s.t.
+ 5x
2 profits (in thousands of $)
1x
3x
1 x
1
1
+ 2x
2
4 Plant 1
12 Plant 2
, x
2
+ 2x
2
0
18 Plant 3 non-negativity
130
Wyndor Glass Example
How much can c
1 or c solution?
2 change without changing the optimal
Max Z = c
1 x
1 s.t.
+ c
2 x
2 profits (in thousands of $)
1x
3x
1 x
1
1
+ 2x
2
4 Plant 1
12 Plant 2
, x
2
+ 2x
2
0
18 Plant 3 non-negativity
131
Allowable Range to Stay
Optimal
Allowable range to stay optimal is the range of values for c j over which the current optimal solution remains optimal, assuming no change in the other coefficients.
132
x
2
(0,9)
(0,6) (2,6)
Graphical Sensitivity Analysis
(4,3)
(0,0) (4, 0) (6, 0) x
1
Allowable range to stay optimal for c
1
: 0 c
1
7.5
133
Graphical Sensitivity Analysis x
2
(0,9)
(0,6)
(2,6)
(4,3)
(0,0) (4, 0) (6, 0) x
1
134
Ranges of Optimality
Objective function coefficients
Right-hand sides
135
Wyndor Glass Example
How much can the RHS’s change so that the current optimal
CPF solution is still feasible?
profits (in thousands of $) Max Z = 3x
1 s.t.
+ 5x
2
1x
3x
1 x
1
1
+ 2x
2
b
1
b
2
, x
2
+ 2x
2
0
b
3
Plant 1
Plant 2
Plant 3 non-negativity
136
Allowable Range to Stay
Feasible
Allowable range to stay feasible is the range of values for b i over which the current optimal CPF solution remains feasible , assuming no change in the other right-hand sides.
137
x
2
(0,9)
(0,6)
Graphical Sensitivity Analysis
Max Z = 3x
1 s.t.
+ 5x
2
1x
3x
1 x
1
1
+ 2x
2
, x
2
+ 2x
2
0
4
12
18
(0,0) (4, 0) (6, 0) x
1
138
Graphical Sensitivity Analysis x
2
(0,9)
(0,6)
(0,0) (4, 0) (6, 0) x
1
139
x
2
(0,9)
(0,6)
X
Graphical Sensitivity Analysis
(0,0) (4, 0) (6, 0) x
1
Allowable range to stay feasible for b
1 is 2 b
1
140
Graphical Sensitivity Analysis
Max Z = 3x
1 s.t.
x
2
(0,9)
(0,6)
(0,0) (4, 0) (6, 0) x
1
+ 5x
2
1x
3x
1 x
1
1
+ 2x
2
, x
2
+ 2x
2
0
4
12
18
141
x
2
(0,9)
X
(0,6)
Graphical Sensitivity Analysis
(0,0) (4, 0) (6, 0) x
1
142
x
2
(0,9)
(0,6)
X
Graphical Sensitivity Analysis
Max Z = 3x
1 s.t.
+ 5x
2
1x
3x
1 x
1
1
+ 2x
2
4
12
, x
2
+ 2x
2
0
b
3
(0,0) (4, 0) (6, 0) x
1
Allowable range to stay feasible for b
3 is 12 b
3
24
143
Shadow Prices
144
Wyndor Glass Example
How much is additional
RHS resource worth to us?
Max Z = 3x
1 s.t.
+ 5x
2 profits (in thousands of $)
1x
3x
1 x
1
1
+ 2x
2
4 Plant 1
12 Plant 2
, x
2
+ 2x
2
0
18 Plant 3 non-negativity
145
x
2
(0,9)
(0,6)
(2,6)
(4,3)
Graphical Solution
Max Z = 3x
1 s.t.
+ 5x
2
(Z*=36)
1x
3x
1 x
1
1
+ 2x
2
, x
2
+ 2x
2
0
4
12
18
(0,0) (4, 0) (6, 0) x
1
146
Resource Shadow Price
The shadow price of resource i ( b i
) is the rate at which Z could be improved by slightly increasing the amount of this resource
Shadow price = 0 for any slack constraint.
147
Algebraic Solution
The simplex method identifies the shadow price by the coefficients of the slack variables in row 0 of the final simplex tableau.
Final Simplex Tableau
Shadow price of b
1
, b
2
, b
3
Z s
1 x
2 x
1
0
0 x
1
0
1
0
1 x
2
0
0
1
0 s
1
0 s
2
3/2
1/3
1/2 s
1
-1/3
0
3
0 -1/3 1/3
RHS
36
2
6
2
148
LP Duality
149
Dual LP Example
Primal Problem
Max Z = 3x
1 s.t.
+ 5x
2
1x
1
0x
1
3x
1 x
1
+ 0x
2
+ 2x
2
+ 2x
2
, x
2
0
4
12
18 x
1 x
2
* = 2
* = 6
Z* = 36
Dual Problem
Min W = 4y
1 s.t.
+ 12y
2
1y
1
0y
1 y
1
, y
2
+ 0y
2
+ 2y
2
, y
3
+ 18y
3
+ 3y
3
+ 2y
3
0
3
5 y
1 y
2 y
3
* = 0
* = 3/2
* = 1
W* = 36
150
Maximize
Profits
Dual Interpretation
Minimize Total
Implicit Price
Max Z = 3x
1 s.t.
+ 5x
2
1x
1
0x
1
3x
1 x
1
+ 0x
2
+ 2x
2
+ 2x
2
, x
2
0
4
12
18
Resources
Quantities
Min W = 4y
1 s.t.
+ 12y
2
1y
1
0y
1 y
1
, y
2
+ 0y
2
+ 2y
2
, y
3
+ 18y
3
+ 3y
3
+ 2y
3
0
3
5
Shadow
Prices
Value
Owner of resources Buyer of resources
151
Weak Duality
If x is a feasible solution for the primal problem and y a feasible solution for the dual, then Z
W
That is, the value of the dual is an upper bound on the primal problem
152
Strong Duality
If Z * is the optimal value for the primal problem and W * the optimal value for the dual, then Z* = W*
That is, the optimal value of the primal and the optimal value of the dual are equal
153
Example
Consider the following problem
Max Z=2x
1
+7x
2
+4x
3 s.t.
x
1
3x
1
+ 2x
2
+ 3x
2
+ x
3
+ 2x
3
10
10 and
(a) x
1
0, x
2
0, x
3
0.
Construct the dual problem for this primal problem.
(b)
Use the dual problem to demonstrate that the optimal value of Z for the primal problem cannot exceed 25.
154
Example
Prove that for any linear programming problem in standard form if the primal problem has an unbounded feasible region that permits increasing Z indefinitely, then the dual problem has no feasible solutions.
155
Example
Consider the following LP
Max Z=-x
1
+5x
2 s.t.
x
1
-x
1
+ 2x
+ 3x
2
2
0.5
0.5
and x
1
0, x
2
0.
What is the missed value at the following Row 0 of the optimal tableau?
Z x1 x2 s1 s2 RHS
0 0 0.4
1.4
?
156
Why do we care?
Dual problem may be easier to solve
Number of constraints affects computation far more than number of variables for simplex method
Primal has 1000 constraints, 100 variables
Dual has 100 constraints, 1000 variables
Dual is easier to solve
Evaluate a primal solution using dual feasibility
Sensitivity Analysis
Weak duality often used in solving integer programs (branch and bound)
Economic interpretation and insight
157
Chapter 8
Transportation and Assignment
Problems
158
Product Mix
Investment
Diet/Nutrition
Previous LP Applications
159
Two Additional Important LP
Applications
Shipping Planning
Production Scheduling
Water Distribution
160
Transportation Problem
161
Transportation Problem
Example
High Plains Electronics manufactures MP3 players at three separate overseas plants. It ships finished products to three US distribution centers. Shipping costs (per unit) are shown below, as are the production capacities of each plant and the demand from each distribution center (units per week):
Supply = Demand
Plant
Singapore
Spain
Argentina
Demand
LA
Distribution Center
Boston Denver Capacity
4
8
14
200
10
16
18
300
6
6
10
200
100
300
300
700
162
Transportation Problem
Defined
Minimize total “shipping” cost (or maximize profit) of products from source to destinations
Supply equals demand
Distribution quantities often have integer values
Integrality assured : all basic solutions
(including optimal solution) have integer value when supply/demand are integer
Linear costs assumed
163
General LP Form min/ max i n m
1 j
1 c ij x ij
Optimize some objective s .
t .
j n
1 x ij
s i i m
1 x ij x ij
0
d j
Supply constraints
Demand constraints
Non-negativity constraints
164
General LP Form
Objective function
Supply constraints
Demand constraints
165
Prohibited Routes
What if some routes are infeasible or prohibited?
Create allocation cost that is so large that it will be quickly forced leaving from the basis – “Big M”
Example …
166
Supply
Demand
What if supply does not equal demand?
Feasible solutions exist only if total supply equals total demand i m
1 s i
j n
1 d j
Create “dummy” source or destination
Example …
167
Check Processing Example
(Dummy Destination)
A bank has two sites at which checks are processed. Site 1 can process 10,000 checks per day, and site 2 can process 6000 checks per day. The bank processes 3 types of checks: vendor, salary, and personal. The processing cost per check depends on the site (see table). Each day, 5000 checks of each type must be processed.
Formulate a transportation problem to minimize the daily cost of processing checks.
Site
1
2
Vendor checks
5 cents
3 cents
Salary checks
4 cents
4 cents
Personal checks
2 cents
5 cents
168
Production Scheduling
Example
The NORTHERN AIRPLANE COMPANY builds commercial airplanes. The production of the jet engines must be scheduled for the next 4 months. The unit storage cost is 0.015 million dollars per month. The demand, supply capacity, and production costs are listed in the table. The production manager wants a schedule for the number of engines to be produced in each of the 4 months to minimize the total production and storage costs.
Month
1
2
3
4
Scheduled
Installation
10
15
25
20
Maximum
Production
25
35
30
10
Unit Cost of
Production
1.08
1.11
1.10
1.13
Unit Cost of
Storage
0.015
0.015
0.015
169
Water Distribution Example
(Dummy Source)
Two reservoirs are available to supply the water needs of three cities.
Each reservoir can supply 50 million gallons of water per day. Each city would like to receive 40 million gallons per day. For each million gallons per day of unmet demand, there is a penalty. At city 1, the penalty is $20; at city 2, the penalty is $22; and at city 3, the penalty is $23. The cost of transporting 1 million gallons of water from each reservoir to each city are shown in the table. Formulate a transportation problem that can be used to minimize the sum of shortage and transport costs.
Reservoir 1
Reservoir 2
City 1
$7
$9
City 2
$8
$7
City 3
$10
$8
170
Transportation Problem
Solutions
Transportation problem is a special type of linear programming problem. So it can be solved by simplex method
A streamlined procedure (the transportation simplex method ) is available to achieve tremendous computational savings by exploiting the special structure of transportation problems.
171
Assignment Problem
172
Assignment Problem Example
MACHINECO has 4 machines and 4 jobs to be completed. Each machine must be assigned to complete one job. The time required to set up each machine for completing each job is shown in the table.
MACHINECO wants to minimize the total setup time needed to complete the 4 jobs.
Machine 1
Machine 2
Machine 3
Machine 4
Job 1
14
2
7
2
Job 2
5
12
8
4
Job 3
8
6
3
6
Job 4
7
5
9
10
173
s .
t .
General LP Form min i n n
1 j
1 c ij x ij
Optimize some objective j n
1 x ij
1 i n
1 x ij
1 x ij
0
1
Resource constraints
Task constraints
If i is not assigned to j
If i is assigned to j
174
Assignment Problem
The assignment problem is a special type of transportation problem
Assign discrete resources (people, machines, vehicles, …) to tasks (jobs, routes, …)
Number of resources and tasks are equal
Each resource is assigned to one task
Each task is assigned to one resource
Binary solutions assured
Linear costs assumed
Highly degenerate (many zero basic variables)
175
Assignment Problem
Extensions
# resources unequal to #tasks
Use dummy resources or tasks
Prohibited assignments
Use large allocation cost – “Big M”
176
Another Assignment Problem
Example
A company has decided to assign 3 new machines to 4 locations. The estimated cost in dollars per hour of materials handling involving each of the machines is given in the table for the respective locations.
Location 2 is not suitable for machine 2.
Machine 1
Machine 2
Machine 3
Location 1 Location 2 Location 3 Location 4
13
15
5
16
--
7
12
13
10
11
20
6
177
Assignment Solutions
Could try complete enumeration
n!
assignments possible
n =10 means 10!=3.6 million possible assignments
Linear Programming solution
Small problem can be solved by the general simplex method
Applying transportation simplex method is a relatively fast way
Specialized algorithms available, which are in preference to the transportation simplex method
178
Ch. 12
179
Integer Programs
General Integer
Models
0-1 (Binary) Models
Mixed Integer Models
IP Examples
Outline
IP Solution
Techniques
Branch and Bound
Application articles
Suggested Readings:
11.1-11.7
180
Integer Programming
An integer programming problem (IP) is an LP in which some or all of the variables are required to be integers.
IP is generally much more difficult to solve than LP due to
Exponential growth of number of solutions
Property of simplex method is invalid for IP
181
Max Z = 33 x
1 s.t.
+ 12 x
2 x
1
, x
–
2 x
5 x
1
2 x
1
1
+ 2
+ 2 x x
– x
2
2
2
4
16
4
0 and integer x
2 x
3
1
2
= 2
= 3
Z
IP
* = 102
2
Rounded LP Solution x
1 x
2
= 1
Z
RLP
* = 78
1
An IP Example
Optimal LP Solution x
1 x
2
= 8/3
= 4/3
Z
LP
* = 104
Feasible and optimal
Not feasible,
Not optimal
2 x
1
182
Bounds on IP’s
For a max (min) IP
The LP obtained by omitting all integer constraints on variables is called the LP relaxation of the IP
The optimal value of the LP relaxation is an upper-bound (lower-bound) to the IP
If all variables in the optimal solution of LP relaxation are integers, then the optimal solutions of LP and IP are the same
183
General IP Example
Pawtucket University is planning to buy new copier machines for its library. Two different models are considered: Model A and B. Model A can handle
20,000 copies a day, and costs $6,000. Model B can handle 10,000 copies a day, but costs only $4,000. At least six copiers are needed. And at least one of them is model A. The copiers need to be able to handle a capacity of at least 75,000 copies with minimum cost.
184
Binary IP Problems
General IP problems important, but not compelling
Integer Programming of greater importance is to model “yes-no” decisions
“BIP” models
185
Binary IP Example
The CALIFORNIA MFG. COMPANY is considering expansion by building a new factory in either Los Angeles or San Francisco, or both cities. It also is considering buiding of location is at most one new warehouse, but the choice restricted to a city where a new factory is being built .
The net present value and the capital required for each alternative is in the table. The total capital available is $10 million. The objective is to maximize the total net present value.
Factory in LA
Factory in SF
Warehouse in LA
Warehouse in SF
Net Present
Value
$9 million
$5 million
$6 million
$4 million
Capital
Required
$6 million
$3 million
$5 million
$2 million
186
Mixed Integer Programs
“MIP”
Both integer and continuous variables max z = 3x
1
+ 2x
2 s.t. x
1
+x
2
6 x
1
, x
2
0, x
1 integer
187
Other Integer Programming Examples
188
Set-Covering Problem
There are six cities (cities 1-6) in Kilroy County. The county must determine where to build fire stations. The county wants to build the minimum number of fire stations needed to ensure that at least one fire station is within 15 minutes of each city. The times required to drive between the cities are shown in the table. Formulate a BIP to tell Kilroy how many fire stations should be built and where they should be located.
4
5
6
1
2
3
30
30
20
10
20
1
0
35
20
10
2
10
0
25
15
30
20
3
20
25
0
0
15
25
4
30
35
15
15
0
14
5
30
20
30
25
14
0
6
20
10
20
189
Either-Or Constraints*
Dorian Auto is considering manufacturing three types of autos: compact, midsize, and large. The resources required for, and the profits yielded by, each type of car are shown in the table. At present, 6000 tons of steel and 60,000 hours of labor are available. For production of a type of car to be economically feasible, at least 1000 cars of that type must be produced. Formulate an IP to maximize Dorian’s profit.
Steel required (tons)
Labor Required (hrs)
Profit (k$)
Compact
1.5
30
2
Midsize
3
25
3
Large
5
40
4
190
Summary of IP Formulation
Mutually exclusive alternatives
At most one of x
1
, x
2
, …, x n
Exactly one of x
1
, x
2
, …, x n can be equal to 1: x
1
+x
2
+…x n
1 must be equal to 1: x
1
+x
2
+…x n
=1
Contingent decisions
x
1 can be equal to 1 only if x
2 is equal to 1: x
1
x
2
Set-Covering Problem
For member i of set 1, let S i to “cover” member i be the acceptable members of set 2 used
j
S i x j
1
Either-or constraint*
Use auxiliary binary variable and big M
191
Solving Integer Programs
192
BIP Branch and Bound
Example
The CALIFORNIA MFG. COMPANY is considering expansion by buiding a new factory in either Los Angeles or San Francisco, or both cities. It also is considering buiding at most one new warehouse, but the choice of location is restricted to a city where a new factory is being built.
The net present value and the capital required for each alternative is in the table. The total capital available is $10 million. The objective is to maximize the total net present value.
Factory in LA
Factory in SF
Warehouse in LA
Warehouse in SF
Net Present
Value
$9 million
$5 million
$6 million
$4 million
Capital
Required
$6 million
$3 million
$5 million
$2 million
193
Solution tree: x
1
= 0
2
B=9, X=(0,1,0,1)
Z*= 9
Fathomed
B&B Solution
1
All , B=16,
X=(5/6,1,0,1)
Z*= -
x
1
=1 x
2
= 0
3
B=16,
X=(1, 0.8, 0, 0.8) x
2
=1
4
B=13,
X=(1, 0, 0.8, 0)
Fathomed x
4
= 0
8
X=(1,1,0,0)
Fathomed
Z*= 14 x
3
= 0
6
B=16
X=(1,1,0, 0.5)
5
B=16,
X=(1,1,0,0.5) x
4
= 1
9
Infeasible
Fathomed x
3
= 1
7
Infeasible
Fathomed
194
Summary of BIP Branch and
Bound (Maximization Prob.)
For minimization problem: first convert to a maximization problem by multiplying -1 to the objective fn (remember to change the sign back for the optimal solution)
Initialization
Set initial incumbent (Z * ) = -
Apply bounding, fathoming, and optimality test to the whole problem
Iteration
Branching: branch remaining subproblems created most recently
(break ties by selecting larger bound ) by fixing next variable at 0 and 1. Choose the first one in the natural ordering to be the branching variable .
Bounding: the optimal Z value of LP relaxation gives the bound.
Rounding down bound if all obj. fn. coefficients are integers.
Fathoming: Apply the three fathoming tests.
Optimality test: Stop when there are no remaining subproblems; the current incumbent is optimal.
195
Summary of Fathoming Tests
Test 1: Its bound
Z *
Test 2: Its LP relaxation has no feasible solution
Test 3: The optimal solution for its LP relaxation is integer . If this solution is better than the incumbent, it becomes the new incumbent, and test 1 is reapplied to all unfathomed subproblems.
196
Another BIP Branch&Bound
Example
Max Z = 4x
1 s.t.
5x
1
+8x
2
+9x
2
+6x
3
+6x
3
12 x i
=0 or 1 (i=1,2,3)
197
Review of Mixed Integer
Programs
“MIP”
Both integer and continuous variables max z = 3x
1
+ 2x
2 s.t. x
1
+x
2
6 x
1
, x
2
0, x
1 integer
198
MIP Branch-And-Bound
Changes from BIP branch-and-bound:
Select branching variable only from the integerrestricted variables that have a noninteger value in the optimal solution for the current LP relaxation
Branching based on x j
[x j
* ] and x j
[x j
* ]+1 x j
—branching variable, [x j
* ]=greatest integer
x j
*
Never rounding down Z for MIP (due to possible noninteger decision variables)
For fathoming test 3, only check if integer-restricted variables are integer
199
Summary of MIP Branch and
Bound (Maximization Prob.)
Initialization
Set Z * = -
Apply bounding, fathoming, and optimality test to the whole problem
Iteration
Branching: branch remaining subproblems created most recently
(break ties by selecting larger bound ). Choose the first one as the branching variable among the integer-restricted variables with noninteger value in the optimal solution. Branching based on x j
[x j
* ] and x j
[x j
* ]+1.
Bounding: the optimal Z value of LP relaxation gives the bound.
Fathoming: Apply the three fathoming tests.
Optimality test: Stop when there are no remaining subproblems; the current incumbent is optimal.
200
Summary of Fathoming Tests
Test 1: Its bound
Z *
Test 2: Its LP relaxation has no feasible solution
Test 3: The optimal solution for its LP relaxation has integer values for the integer-restricted variables. If this solution is better than the incumbent, it becomes the new incumbent, and test 1 is reapplied to all unfathomed subproblems.
201
MIP Branch & Bound
Example
From H&L p. 518:
Max Z = 4x
1 s.t.
x
1
1
+ x and x i x i x
- 2x
2
+ 7x
3
2
6x
1
-5x
2
-x
1
+5x
-x
3
3
+2x
3
-2x
4
- x
4
10
1
0
3
0, (i=1,2,3,4) is an integer, for i=1,2,3
202
Suggested Reading
Grandine, “Assigning Season Tickets Fairly,”
Interfaces 28:4, Jul/Aug 1998
How to assign pooled season baseball tickets fairly among pool participants
Allows personal restrictions and preferences
Results considered more “fair” than intuitive or simplistic assignment methods
203
Suggested Reading
Bertsimas, Darnell, Soucy, “Portfolio Construction through Mixed Integer Programming.., Interfaces
29:1, 1999.
Construct investment portfolios to meet financial goals
1.
2.
3.
4.
5.
Outcomes
Keep existing clients
Reduced stock names by 40-60%
Reduced annual trading costs by $4 million
Improved trading process
Better market analysis
204
Nonlinear Programming
Ch. 12
205
Nonlinear Programming
Basic concepts
Unconstrained optimization
Constrained optimization
Nonlinear examples
Suggested Reading: 12.1, 12.2, 12.4
Outline
206
A Standard Form of NLP
Problem max f(x
1
, …, x n
) s. t.
g i
(x
1
, …, x n
) b i x
1
, …, x n
0 for i=1, 2, …, m.
where f and/or g i are given nonlinear functions.
207
NLP Example (1)
It costs a company c dollars per unit to manufacture a product. If the company charges p dollars per unit for the product, customers demand D(p) units. To maximize profits, what price should the firm charge?
208
NLP Example (2)
If K units of capital and L units of labor are used, a company can produce KL units of manufactured good. Capital can be purchased at $4/unit and labor can be purchased at $1/unit. A total of $8 is available to purchase capital and labor. How can the firm maximize the quantity of the good that can be manufactured?
209
NLP Example (3)
Truckco is trying to determine where they should locate a single warehouse. The positions in the x-y plane (in miles) of their four customers and the number of shipments made annually to each customer are given in the table. Truckco wants to locate the warehouse to minimize the total distance trucks must travel annually from the warehouse to the four customers.
Customer X
1
2
5
10
3
4
0
12
Y
10
5
12
0
# of Shipments
200
150
200
300
210
Nonlinear
Convex and concave functions
Convex set
Global optimum
Local optima
Terminology
211
Example of Nonlinear
Functions
Functions with terms that are more complicated than a single variable multiplied by a coefficient
f(x) = 10x 2
f(x,y) = 8xy
f(x) = exp(x)
f(x,y) = (ln(xy)) 3/2
f(x,y,z) = 10x + 20y + 30z Linear!
212
f(x)
Concave
Any point on a line segment connecting any two points on f(x) is
f(x) d
2 f dx
2
0 , for all x
Concave and Convex
Functions d
2 f
0 , for all x dx
2
Any point on a line segment connecting any two points on f(x) is
f(x)
Convex x
Sum of concave (convex) functions are concave (convex)
213
f(x)
Convex
Concave or Convex Function?
Concave
Neither
Both !
x
214
Convex Set
Convex set : for each pair of point in the set, the entire line segment joining these two points is also in the set.
Convex
Convex
Nonconvex
Nonconvex
Nonconvex
215
Global Optimum
Point that is maximum (minimum) over the entire range of a function
Global Optimum
216
Local Optimum
Point that is maximum (minimum) over a segment of the range of a function
Local optimum
Global optimum
217
Local
Maximum
Local or Global Optimum ?
Local
Minimum
218
Local Optimum
If f’(x )=0 and f”(x maximum. If f’(x x
0
0 0
)<0, then x
0
)=0 and f”(x
0
0 is a local
)>0, then is a local minimum.
219
Examples
Show f(x)=x 1/2 is a concave function for x>0.
Is f(x)=x 3 -x 2 convex or concave?
Find the local maxima and local minima of f(x)=-x+x 2 +x 3
220
Gradient Search Methods
Looking for (global) optimum
Dependent on starting point!
Excel uses gradient search
Global
Optimum
Local
Optimum
221
Optimality Results
For NLP problem with no constraints, if the objective function is concave (convex) local maximum (minimum)
global maximum (minimum)
For NLP problem with constraints, if the objective function is concave (convex) and the feasible region is a convex set local maximum (minimum)
global maximum (minimum)
The feasible region for any LP problem is a convex set
Under standard form, if g i
(x
1
, …, x n
) are convex functions, for all i, the feasible region for a NLP is a convex set.
222
max f(x) = 12x - 3x 4 - 2x 6 max f(x,y) = 5x - x 2 + 8y - 2y 2 s. t.
3x + 2y 6 x 2 +y 2 4 x 0, y 0
Optimality Examples
223
Ch. 9
224
Math Programming
Intro to LP
Solving LP’s
LP Sensitivity
LP Applications
Integer Programming
Nonlinear programming
Topics Covered
Other Models
Network Theory
Queuing Theory
Markov Chains
225
Terminology
Shortest-path problem
Minimum spanning tree problem
Maximum flow problem
Minimum cost flow problem
Suggested readings: 9.1—9.6
Outline
226
Terminology arc (link) nodes directed arc connected network unconnected cycle (directed) spanning tree:
• connected network
• no cycles
227
Shortest Path Problem
Undirected and connected network
Find the shortest (distance, cost, time) route from one node (origin) to another node
(destination) given a network with known arc penalties (distance, cost, time)
Solve using shortest-path algorithm
228
Shortest Path Example
The road system of SEERVADA PARK is shown below.
Location O is the entrance. Other letters are ranger stations. The numbers are distances in miles. Station T has a scenic wonder. Determine which route from the entrance to station T has the smallest total distance.
Entrance
O
2
4
A
5
C
1
2
7
B
4
4
3
E
1
D
5
7
T
229
1
O
3
O
5
O
2
2
4
2
4
4
A
7
2
5
C
1
B
4
3
E
1
D
4
A
7
2
5
1
B
4
3
E
1
D
C
A
4
5
C
1
7
2
B
4
4
3
E
1
D
7
7
7
5
5
5
T
T
O
O
2
2
Shortest Path Algorithm
2
A
7
2
T
5
5 4
B D
7
4
C
1
4
3
E
1
4
A
7 T
2
5
5 4
B D
7
4
C
1
4
3
E
1
T
Unsolved nodes
Solved nodes
230
Min Spanning Tree Problem
Undirected and connected network
Minimize (cost, distance) of connecting all nodes in the network (find a spanning tree with minimal distance)
Solve using Minimum Spanning Tree
Algorithm
231
Min Spanning Tree Example
In SEERVADA PARK, telephone lines must be installed under the roads. Lines will be installed under JUST enough roads to provide connection between EVERY pair of stations. Where should the lines be laid with a
MINIMUM total number of miles of line installed?
O
2
4
A
5
C
1
2
7
B
4
4
3
E
1
D
5
7
T
232
Spanning Tree
2
A
2
7
5
O
5
B
4
D
4
1
3 1
7
C E
4
Not a spanning tree: unconnected
T
O
A
2
2
7
5
B
4
D
4
1
3 1
C 4
E
Not a spanning tree: cycles
7
5
A
2
2
7
O
5
B
4
D
4
1
3 1
C E
4
Spanning tree: distance=24, not
7
5 optimal
T
A
2
2
7
O
5
B
4
D
4
1
3 1
C E
4
Spanning tree: distance=20, not
7
5 optimal
any spanning tree has (#nodes – 1) links
Find the spanning tree with minimal distance
T
T
233
Minimum Spanning Tree
Algorithm
Starting from O:
O
2
4
1
A
2
5
2
1
3
B
C
4
Minimal distance = 14
7
4
4
3
E
D
1 5
6
5
7
T
Algorithm:
Start from any node, connect it to the nearest node
Repeat connecting to the nearest unconnected node until all nodes are connected
234
Maximum Flow Problem
Directed and connected network
Find the maximum flow between a
“source” and “sink” ( e.g.
, supply and demand) through a network of branches with known flow capacities
Augmenting Path Algorithm
235
Maximum Flow Example
In SEERVADA PARK, trams are used to transport sightseers from the entrance to station T. The number at the base of each arrow gives the upper limit on the number of tram trips. Determine how to route the various tram trips to maximize the number of trips.
A
1
3
Scenic
Wonder
(sink)
T
5
Entrance
(source)
O
4
7
2
B
5
4
D
9
C
4
1
E 6
236
Terminologies
Residual Network : a network showing remaining arc capacities remaining arc capacity from O
B remaining arc capacity from B
O
O
7 0
B
Add a flow of 5 from O to B:
O
2 5
B
Augmenting Path : a directed path from the source to the sink in the residual network such that every arc on this path has strictly positive remaining arc capacity.
Residual capacity of augmenting path: the minimum of the remaining arc capacities on the augmenting path.
237
Remove the arrows:
0
A
3
1
5
O
4
7
2
0
0
B
4
5
0
0
1
0
0
D
9
0
0
C
4 0
E
6
2
3
A
0
1
2
O
4
2
0
0
C
4
2
0
5
B
4
0
0
5
0
E
1
3
0
D
6
1
3
0
Augmenting Path Algorithm
0
T
O
5
2
4
5
T
1
O
4
2
0
0
A
3
1
0
C
4
2
0
5
B
4
0
4
A
0
0
2
1
5
B
3
0
0
0
C
4
Identify an augmenting path
Add the flow of the residual capacity in this path.
1
0
5
0
E
1
0
0
D
9
1
3
1
5
0
E
1
3
0
D
5
1
0
5
T
4
5
T
Repeat until no augmenting path
238
1
O
4
4
0
4
A
0
0
0
0
C
4
2
1
7
B
1
0
3
5
0
E
1
3
0
D
3
1
Augmenting Path Algorithm
(cont.)
6
5
T
1
O
3
0
4
A
0
0
2
1
7
B
1
0
1
0
C
3
6
O
1
0
2
4
A
0
0
2
0
C
2
2
1
7
B
1
0
3
5
2
E
0
3
1
D
2
0
7
6
T
1
0
O
1
4
A
0
0
2
7
B
1
0
1
3
0
C
1
Identify an augmenting path
Add the flow of the residual capacity in this path.
Repeat until no augmenting path
5
3
5
1
E
0
3
1
D
2
1
7
4
4
3
E
0
3
1
D
1
0
7
5
T
8
6
T
239
Another Max Flow Example
An airline company must determine how many connecting flights daily can be arranged from Juneau to
Dallas. Connecting flights must stop in Seattle and then stop in Los Angeles or Denver. The number on each arc is the limit of the number of daily flights between pairs cities. Help the company to maximize the number of connecting flights daily from Juneau to Dallas.
J
3
S
2
3
L
De
2
1
Da
240
Minimum Cost Flow Problem
A directed and connected network with at least one supply node and at least one demand node.
A capacity ( u ij
) is assigned to arc i
j
The cost per unit flow through arc i
j is c ij
The net flow ( b i
) at node i is:
>0 for supply node
<0 for demand node
=0 for other nodes
The objective is to minimize the total cost of sending available supply to satisfy given demand
241
Minimum Cost Flow Problem
Generalized network problem
Transportation, assignment, max flow, shortest path, …
Formulated as linear program
Wide utility, flexible, general
Integer solution guaranteed
Solved using Network Simplex Method
We will not review in this class
General LP formulation…
242
Min Cost Flow Example—
Distribution Network
Products are produced at two factories, A and B, and shipped to two warehouses, D and E. C is a distribution center.
c
—cost per unit flow b —net flow u —arc capacity
2
10
[50]
A
4
3
B
[40]
9
[-30]
D
C
2
1
80 E
[-60]
3
243
Min Cost Flow Example—
Traffic Assignment
Each hour, an average of 900 cars enter the network at node 1 and seek to travel to node 6. The numbers above each arc are Max # of cars per hour (Time to traverse the arc). Formulate an LP that minimizes the total time required for all cars to travel from node 1 to node 6.
800(10)
600(30)
2
100(70)
300(10)
1
600(50)
3
400(60)
5
4
400(60)
600(30) 6
600(30)
244
Special Cases
Transportation problem:
Supply node: source
Demand node: destination u ij
=
Assignment problem:
Same formulation as transportation problem, plus:
# supply nodes = # demand nodes
b i
=1 for each supply node b i
=-1 for each demand node
Shortest-path problem:
Supply node: origin (supply =1)
Demand node: destination (demand =1)
Replace an undirected link with a pair of directed arcs in opposite directions u ij
=
245
A Network Model for Project
Management
246
Project Management
When to use:
Management complex projects
Many parallel tasks
Deadlines and milestones must be met
Difficult to know “what to do first”
Difficult to know when project is in trouble
247
Building a new airport
Designing a new computer product
Launching an advertising campaign
Construction projects of all types
Maintenance projects
Curriculum reviews
Examples
248
Critical Path Method (CPM)
Critical Path Method (CPM)
Developed by DuPont (1950’s)
Plan and control maintenance of chemical plants
Credited with reducing length of maintenance shutdown by 40%
Suggested Readings: 22.1—22.3 (among additional chapters on the CD-ROM)
249
Critical Path Method (cont.)
Graphical method of portraying relationship of project activities
An activity is any discrete part or task of a project which takes resources and time to complete
Activities exhibit precedence relations (some must be completed before others can start)
Activities with their precedence relations form a project network
Critical Path Method finds the longest path through the resulting project network
250
Precedence Relations
Activity Immediate Predecessor Duration (days)
A
B
C
D
251
Simple Project Network
Activity “A” proceeds “B”
A
B
C
Represent precedence
relations as “arcs”
“Activity on Node” representation
D
252
Earliest
Start
Time
Latest
Start
Time
Activity
Name
ES
LS
EF
LF
Symbol for Activities
Earliest
Finish
Time
Latest
Finish
Time
Activity
Duration
253
A
4
C
5
B
3
Finding the Critical Path
D
2
254
Start at time t=0
0
A
4
C
5
B
3
Finding the Critical Path
D
2
255
0
0+4=4
A
4
4
C
5
B
3
Finding the Critical Path
D
2
256
0
A
4
4
4
B
3
Finding the Critical Path
D
2
4
C
5
257
0
A
4
4
Finding the Critical Path
4
B
3
7
D
2
4
C
9
5
258
0
A
4
4
Finding the Critical Path
4
B
3
7
?
D
2
4
C
9
5
259
0
A
4
4
Finding the Critical Path
4
B
3
7
9
D
2
4
C
9
5
260
0
A
4
4
Finding the Critical Path
4
4
B The earliest the project can complete is t =11
3
7
9
D
2
C
9
5
261
0
A
4
4
4
B
3
7
Finding the Critical Path
9
D
11
2
4
C
5
9
262
0
A
4
4
Finding the Critical Path
4
6
B
3
7
9
9
D
11
9
2
11
4
4
C
5
9
9
263
0
A
4
4 ?
Finding the Critical Path
4
6
B
3
7
9
9
D
11
9
2
11
4
4
C
5
9
9
264
0
A
4
0 4 4
4
6
B
3
7
9
Finding the Critical Path
9
D
11
9
2
11
4
4
C
5
9
9
265
0
A
4
0 4 4
4
6
B
3
7
9
Finding the Critical Path
9
D
11
9
2
11
4
4
C
9
5 9
266
S=0-0=4-4=0
0
A
4
0 4 4
Finding the Critical Path
4
6
B
3
7
9
S=9-7=2
S=11-11=0
9
D
11
9
2
11
4
4
C
5
9
9
S=9-9=0
267
S=0
0
A
4
0 4 4
Finding the Critical Path
4
B
7
6 3
9 S=0
9
D
11
9
2
11
4
C
9
4 5 9 S=0
268
Summary of CPM
Terminology
Critical Path: the chain of activities along which the delay of any activity will delay the project
Earliest Start Time (ES): the earliest that an activity could possibly start, given precedence relations
Latest Start Time (LS): the latest that an activity could possibly start without delaying the project
Earliest Finish Time (EF): the earliest that an activity could possibly finish
Latest Finish Time (LF): the latest that an activity could possibly finish without delaying the project
Activity Slack: the amount of “play” in the timing of the activity; slack = LST-EST = LFT-EFT
269
Example
Widgetco is about to introduce a new product (product 3).
One unit of product 3 is produced by assembling 1 unit of product 1 and 1 unit of product 2. The production has the following activities:
Activity
A. Train workers
Predecessors Time none
B. Purchase raw material none
C. Produce product 1 A, B
D. Produce product 2 A, B
8
7
6 days
9
E. Test product 2
F. Assemble products 1 & 2
D
C, E
10
12
270