The Ratio Test

advertisement
EMIS 8374
LP Review: The Ratio Test
Main Steps of the Simplex
Method
1.
2.
3.
4.
5.
6.
Put the problem in row-0 form.
Construct the simplex tableau.
Obtain an initial BFS.
If the current BFS is optimal then goto step 9.
Choose a non-basic variable to enter the basis.
Use the ratio test to determine which basic
variable must leave the basis.
7. Perform the pivot operation on the appropriate
element of the tableau.
8. Goto Step 4.
9. Step 9. Stop.
1
Example 1: Step 1
Original LP
Maximize 4.5 x1 + 4 x2
s.t. 30 x1 + 12 x2  6000
10 x1 + 8 x2  2600
4 x1 + 8 x2  2000
x1,
x2  0
LP in Row-0 Form
Maximize z
s.t. z - 4.5 x1 - 4 x2 = 0
30 x1 + 12 x2 + x3 = 6000
10 x1 + 8 x2 + x4 = 2600
4 x1 + 8 x2 + x5 = 2000
x1, x2, x3, x4, x5  0
2
Example 1: Steps 2 and 3
z x1
x2 x3 x4 x5 b
1 -4.50 -4 0 0 0
basis
0z
0
30 12 1 0 0 6000 x3
0
10 8 0 1 0 2600 x4
0
4 8 0 0 1 2000 x5
Initial BFS:
BV = {z, x3, x4, x5}, NBV = {x1, x2}
z = 0, x3 = 6,000, x4 = 2,600, x5 = 2,000
x1 = x2 = 0
3
Example 1: Steps 4 and 5
z x1
x2 x3 x4 x5 b
1 -4.50 -4 0 0 0
basis
0z
0
30 12 1 0 0 6000 x3
0
10 8 0 1 0 2600 x4
0
4 8 0 0 1 2000 x5
x1 and x2 are eligible to enter the basis.
Select x1 to become a basic variable
4
Example 1: Step 6
• How much can we increase x1?
• Constraint in Row 1:
30 x1 + 12 x2 + x3 = 6000 =>
x3 = 6000 - 30 x1 - 12 x2.
• x2 = 0 (it will stay non-basic)
• x3  0
• Thus x1  200.
5
Example 1: Step 6
• How much can we increase x1?
• Constraint in Row 2:
10 x1 + 8 x2 + x4 = 2600 =>
x4 = 2600 - 10 x1 - 8 x2
• x2 = 0 (it will stay non-basic)
• x4  0
• Thus x1  260.
6
Example 1: Step 6
•
•
How much can we increase x1?
Constraint in Row 3:
4 x1 + 8 x2 + x5= 2000 =>
x5 = 2000 - 4 x1 - 8 x2
•
•
•
x2 = 0 (it will stay non-basic)
x5  0
Thus x1  500.
7
Example 1: Step 6
• From constraint 1, we see that we can increase x1
up to 200, but we must reduce x3 to zero to satisfy
the constraints.
• From constraint 2, we see that we can increase x1
up to 260, but we must also reduce x4 to zero to
satisfy the constraints.
• From constraint 3, we see that we can increase x1
up to 500, but we must reduce x5 to zero to satisfy
the constraints.
• Since x3 is the limiting variable, we make it nonbasic as x1 becomes basic.
8
Step : The Ratio Test
Row 1:
30 x1 + 12 x2 + x3 = 6000 =>
30 x1 + x3 = 6000 => x1  6000/30 = 200.
Row 2:
10 x1 + 8 x2 + x4 = 2600 =>
10 x1 + x4 = 2600 => x1  2600/10 = 260.
Row 3:
4 x1 + 8 x2 + x5= 2000 =>
4 x1 + x5 = 2000 => x1  2000/4 = 500.
9
Example 1: Ratio Test
z x1
x2 x3 x4 x5 b
1 -4.50 -4 0 0 0
basis ratio
0z
0
30 12 1 0 0 6000 x3
200
0
10 8 0 1 0 2600 x4
260
0
4 8 0 0 1 2000 x5
500
The minimum ratio occurs in row 1.
Thus, x3 leaves the basis when x1 enters.
10
Example 1: Steps 7 (Pivot)
z x1
x2 x3 x4 x5 b
1 -4.50 -4 0 0 0
basis
0z
0
30 12 1 0 0 6000 x3
0
10 8 0 1 0 2600 x4
0
4 8 0 0 1 2000 x5
Pivot on the x1 column of row 1 to make
x1 basic and x3 non-basic.
11
Example 1: Steps 7 (Pivot)
First ERO: divide row 1 by 30
z x1
x2 x3
1 -4.50
0
-4
x4 x5 b
0 0 0
basis
0z
1 0.40 0.0333 0 0 200 x1
0
10
8
0 1 0 2600 x4
0
4
8
0 0 1 2000 x5
12
Example 1: Steps 7 (Pivot)
Second ERO: Add –10 times row 1 to row 2
z x1
x2 x3
1 -4.50
-4
x4 x5 b
0 0 0
basis
0z
0
1 0.40 0.0333 0 0 200 x1
0
0
4 -0.333 1 0 600 x4
0
4
8
0 0 1 2000 x5
13
Example 1: Steps 7 (Pivot)
Third ERO: Add –4 times row 1 to row 3
z x1
x2 x3
1 -4.50
-4
x4 x5 b
0 0 0
basis
0z
0
1 0.40 0.0333 0 0 200 x1
0
0
0
0 6.4 -0.133 0 1 1200 x5
4 -0.333 1 0 600 x4
14
Example 1: Steps 7 (Pivot)
Fourth ERO: Add 4.5 times row 1 to row 0
z x1
x2
x3
x4 x5 b
basis
1
0 -2.20
0
1 0.40 0.0333 0 0 200 x1
0
0
0
0 6.4 -0.133 0 1 1200 x5
0.15 0 0 900 z
4 -0.333 1 0 600 x4
15
Example 1: Steps 4
z x1
x2
x3
x4 x5 b
basis
1
0 -2.20
0.15 0 0 900 z
0
1 0.40 0.0333 0 0 200 x1
0
0
0
0 6.4 -0.133 0 1 1200 x5
4 -0.333 1 0 600 x4
BV = {z, x1, x4, x5}, NBV = {x2, x3}
z = 900, x1 = 200, x4 = 600, x5 = 1200
Increasing x2 may lead to an increase in z.
16
Example 1: Ratio Test
z x1
x2
x3
x4 x5 b
basis ratio
1
0 -2.20
0.15 0 0 900 z
0
1 0.40 0.0333 0 0 200 x1
500
0
0
4 -0.333 1 0 600 x4
150
0
0
6.4 -0.133 0 1 1200 x5
188
The minimum ratio occurs in row 2.
Thus, x4 leaves the basis when x2 enters.
17
Example 1: Pivoting x2 into the
basis
z x1 x2 x3 x4
x5
b
basis
1
0 0 0 0.4167 0.0833 1250 z
0
1 0 0 0.1667 -0.1667 100 x1
0
0 1 0 -0.0833 0.2083 200 x2
0
0 0 1
-4
2.5 600 x3
BV = {z, x1, x2, x3}, NBV = {x4, x5}
z = 1250, x1 = 100, x2 = 200, x3 = 600
This an optimal BFS.
18
Download