Uploaded by qwpo

QM Lecture 3 230318 162307

advertisement
Overview of Lecture 3
▪ Simplex method for a maximization problem.
Lecture 3
1
Introduction
▪ Simplex Method
• A general solution technique for solving LP
problems.
• A set of steps for solving a LP problem using a
table.
• If replicates the process of graphical analysis of
moving from one extreme point to anothe better
extreme point.
Lecture 3
2
Introduction
4𝑥1 + 3𝑥2 = 120
1𝑥1 + 2𝑥2 = 4
Solution
(𝑥1 , 𝑥2) = (24, 8)
▪ How to solve the above system of equations?
▪ There are many ways, but consider the
following steps.
4𝑥1 + 3𝑥2 = 120
1𝑥1 + 2𝑥2 = 40
To have coefficient of 1 for 𝑥1
in Eq (1), divide by 4
To have coefficient of zero for 𝑥1 in Eq (2)
Compute -Eq (1)+Eq (2)
3
𝑥 = 30
4 2
1𝑥1 + 2𝑥2 = 40
1𝑥1 +
3
1𝑥1 +
𝑥 = 30
4 2
0𝑥1 +
Lecture 3
5
4
𝑥2 = 10
3
Introduction
1𝑥1 +
0𝑥1 +
3
𝑥 = 30
4 2
5
4
𝑥2 = 10
To have coefficient of one for 𝑥2 in Eq (2)
Divide by 5/4 for Eq (2)
3
1𝑥1 +
𝑥 = 30
4 2
5
4
𝑥2 = 10
1𝑥1 +
3
𝑥 = 30
4 2
𝑥2 = 8
To have coefficient of zero for 𝑥2
in Eq (1), -3/4 Eq (2)+Eq (1)
Then, we have a solution
Lecture 3
1𝑥1 + 0𝑥2 = 24
𝑥2 = 8
𝑥1 = 24
𝑥2 = 8
4
Introduction
▪ Solve using tables.
4𝑥1 + 3𝑥2 = 120
1𝑥1 + 2𝑥2 = 40
To have coefficient of 1 for 𝑥1
in Eq (1), divide by 4
𝑥1
𝑥2
120
4
3
40
1
2
Lecture 3
3
1𝑥1 +
𝑥 = 30
4 2
1𝑥1 + 2𝑥2 = 40
𝑥1
𝑥2
120/4
4/4
¾
40
1
2
5
Introduction
▪ Solve using tables.
To have coefficient of zero for 𝑥1 in Eq (2)
Compute -Eq (1)+Eq (2)
𝑥1
𝑥2
120/4
1
¾
40
1
2
Lecture 3
1𝑥1 +
0𝑥1 +
3
𝑥 = 30
4 2
5
4
𝑥2 = 10
𝑥1
𝑥2
120/4
1
¾
10
0
5/4
6
Introduction
To have coefficient of one for 𝑥2 in Eq (2)
Divide by 5/4 for Eq (2)
1𝑥1 +
3
𝑥 = 30
4 2
𝑥2 = 8
𝑥1
𝑥2
120/4
1
¾
10
0
5/4
Lecture 3
𝑥1
𝑥2
120/4
1
¾
8
0
1
7
Introduction
To have coefficient of zero for 𝑥2
in Eq (2), -3/4 Eq (2)+Eq (1)
𝑥1
𝑥2
120/4
1
¾
8
0
1
Then, we have a solution
Lecture 3
1𝑥1 + 0𝑥2 = 24
𝑥2 = 8
𝑥1
𝑥2
24
1
0
8
0
1
𝑥1 = 24
𝑥2 = 8
8
One Maximization Problem
▪ First Step of Simplex Method.
• Transform into a standard form.
▪ Beaver Creek Pottery Company
• 𝑥1 : # of bowls.
• 𝑥2 : # of mugs.
Maximize 𝑍 = 40𝑥1 + 50𝑥2
Subject to 1𝑥1 + 2𝑥2 ≤ 40
4𝑥1 + 3𝑥2 ≤ 120
𝑥1 , 𝑥2 ≥ 0
Lecture 3
9
Standard Form
▪ Standard Form with Slack Variables
• 𝑠1 : amount of unused labor.
• 𝑠2 : amount of unused clay.
Maximize Z = 40𝑥1 + 50𝑥2 + 0𝑠1 + 0𝑠2
Subject to
1𝑥1 + 2𝑥2 + 𝑠1
= 40
4𝑥1 + 3𝑥2 +
𝑠2 = 120
𝑥1 , 𝑥2 , 𝑠1 , 𝑠2 ≥ 0
• Number of unknown variables is 4.
• But, number of equations is 2.
• The simplex method assigns zeros to 2 decision
variables.
• If 𝑥1 , 𝑠1 = 0, 0 , then 𝑥2, 𝑠2 = 20, 60 .
Lecture 2
10
Basic Feasible Solution
𝑥2
40
20
B
C
D
A
30
𝑥1
40
A
B
C
D
𝑥1, 𝑥2 = (0, 0)
𝑥1, 𝑠1 =(0, 0)
𝑠1 , 𝑠2 =(0, 0)
𝑥2, 𝑠2 =(0, 0)
𝑠1 , 𝑠2 = (40, 120)
𝑥2, 𝑠2 =(20, 60)
𝑥1, 𝑥2 =(24, 8)
𝑥1, 𝑠1 =(30, 10)
▪ Basic Feasible Solution
• Feasible solution having
• # of variables with nonnegative values = # of constraints.
Lecture 2
11
Initial Step (1)
▪ Initial Simplex Tableau
𝑐𝑗
Basic
Variable
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
𝑧𝑗
𝑐𝑗 − 𝑧𝑗
▪ Initial Basic Feasible Solution
• The origin point is selected.
• Basic variable: 𝑠1 , 𝑠2 = 40, 120 .
Lecture 3
12
Initial Step (2)
▪ Initial Basic Feasible Solution
Basic
Variable
𝑐𝑗
Quantity
0
𝑠1
40
0
𝑠2
120
40
50
0
0
𝑥1
𝑥2
𝑠1
𝑠2
Coeff. of
objective
func.
# of rows
= # of
constraints.
𝑧𝑗
𝑐𝑗 − 𝑧𝑗
Coeff. of
objective func
for basic
variables.
Lecture 3
13
Initial Step (3)
▪ Constraint Coefficients
1𝑥1 + 2𝑥2 + 𝑠1
4𝑥1 + 3𝑥2 +
𝑐𝑗
Basic
Variable
= 40
𝑠2 = 120
40
50
0
0
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
0
𝑠1
40
1
2
1
0
0
𝑠2
120
4
3
0
1
𝑧𝑗
𝑐𝑗 − 𝑧𝑗
Lecture 3
14
Initial Computation (1)
▪ 𝒛𝒋 and 𝒄𝒋 − 𝒛𝒋 rows
• Need to compute
𝑐𝑗
Basic
Variable
40
50
0
0
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
0
𝑠1
40
1
2
1
0
0
𝑠2
120
4
3
0
1
𝑧𝑗
0
0
0
0
0
40
50
0
0
𝑐𝑗 − 𝑧𝑗
• 𝑧𝑗 is the inner product of 𝒄𝒋 with 𝒙𝒋 or 𝒔𝒋 .
Lecture 3
15
Initial Computation (2)
▪ Current solution
• 𝑠1 = 40, 𝑠2 = 120
▪ One unit increase of 𝑥1
1𝑥1 + 𝑠1 = 40
4𝑥1 + 𝑠2 = 120
Increase 1 unit of 𝑥1
• Decrease of 1 unit of 𝑠1 .
• Decrease of 4 units of s2.
• Objective Function
Z = 40𝑥1 + 50𝑥2 + 0𝑠1 + 0𝑠2
𝑐1
• Increase of 40.
• Decrease of 0(1) and decrease of 0(4).
𝑐1 − 𝑧1
• Net change: 40-0(1)-0(4).
Lecture 3
𝑧1
16
Entering Nonbasic Variable
• The variable with the largest positive 𝑐𝑗 − 𝑧𝑗 value.
• Because we want to maximize the objective value
• Pivot column.
Entering variable: 𝑥2
𝑐𝑗
Basic
Variable
50
0
0
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
0
𝑠1
40
1
2
1
0
0
𝑠2
120
4
3
0
1
𝑧𝑗
0
0
0
0
0
40
50
0
0
𝑐𝑗 − 𝑧𝑗
Lecture 3
40
17
Entering Nonbasic Variable
• The variable with the largest positive 𝑐𝑗 − 𝑧𝑗 value.
• Because we want to maximize the objective value
• Pivot column.
Entering variable: 𝑥2
𝑐𝑗
Basic
Variable
50
0
0
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
0
𝑠1
40
1
2
1
0
0
𝑠2
120
4
3
0
1
𝑧𝑗
0
0
0
0
0
40
50
0
0
𝑐𝑗 − 𝑧𝑗
Lecture 3
40
17
Leaving Basic Variable
▪ Pivot Operations
• To solve simultaneous equations.
▪ Leaving Basic Variable
• Constraints with entering variable 𝑥2 :
2𝑥2 + 𝑠1 = 40
3𝑥2 + 𝑠2 = 120
• How much we can increase 𝑥2:
𝑥2 =
40
2
= 20
120
𝑥2 =
= 40
3
Lecture 3
We can increase up to
the minimum of those
values.
18
Combined
𝑐𝑗
Basic
Variable
40
50
0
0
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
0
𝑠1
40
1
2
1
0
40/2
0
𝑠2
120
4
3
0
1
120/3
𝑧𝑗
0
0
0
0
0
40
50
0
0
𝑐𝑗 − 𝑧𝑗
▪ Entering Nonbasic Variable
• 𝑥2 .
▪ Leaving Basic Variable
• 𝑠1 .
Lecture 3
19
Pivot Number
𝑐𝑗
Basic
Variable
40
50
0
0
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
0
𝑠1
40
1
2
1
0
0
𝑠2
120
4
3
0
1
𝑧𝑗
0
0
0
0
0
40
50
0
0
𝑐𝑗 − 𝑧𝑗
▪ Pivot Column
▪ Pivot Row
▪ Pivot Number
• Intersection of the pivot row and the pivot column.
Lecture 3
20
Graphical Illustation
𝑥2
40
20
B
C
A
D
30
40
𝑥1
▪ Most Constrained Constraint.
• Labor constraint.
▪ Move from Point A to Point B.
Lecture 2
21
Developing New Tableau (1)
▪ Move from Point A to Point B
𝑐𝑗
Basic
Variable
50
𝑥2
0
𝑠2
40
50
0
0
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
40/2
1/2
2/2
1/2
0/2
𝑧𝑗
𝑐𝑗 − 𝑧𝑗
• 𝑛𝑒𝑤 𝑡𝑎𝑏𝑙𝑒𝑎𝑢 𝑝𝑖𝑣𝑜𝑡 𝑟𝑜𝑤 𝑣𝑎𝑙𝑢𝑒𝑠 =
1𝑥1 + 2𝑥2 + 𝑠1 = 40
Lecture 3
𝑜𝑙𝑑 𝑡𝑎𝑏𝑙𝑒𝑎𝑢 𝑝𝑖𝑣𝑜𝑡 𝑟𝑜𝑤 𝑣𝑎𝑙𝑢𝑒𝑠
𝑝𝑖𝑣𝑜𝑡 𝑛𝑢𝑚𝑏𝑒𝑟
(1𝑥1 + 2𝑥2 + 𝑠1 )/2 = 40/2
22
Developing New Tableau (2)
40
50
0
0
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
50
𝑥2
20
1/2
1
1/2
0
0
𝑠2
120
4
3
0
1
0
𝑠2
60
5/2
0
-3/2
1
𝑐𝑗
Basic
Variable
*(-3)
Old
New
𝑧𝑗
𝑐𝑗 − 𝑧𝑗
• 𝑛𝑒𝑤 𝑡𝑎𝑏𝑙𝑒𝑎𝑢 𝑟𝑜𝑤 𝑣𝑎𝑙𝑢𝑒𝑠 = 𝑜𝑙𝑑 𝑡𝑎𝑏𝑙𝑒𝑎𝑢 𝑟𝑜𝑤 𝑣𝑎𝑙𝑢𝑒𝑠 −
(𝑐𝑜𝑟𝑟𝑒𝑠𝑝𝑜𝑛𝑑𝑖𝑛𝑔 𝑐𝑜𝑒𝑓𝑓. 𝑖𝑛 𝑝𝑖𝑣𝑜𝑡 𝑐𝑜𝑙𝑢𝑚𝑛 ∗
𝑐𝑜𝑟𝑟𝑒𝑠𝑝𝑜𝑛𝑑𝑖𝑛𝑔 𝑛𝑒𝑤 𝑡𝑎𝑙𝑒𝑎𝑢 𝑝𝑖𝑣𝑜𝑡 𝑟𝑜𝑤 𝑣𝑎𝑙𝑢𝑒)
1
1
+ 𝑥2 + 𝑠1 = 20
2𝑥1
2
② 4𝑥1 + 3𝑥2 + 𝑠2 = 120
①
Lecture 3
②-3*①
23
Developing New Tableau (2)
𝑐𝑗
Basic
Variable
40
50
0
0
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
50
𝑥2
20
1/2
1
1/2
0
0
𝑠2
60
5/2
0
-3/2
1
𝑧𝑗
1,000
25
50
25
0
15
0
-25
0
𝑐𝑗 − 𝑧𝑗
• We start all over again!
Lecture 3
24
Pivot Number
40
50
0
0
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
50
𝑥2
20
1/2
1
1/2
0
0
𝑠2
60
5/2
0
-3/2
1
𝑧𝑗
1,000
25
50
25
0
15
0
-25
0
𝑐𝑗
Basic
Variable
𝑐𝑗 − 𝑧𝑗
40
24
• Change basic variable
• Divide by the pivot number.
• Pivot Operation to make all the other values in
pivot column zero.
• Update 𝒛𝒋 , 𝒄𝒋 − 𝒛𝒋 .
Lecture 3
25
Optimal Simplex Tableau
𝑐𝑗
Basic
Variable
40
50
0
0
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
50
𝑥2
8
0
1
4/5
-1/5
40
𝑥1
24
1
0
-3/5
2/5
𝑧𝑗
1,360
40
50
16
6
0
0
-16
-6
𝑐𝑗 − 𝑧𝑗
▪ When optimal?
• All 𝑐𝑗 − 𝑧𝑗 values are less than or equal to zero.
▪ Optimal Solution
• 𝑥1 = 24, 𝑥2 = 8, 𝑍 = $1,360
Lecture 3
26
Initial Step (1)
▪ Initial Simplex Tableau
𝑐𝑗
Basic
Variable
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
𝑧𝑗
𝑐𝑗 − 𝑧𝑗
▪ Initial Basic Feasible Solution
• The origin point is selected.
• Basic variable: 𝑠1 , 𝑠2 = 40, 120 .
Lecture 3
12
Initial Step (1)
▪ Initial Simplex Tableau
𝑐𝑗
Basic
Variable
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
𝑧𝑗
𝑐𝑗 − 𝑧𝑗
▪ Initial Basic Feasible Solution
• The origin point is selected.
• Basic variable: 𝑠1 , 𝑠2 = 40, 120 .
Lecture 3
12
Initial Step (1)
▪ Initial Simplex Tableau
𝑐𝑗
Basic
Variable
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
𝑧𝑗
𝑐𝑗 − 𝑧𝑗
▪ Initial Basic Feasible Solution
• The origin point is selected.
• Basic variable: 𝑠1 , 𝑠2 = 40, 120 .
Lecture 3
12
Initial Step (1)
▪ Initial Simplex Tableau
𝑐𝑗
Basic
Variable
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
𝑧𝑗
𝑐𝑗 − 𝑧𝑗
▪ Initial Basic Feasible Solution
• The origin point is selected.
• Basic variable: 𝑠1 , 𝑠2 = 40, 120 .
Lecture 3
12
Initial Step (1)
▪ Initial Simplex Tableau
𝑐𝑗
Basic
Variable
Quantity
𝑥1
𝑥2
𝑠1
𝑠2
𝑧𝑗
𝑐𝑗 − 𝑧𝑗
▪ Initial Basic Feasible Solution
• The origin point is selected.
• Basic variable: 𝑠1 , 𝑠2 = 40, 120 .
Lecture 3
12
Download