Linear Programming Problem: Simplex Method

advertisement
The Simplex Method
Standard Linear Programming
Problem
Standard Maximization Problem
1. All variables are nonnegative.
2. All the constraints (the conditions) can be
expressed as inequalities of the form:
ax + by ≤ c, where c is a positive constant
Illustrating Example (1)
Maximize the objective function:
P(x,y) = 5x + 4y
Subject to:
x + y ≤ 20
2x + y ≤ 35
-3x + y ≤ 12
x≥0
y≥0
Solution
First :
We rewrite the given conditions
and formula
We had :
x  y  20 ,
2 x  y  35 ,
 3 x  y  12 and p  5 x  4 y
Re write the inequaliti es , by in troducing
" slack va riables "
u , v and w , as follows : as follows :
x  y  u  20 ,
2 x  y  v  35 ,
 3 x  y  w  12
and rewrite the formula of the objective
 5x  4 y  p  0
Second :
We construct
the following
table :
x
y
u
v
w
p
const an ts
 1

2

 3


  5
1
1
0
0
0
1
0
1
0
0
1
0
0
1
0





4
0
0
0
1
20 

35

12 


0 
function as follows :
x
y
u
v
w
p
const an ts
 1

2

 3


 5

1
1
0
0
0
1
0
1
0
0
1
0
0
1
0





4
0
0
0
1
20 

35

12 


0 
Third :
We locate the pivot element ( entry ), as follows :
a.
We locate the pivot column :
which is the column containing
( whch is here
b.
the most negative entry in the last row ( left to the line ) :
 5 ). Thus the pivot column is the x  column .
We divide the consta nt in each row by the correspond ing positive entry in the pivot column
to obtain a ( positive ) quotient . If that entry is negative then we do not have a quotient
The entry correspond ing to the smallest
quotient is the pivot element ( and the row where it is
located is the pivot row )
Here , the quotients are : 20 / 1  20 and 35 / 2 . The quotient 35 / 2 is the smallest , and so the
correspond ing entry , which is the 2 is the pivot element ( entry )
Fourth
We perform the necessary
elementary
row operations
to transform the pivot element to 1 and
the other entries in the pivot column to 0 ' s ; thus transform ing that column to a unit column .
x
y
u
v
w
p
const an ts
 1

2

 3


  5
1
1
0
0
0
1
0
1
0
0
1
0
0
1
0





4
0
0
0
1
20 

35

12 


0 
x
y
u
v
w
p
const an ts
 1

1

 3


  5
1
20 
35 
2 
12 


0 
1
2
R2

1
0
0
0
1
2
0
1
2
0
0
1
0
0
1
0





4
0
0
0
1
( R ) R
(3 R ) R
(5 R ) R
1
4
2
  2 

3   2 

x
0

1

0


0

,
y
u
v
1
2
1

1
2
5
2


3
2
,
w
1
2
p
0
const an ts
0
0
1
2
0
0
0
3
2
1
0




0
5
2
0
1



129

2


175 
2 
5
2
35
2
Fifth :
If after that , the last row still contains negativ entries , we repeat step three and four .
3
Here , we have a negative entry in the last row , which is : 
2
x
0

1

0


0

y
u
v
1
2
1

1
2
0
5
2


3
2
w
1
2
p
const an ts
0
0
1
2
0
0
0
3
2
1
0




0
5
2
0
1

35 
2 
129

2


175 
2 
5
2
R epeat steps ( 3 ) and ( 4 )
Step ( 3 )
a.
We locate the pivot column :
which is the column containing

( whch is here
3
the most negative entry in the last row ( left to the line ) :
). Thus the pivot column is the y  column .
2
b.
We divide the consta nt in each row by the correspond ing positive entry in the pivot column
to obtain a ( positive ) quotient . If that entry is negative then we do not have a quotient
The entry correspond ing to the smallest
quotient is the pivot element ( and the row where it is
located is the pivot row )
Here , the quotients
are :
5
2
The quotient
5
/
1
2
5,
35
2
/
1
.  35 and
2
129
2
/
5
2

129
5
 25
4
5
is the smallest , and so the correspond ing entry , which is the
2
in the first row is the pivot element ( entry )
1
2
Step ( 4 )
We perform the necessary
elementary
row operations
to transform the
pivot element to 1 and the other entries in the pivot column to 0 ' s
; thus transform ing that column to a unit column .
x
0

1

0


0

y
u
v
1
2
1

1
2
0
5
2


3
2
w
1
2
p
const an ts
0
1
2
0
0
0
3
2
1
0




0
5
2
0
1
( R ) R
( 5 R ) R

35 
2 
129

2


175 
2 
5
2
0
(3 R ) R
2
3
1
 1   1 
 1  

4 
2R
,
,
x
y
u
v
0

1

0


 0
1
1
0
,
w
p
1
0
0
1
1
0
0
0
5
4
1
0





0
3
1
0
1
const an ts
5 

15

52 


95 
Sixth :
Now all etries in the last row to the left of the line are positive ,
which means that the optimal solution has been reached .
The correspond ing values of the v ariables to this optial solutin are :
zero for all nonbasic
( the ones not assiciated
v ariables
with ( heading ) a unit column )
& the correspond ing con sta nt lying in the row containing
( the ones assiciated
the 1 for basic v ariables
with a unit column ).
Thus :
x  15 , y  5 , u  0  v , w  52 and p  95
Therfore the max value of the objective
function
p is 95
This max value occurs when x  15 , y  5 , u  0 , v  0 and w  52
What about when all of the
constraints (the inequalities) are of
the type “≤ positive constant”
But we want to minimize the
objective function instead of
maximizing.
Minimization with “≤” constraints
Illustrating Example (2)
Minimize the objective function:
p(x,y) = -2x - 3y
Subject to:
5x + 4y ≤ 32
x + 2y ≤ 10
x≥0
y≥0
Solution
Let
q(x) = - p(x) = - ( -2x -3y) = 2x + 3y
To minimize p is to maximize q. Thus, we solve the
following standard maximization linear programming
problem:
Maximize the objective function:
q(x) = 2x + 3y
Subject to:
5x + 4y ≤ 32
x + 2y ≤ 10
x≥0
y≥0
Rewriting the inequalities as equations, by
introducing the “slack” variables u and v
and the formula of the objective function
as done in example (1).
5x + 4y ≤ 32 , x + 2y ≤ 10 and q = 2x +3y
Are transformed to:
5x + 4y + u = 32
x + 2y + v = 10
- 2x - 3y + q = 0
We have ,
5x  4y  u  32, x  2y  v  10, - 2x  3y  q  0
We construct
the simplex
tableaus :
x
y
u v
q
const ants
 5

1

 .

 2
4
1
0
0
2
0
1
0
.
.
.
.
3
0
0
1
32 

10 
. 

0 
Applying
the method as e xplained
x
u
1

0

.

0
y
0
1

1
3

1
6
v
q
2
3
0
5
6
0
.
.
.
.
0
1
6
7
6
1
Thus : x  4 ,
y3
in example (1), we arrive at :
const ants
4 

3 
. 

17 
and
q  17

q attains the max value , which is 17 at ( x , y )  ( 4 , 3 )

Since p   q , then :
p attains the min value , which is  17 at ( x , y )  ( 4 , 3 )
Standard Linear Programming
Problem
Standard Minimization Problem
1. All variables are nonnegative.
2. All the constraints (the conditions) can be
expressed as inequalities of the form:
ax + by ≥ c, where c is a positive constant
Solving
The Standard Minimization
Problem
We use the fundamental theorem of
Duality
Illustrating Example (3)
Minimize the objective function:
p(x,y) = 6x + 8y
Subject to:
40x + 10y ≥ 2400
10x + 15y ≥ 2100
5x + 15y ≥ 1500
x≥0
y≥0
Minimize the objective function: p(x,y) = 6x + 8y
Subject to:
40x + 10y ≥ 2400, 10x + 15y ≥ 2100 , 5x + 15y ≥ 1500, x ≥ 0 and y ≥ 0
We will refer to the above given problem by the primal (original) problem
First: We construct the following table, which we will refer to by the “primal” table:
x y
constant
--------------------------------40 10
2400
10 15
2100
5 15
1500
--------------------------------6 8
Second: We construct a dual (twin) table from interchanging the rows and columns in the primal table:
x'
y'
z'
constant
----------------------------------------------------------40
10
5
6
10
15
15
8
--------------------------------------------------------2400
2100
1500
Third: We interpret the “dual table” as a standard maximization problem, which will refer to as the
“dual problem” or “twin problem” of the “primal problem” or the “original problem”
Miaximoze the objective function: q( x ' , y ' , z ' ) = 2400x' + 2100y' + 1500z'
Subject to:
40x' + 10y' + 5z' ≤ 6, 10x' + 15y' + 15z' ≤ 8 , x' ≥ 0 and y' ≥ 0, z' ≥ 0
Fourth: We apply the simplex method explained in example (1) to solve this problem
Maximize the objective function: q(x,y,z) = 2400x' + 2100y' + 1500z'
Subject to:
40x' + 10y' + 5z' ≤ 6, 10x' + 15y' + 15z' ≤ 8 , x' ≥ 0 and y' ≥ 0, z' ≥ 0
4.a.Rewriting the inequalities and the formula of the objective function, with the slack
variables being the same x and y (in that order) of the original (minimization) problem
:
40x' + 10y' + 5z' + x = 6
10x' + 15y' + 15z' + y = 8
- 2400x' - 2100y' - 1500z‘ + q = 0
4.b. We construct the simplex table for this problem
40x'  10y'  5z'  x  6
10x'  15y'  15z'  y  8
- 2400x' - 2100y' - 1500 z   q  0






x
y
z
x
y q
40
10
5
1
0
0
10
15
15
0
1
0
.
.
.
.
.
.
2400
 2100
 1500
0
0
1
4 .c . We perform
all the elementary
const ant
6 

8 
. 

0 
row operations
necessiate d
by the simplex method which will lead to the following
x y
1

0

.

0
0

z
x
3
20
3
100
1
11
10
.
.
0
450

1
50
y

1
50
q
0
2
25
0
.
.
.
30
120
1
const ant


13
25


.

1140 
1
50
table :
Fifth: We read the solution from the table
x
 1

1

 .

 1
y
x
y
0
1
1
0
1
0
1
0
.
.
.
0
2
1
.
.
0
q
const ant
3 

2 
. 

4 
The solution to the primal ( original ) min imization
appears in the last row under the " slack " v ariables
problem
x and y :
Thus : x  0 and y  2
The min value of p  the max value of q  4
We can also get this answer
from the formula of p :
p (0,2 )  0  2 ( 2 )  0  4  4
Checking :
q is max when : x   0 , y   2
q ( 0 , 2 ))  0  2 ( 2 )  4
Illustrating Example (4)
Minimize the objective function:
p(x,y) = x + 2y
Subject to:
-2x + y ≥ 1
-x+y≥2
x≥0
y≥0
Minimize the objective function: p(x,y) = x + 2y
Subject to:
-2x + y ≥ 1, - x + y ≥ 2 We will refer to the above given problem by the primal (original) problem
First: We construct the following table, which we will refer to by the “primal” table:
x
y
constant
---------------------------------2 1
1
-1 1
2
--------------------------------1 2
Second: We construct a dual (twin) table from interchanging the rows and columns in the primal table:
x'
y'
constant
-------------------------------------------2
-1
1
1
1
2
----------------------------------------1
2
Third: We interpret the “dual table” as a standard maximization problem, which will refer to as the
“dual problem” or “twin problem” of the “primal problem” or the “original problem”
Maximize the objective function: q( x ' , y ‘ ) = x' + 2y'
Subject to:
-2x' - y' ≤ 1, x' + y' ≤ 2 , x' ≥ 0 and y' ≥ 0
Fourth: We apply the simplex method explained in example (1) to solve this problem
Maximize the objective function: q( x ' , y ‘ ) = x' + 2y'
Subject to:
- 2x' - y' ≤ 1, x' + y' ≤ 2 , x' ≥ 0 and y' ≥ 0
4.a.Rewriting the inequalities and the formula of the objective function, with the slack
variables being the same x and y (in that order) of the original (minimization) problem
:
- 2x' - y' ' + x = 1
x' + y' + y = 2
- x' - 2y' + q = 0
4.b. We construct the simplex table for this problem
- 2x' - y' '  x  1
x'  y'  y  2
- x' - 2y'  q  0
x
y
 2

1

 .

1
1
1
0
0
1
0
1
0
.
.
.
0
0
1
x
.
.
2
4 .c . We perform
y
q
const ant
1 

2 
. 

0 
all the elementary
row operations
necessiate d
by the simplex method which will lead to the following
x
 1

1

 .

 1
y
x
y
0
1
1
0
1
0
1
0
.
.
.
0
2
1
.
0
.
q
const ant
3 

2 
. 

4 
table :
Homework
1. Using the simplex method, maximize: p = x + (6/5)y subject to:
2x + y ≤ 180 , x + 3y ≤ 300 , x ≥ 0 , y ≥ 0
Solution: p(48,84) = 148.8
2. Minimize: p(x,y) = - 5x - 4y
Subject to: x + y ≤ 20 , 2x + y ≤ 35 , -3x + y ≤ 12 , x ≥ 0
y≥0
Solution: p(15,5) = - 95
3. Using the dual theorem, minimize: p = 3x + 2y subject to:
8x + y ≥ 80 , 8x + 5y ≥ 240 , x + 5y ≥ 100, x ≥ 0 , y ≥ 0
Solution: p(20,16) = 92
Maximize the objective function:
Download