EM 602 - Lecture 01 Introduction To LP PDF
EM 602 - Lecture 01 Introduction To LP PDF
MANAGEMENT SCIENCE
Lecture 1:
Introduction to Operations
Research and Liner Programming
Introduction
Operations Research (OR) / Management Science
A scientific approach to decision making that involves
operations of organizational systems.
The art of giving bad answers to problems to which otherwise
worse answer are given.
Quantitative Common Sense.
An aid for the executive in making decisions by providing
him/her with the needed quantitative information based on the
scientific method of analysis.
Simply, ways to effectively use information.
2
1
Introduction
Today’s business problems tend to be very complex
Businesses turn to algorithms to solve problems.
Management science models become useful when common
sense and intuition fail to solve the problems.
This class will present how quantitative methods can be used
to solve business problems.
The methods in this class can apply to many problems and
environments.
History of OR
1885: Optimal Shovel Load to maximize work (Frederick W. Taylor)
1917: Telephone Call Switching – queuing theory (A.K. Erlang)
World War II (WWII):
Search procedures
Optimal bomb patterns
Missile trajectories
Logistics
Birth of the ENIAC (Electronic Numerical Integrator And
Computer) – the first mainframe, calculated artillery firing tables.
2
History of OR (continued)
Post WWII all areas of study
Business: OM, Finance, Strategic Planning
Economics: Equilibriums, Econometrics
Civil Engineering: Optimal Construction
Chemical Engineering: Optimal Process Design
Computer Science: Switching, etc.
OR Today
IFORS
INFORMS
Mathematical Programming Society
Transportation Science
Interfaces
3
OR Today
The Methodology of OR
Problem Definition
Data Collection
Feedback
Model Formulation
Model Solution
Implementation
4
Models and Purpose
The purpose of a mathematical model is to represent the essence of a
problem in a concise form, providing several advantages:
Enables managers to understand the problem better;
Helps to define the scope of the problem, the possible solutions, and the data
requirements
Types of Models
Descriptive models: models that simply describe a situation.
Optimization models: models that suggest a desirable course
of action.
Example
Waiting line: Convenience store with a single cash register.
The manager suspects that excessive waiting times in lines to the
register hurt the business.
The manager builds a mathematical model to help understand the
problem, and suggest improvements to the current situation.
10
10
5
Descriptive Models
A descriptive model can take at least two forms.
One form is to show all of the elements of the problem in a diagram, as in
Figure below.
Helps the company to visualize the problem and to better understand how
the elements of the problem are related.
11
11
Optimization model
The company/manager uses methods or/and software
to quickly search through all potential sets of
decisions and find the one that maximizes total NPV
while staying within the budget.
12
12
6
OR Modeling Techniques
Operation Research (OR) / Management Science is best
defined by the techniques rather than the problems (i.e., the
problem set is unbounded.)
13
14
14
7
General LP Model
Suppose we have n-activities : x1, x2,……., xn and m resources
Let bi, i ={1, 2,....., m} = total amount of i-th resource available
15
3. xj 0 j = 1,2,.........,n
16
16
8
General LP Model – Matrix Notation
s.t. Ax b x1
x
x
2
x0 a11 a12 ... a1n
a a22 ... a1n
xn A 21
b1
b am1 am 2 ... amn
b 2
bm
17
17
LP Model Solution(s)
x1
x
x
2
A solution: Any realization of vector
xn
Feasible Solution : Any solution that satisfies all
constraints
18
18
9
Assumptions in a General LP Model
1. Proportionality: Activity levels are directly proportional to their contributions to
the objective function and each constraint
One unit increase in xj increases Z by cj.
One unit increase in xj consumes aij units of the i-th resource (i.e. (reduces
bj by aij).
2. Additivity: Activities are independent.
3. Divisibility: Activity units can be divided into fractional levels (does not, and
usually is not, have to be strictly integer).
4. Deterministic Model: Problem parameters are known and constant.
Note that when parameters are not fixed in value (constant) but can assume values
with associated probability, we say that the model is probabilistic or stochastic.
19
19
Canonical Form of an LP
Min / Max OR
c1 x1 c2 x2 cn xn
Min / Max
s.t. Z cx
a11 x1 a12 x2 a1n xn b1 0 s.t.
a21 x1 a22 x2 a2 n xn b2 0 Ax b
x0
am1 x1 am 2 x2 amn xn bm 0
x1 0, x2 0, , xn 0
20
20
10
Canonical Form of an LP
xn1
n
1. aij x j bi add SLACK
j 1
n
aij x j xn1 bi ; xn1 0
j 1
n
2. aij x j bi subtract SURPLUS xn1
j 1
xn1 0
n
aij x j
j 1
xn 1 bi ;
x j 0, x j 0
x j x j x j
21
22
22
11
Example 1 – Diet Problem
Diet Problem
- 1945 George Stigler
Data
Nutrient Gal. Milk Lb. Tuna Lb. Bread Lb. Spinach RDA
Vitamin A 6,400 237 0 34,000 5,000 IU
Vitamin C 40 0 0 71 75 mg
Vitamin D 540 0 0 0 400 IU
Iron 28 7 13 8 12 mg
23
40 x1 + 0 x2 + 0. x3 + 71 x4 75
540 x1 + 0 x2 + 0. x3 + 0. x4 400
28 x1 + 7 x2 + 13 x3 + 8 x4 12
x1 0 , x2 0 , x3 0 , x4 0
24
24
12
Example 2 – Portfolio Selection
$500,000 available for investment
Maximize Yield
s.t. Budget limit
Risk acceptable level
25
25
x2 0.3 ( x1 + x2 ) or
x1 , x2 , x3 , x4 , x5 0
26
26
13
Example 3 – Air Pollution
Controlling Air Pollution -- NORI & LEETS CO.
Given
Clean Air Standards for the Next Nori & Leets Co.
Pollutant Required Reduction in Annual Emission Rate
(Million Pounds)
Particulates 60
Sulfur oxides 150
Hydrocarbons 125
Reduction in Emission Rate (in Millions of Pounds per year) from the Maximum Feasible
Use of an Abatement Method for Nori & Leets Co.
27
Objective:
Minimize the total annual cost
Constraints:
Annual emission reduction rate must be met.
No method could be overused, i.e., the fraction of the maximum feasible use
of an abatement method couldn’t exceed 100%.
28
28
14
Example 3 – Air Pollution
Decision variables:
29
29
s.t.
1. Emission reduction:
12X1 + 9X2 + 25X3 + 20X4 + 17X5 + 13X6 >=60
35X1 + 42X2 + 18X3 + 31X4 + 56X5 + 49X6 >=150
37X1 + 53X2 + 28X3 + 24X4 + 29X5 + 20X6 >=125
2. Technological limit:
Xj<=1, for j=1,2,…,6
3. Nonnegativity:
Xj>=0, for j=1,2,…,6
30
30
15
Example 3 – Air Pollution
31
31
32
32
16
Example 4 – Personnel Scheduling
Each agent work an 8-hour shift 5 days per week, and the authorized shifts are shown in
the above table, for example: shift 1 is from 6:00 A.M. to 2:00 P.M. This problem is mix
of activity level kind of problem, where activities correspond to shifts and number of
agents for each shift corresponds to level of activity. For the mix of activity levels problem,
the decision variables are always the levels of activities.
Objective:
Minimize the personnel cost
Constraint:
For each time period, the number of total agents from each possible shift meets the
minimum number requirement -- the number of agents for each time period.
33
33
s.t.
X 1 >= 48 (6 -8 A.M.)
X 1 + X 2 >= 79 (8 -10 A.M.)
X 1 + X 2 >= 65 (10 -12 A.M.)
X 1 + X 2 + X 3 >= 87 (12 -2 P.M.)
X 2 + X 3 >= 64 (2 -4 P.M.)
X 3 +X4 >= 73 (4 -6 P.M)
X 3 +X4 >= 82 (6 -8 P.M.)
X 4 >= 43 (8 -10 P.M.)
X 4 +X5 >= 52 (10 -12 P.M.)
X 5 >=15 (12 P.M –6 A.M.)
and
Xj >= 0, for j = 1, 2, 3, 4, 5.
nd
Here, the 2 , 6th constrains and three nonnegative constraints -X1 >= 0, X 4 >= 0, X 5 >= 0
are redundant constraints and can be deleted.
34
34
17
Example 4 – Personnel Scheduling
Optimal solution for this model: (X1, X2, X3, X4, X5 ) = ( 48, 31, 39, 43, 15 )
Accordingly Z = 30,610.
Note: In the above problem, the decision variables should be integer. Note that
there are no constraints specifying that in the problem statement. Fortunately, the
above solution happens to be integer. Otherwise, we will have to add the integer
constraints and turn the problem into an integer programming model.
35
35
36
36
18
Example 5 – minimum cost flow problem
$900/unit
50 units 30 units
F1 W1
produced needed
Notation:
$400/unit F1: F2: 2 factories
W1: W2: 2 warehouse
DC $200/unit $300/unit
DC: a distribution center
$200/unit 10 units max.
$100/unit
80 units max
$300/unit
40 units F2 W2 60 units
produced needed
37
Objective Function:
Minimize:
Z = 2XF1-F2 + 4XF1-DC + 9XF1-W1 + 3XF2-DC + XDC-W2 + 3XW1-W2 + 2XW2-W1
S.T.
38
19
Example 5 – minimum cost flow problem
2. Upper-bound constraints:
XF1-F2 <= 10, XDC-W2 <= 80
3. Nonnegativity constraints:
XF1-F2 >= 0, XF1-DC >= 0, XF1-W1 >= 0, XF2-DC >= 0, XDC-W2 >= 0,
XW1-W2 >= 0, XW2-W1 >= 0.
Z = $49,000
39
39
40
20
Example 6 – Post Office Problem
Solution:
xj Number of employees beginning work on day j
The objective function is
min z x1 x2 x3 x4 x5 x6 x7
The post office must insure that enough employees are working on
each day of the week. For example, at least 17 employees must work
on Monday. Who is working on Monday? Everybody except the
employees who begin work on Tuesday or on Wednesday. This means
that the number of employees working on Monday is x1+x4+x5+x6+x7.
To ensure that at least 17 employees are working on Monday, we
require that the constraint x1+x4+x5+x6+x7≥17 be satisfied.
41
41
42
21
Example 7 – An inventory model
Sailco Corporation must determine how many sailboats should be produced
during each of the next four quarters (one quarter= three months). The
demand during each of the next four quarters is as follows: first quarter, 40
sailboats; second quarter, 60 sailboats; third quarter,75 sailboats; fourth
quarter, 25 sailboats. Sailco must meet demands on time. At the beginning
of the first quarter, Sailco has inventory of 10 sailboats. At the beginning of
each quarter Sailco must decide how many sailboats should be produced
during each quarter. For simplicity we assume that sailboats manufactured
during a quarter can be used to meet demand for that quarter. During each
quarter, Sailco can produce up to 40 sailboats with regular-time labor at a
total cost of $400 per sailboat. By having employees work overtime during
a quarter, Sailco can produce additional sailboats with overtime labor at a
total cost of $450 per sailboat.
At the end of each quarter (after production has occurred and the current
quarter’s demand has been satisfied), a carrying or holding cost of $20 per
sailboat is incurred. Use linear programming to determine a production
schedule to minimize the sum of production and inventory cost during the
next four quarters.
43
43
Objective function is
min z 400 x1 400 x 2 400 x3 400 x 4 450 y1 450 y 2
450 y3 40 y 4 20i1 20i 2 20i3 20i4
For quarter t,
Inventort at the end of quarter t inventory at the end of quartert 1
quarter t production quarter t demand 44
44
22
Example 7 – An inventory model
Quarter t demand will be met on time if and only if it 0 (t 1,2,3,4)
The formulation of the problem is
45
45
46
46
23
Solving LPs
Methods Software
Graphical LINDO/LINGO
47
47
Example Problem
A new company Wyndor Glass Company has:
3 plants
making 2 products.
8' glass door : product 1
Products =
4 6' window : product 2
Resources : Production Capacities in 3 plants are as follows:
1 1 0 4
2 0 2 12
3 3 2 18
Unit Profit 3 5
($)
48
48
24
Example Problem (continued)
Note :
49
49
z Total Profit
50
50
25
Example Problem (continued)
3. Restrictions (Constraints) on Production Process
Capacity Constraints:
plant 1 : 1 x1 0 x2 4
plant 2 : 0 x1 2 x2 12
plant 3 : 3 x1 2 x2 18
Non-negativity Constraint :
51
51
Graphical Solution
Consider the region formed by the constraints in form of
inequalities
x2
x1 = 4
(2,6)
(0,6) 2x2 = 12
(4,3)
3x1 + 2x2 = 18
x1
(4,0)
52
52
26
Graphical Solution (continued)
Now, in order to maximize the objective function Z 3 x1 5 x 2
plot the line 0 3x1 5x2
Next, draw an array of parallel lines (until the next line would leave the feasible region).
x2
Note that the extreme x1 = 4
For Z=36
point with coordinates
(2,6)
(0,6) 2x2 = 12
x1 2 and x2 6
For Z=20
gives the largest possible (4,3)
53
53
54
27
Properties of a Linear Program
If there is exactly one optimal solution, then it must be a corner (point) -
feasible solution.
If there are multiple optimal solutions, then at least two must be adjacent corner-
feasible solutions.
There exist only a finite number of corner feasible solutions if there are a finite
number of constraints and variables.
Infeasibility
Unboundedness
55
55
Required Resources
Labor ( hrs / toy )
Finishing Carpentry
Soldiers 2 1
Trains 1 1
56
56
28
Example: Giapetto’s Woodcarving, Inc.
Available Resources
The problem: Find the optimal product mix that maximizes weekly profit!
57
57
Decision Variables
Objective Function
58
58
29
Example: Giapetto’s Woodcarving, Inc.
$ soldiers $ trains
Weekly Revenue =
soldiers week train week
Weekly Revenue = 27 x1 21x2
Weekly Cost = Weekly raw material cost + Weekly variable labor + O / H cost
Weekly Cost = 10 x1 9 x2 14 x1 10 x2
Maximize Profit
Maximize Z 3x1 2 x2
59
59
Total finishing hrs finishing hrs. soldiers made finishing hrs. trains made
Week soldier Week train Week
= 2 x1 x2
Constraint 1
2 x1 x2 100
Constraint 2
x1 x2 80
Constraint 3
x1 40
60
60
30
Example: Giapetto’s Woodcarving, Inc.
Problem Statement
s.t.
2 x1 x2 100 ( Finishing )
x1 x2 80 ( Carpentry )
x1 40 ( Demand )
x1 0 ( non-negativity)
x2 0 ( non-negativity)
61
61
X2
2X1 + X2 = 100
(0, 80)
X1 = 40
(20, 60)
Z= 3X1 + 2X2
(40, 20)
For Z = 60
X1 + X2 = 80
For Z = 30
X1
(40, 0) (80, 0)
62
62
31
Review of Linear Algebra
3x 2 y 5 z 3 3 2 5
2 x y 4 z 2 Coefficient matrix A 2 1 4
1 4 7
x 4 y 7z 1
3 2 5 3
Augmented matrix A 2 1 4 2
1 4 7 1
1 # # #
0 1 # #
0 0 1 #
63
63
64
32
The Gauss - Jordan Method
Type 2 ERO
Multiply row i of A by a non-zero scalar C. For some row j other than i (j≠i), let row j
of A’ = C ( row i ) + row j
1 2 3 4
Let the other rows of A’ be the same as A. A = 1 3 5 6
0 1 2 3
4 1 3 5 6 0 1 2 3 4 13 22 27
1 2 3 4
A’ = 1 3 5 6
4 13 22 27
65
65
1 2 3 4 0 1 2 3
𝐴 1 3 5 6 𝐴′ 1 3 5 6
0 1 2 3 1 2 3 4
66
66
33
The Gauss - Jordan Method (continued)
Problem : Solve x1 x2 2
2 x1 4 x 2 7
x1 x 2 2
2 x2 3
1
Multiply the second equation by yielding :
2
x1 x 2 2
3
x2
2
67
67
1
x1
2
and from here
3
x2
2
68
68
34
The Gauss - Jordan Method (continued)
Finding a solution by the Gauss - Jordan Method
2 x1 2 x 2 x3 9 x1 =?
x1 x 2 2 x 3 5 x3 =?
x1 =1
in this case: x2 =2
x3 =3
2 2 1 9
The augmented matrix representation is given as : A | b = 2 1 2 6
1 1 2 5
69
69
2 2 19
A | b = 2 1 2 6
1 1 2 5
1 0 01
A|b= 0 1 02
0 0 13
70
70
35
The Gauss - Jordan Method (continued)
The Plan
We begin by using type 1 - 3 EROs to transform the first column of the
initial matrix (i.e. A | b ) into :
1
0
0
Then, we use EROs to transform the second column of the resulting matrix into :
0
1
0
Finally, we use EROs to transform the third column of the resulting matrix into :
0
0
1
71
71
-2 ( row 1 of A1 | b1 ) + row 2 of A1 | b1
1 1 1/ 2 9 / 2
A2 | b2 = 0 3 1 3
1 1 2 5
72
72
36
The Gauss - Jordan Method (continued)
Step 3. Replace row 3 of A2 | b2 by :
-1 ( row 1 of A2 | b2 ) + row 3 of A2 | b2
1 1 1/ 2 9 / 2
A3 | b3 = 0 3 1 3
0 2 3 / 2 1 / 2
1
0
0
73
73
1 0 5/ 6 7 / 2
0 1 1 / 3 1
A5 | b5 =
0 2 3 / 2 1 / 2
74
74
37
The Gauss - Jordan Method (continued)
1 0 5/ 6 7 / 2
0 1 1 / 3 1
Step 6. Replace row 3 of A5 | b5 by : A5 | b5 =
0 2 3 / 2 1 / 2
2 ( row 2 of A5 | b5 ) + row 3 of A5 | b5
1 0 5/ 6 7 / 2
A6 | b6 = 0 1 1 / 3 1
0 0 5 / 6 5 / 2
0
1
0
75
75
1 0 5/ 6 7 / 2
A7 | b7 = 0 1 1/ 3 1
0 0 1 3
5
Step 8. Replace row 1 of A7 | b7 by : - (row 3 of A7 | b7 ) + row 1 of A7 | b7
6
1 0 0 1
A8 | b8 = 0 1 1 / 3 1
0 0 1 3
76
76
38
The Gauss - Jordan Method (continued)
Step 9. Replace row 2 of A8 | b8 by :
1 0 0 1
1 A8 | b8 = 0 1 1/ 3 1
( row 3 of A8 | b8 ) + row 2 of A8 | b8
3 0 0 1 3
1 0 0 1
A9 | b9 = 0 1 0 2
0 0 1 3
x2 =2
x3 = 3
Since A9 | b9 was obtained from A | b via EROs, the unique solution to A | b must also
be: x1 = 1, x2 = 2, x3 = 3
77
77
39