Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

1

Reference: Decision Maths 2 textbook,


chapter 1, section 1
3/2/20129:14:46 AM
2
Simplex Algorithm
1. Construct system of equations from LP inequalities
1.1 rewrite objective formula to be equal to zero.
1. remove the inequalities from the constraints b! a""ing slac#
variables
. Place s!stem of equations in a tableau
$. %epeat the following until solution is optimal
$.1 &"entif! the pivot column
'he pivot column is the column with the largest negative value in
the objective equation
$. &"entif! the pivot element using ratio test.
Compute ratios of %(S to the correspon"ing entr! in the pivot
column
'he minimum of these ratios "efines the pivot element.
$.$ )a#ing the pivot
Manipulate the system of equations so that
* pivot element becomes 1
* all remaining element in pivot column become +
$., Chec# if the solution is optimal.
Solution is optimal if there is no negative entr! in objective row.
LP xample
0
160
320
480
640
800
960
0 160 320 480 640 800 960
x
y
)aximise P - x . +./!
subject to x . ! 1+++
x . ! 10++
$x . ! ,++
&nitial solution1
P ! "
at 2+3 +4
)aximise P - x . +./!
subject to x . ! 1+++
x . ! 10++
$x . ! ,++
)aximise P
where P *x *+./! - +
subject to x . ! . s
1
- 1+++
x . ! . s

- 10++
$x . ! . s
$
- ,++
Constraint
equations
Constraint
equations
5bjective equation
5bjective equation
Slac# variables
Slac# variables
LP xample
2#"" 1 + + $ +
1$"" + 1 + 1 +
1""" + + 1 1 1 +
" + + + *+./ *1 1
%(S s
$
s

s
1
! x P
%&MPL' ()*L)+
x ! ", y ! "3 P - +3 s
1
- 1+++3 s

- 10++3 s
$
- ,++
&nitial solution:
1
,++ 1 + + $ +
10++ + 1 + 1 +
1+++ + + 1 1 1 +
+ + + + *+./ *1 1
%(S s
$
s

s
1
! x P
P&,-( 1 .hoosin/ the pivot column
Choose the column with
the most negative number in objective row
pivot column
1
2
,++6$
-/++
,++ 1 + + $ +
10++6
-70+
10++ + 1 + 1 +
1+++61
-1+++
1+++ + + 1 1 1 +
+ + + + *+./ *1 1
%(S s
$
s

s
1
! x P
P&,-( 1 .hoosin/ the pivot element
%atio test1 )in. of $ ratios gives 2 as pivot element
pivot ro0
pivot element
1
3/2/20129:14:46 AM
8
,++ 1 + + $ +
10++ + 1 + 1 +
1+++ + + 1 1 1 +
+ + + + *+./ *1 1
%(S s
$
s

s
1
! x P
P&,-( 1
pivot ro0
pivot element
1
8ext operation1
9ivi"e through the pivot row b! the pivot element
3/2/20129:14:46 AM
9
,++ 1 + + $ +
1$" " "2$ " "2$ 1 "
1+++ + + 1 1 1 +
+ + + + *+./ *1 1
%(S s
$
s

s
1
! x P
P&,-( 1
2
After "ivi"e through the pivot row b! the pivot element
8ext operation1 5bjective row . pivot row
70+ + +.0 + +.0 1 +
1$" " "2$ " 3"24 " 1
%(S s
$
s

s
1
! : P
P&,-( 1
After objective row . pivot row
3
8ext operation1 ;irst constraint row * pivot row
70+ + +.0 + +.0 1 +
2$" " 3"2$ 1 "2$ " "
70+ + +.0 + *+.$ + 1
%(S s
$
s

s
1
! x P
P&,-( 1
After first constraint row * pivot row
3
8ext operation1 'hir" constraint row < $ x pivot row
1$" 1 312$ " "2$ " "
70+ + +.0 + +.0 1 +
0+ + *+.0 1 +.0 + +
70+ + +.0 + *+.$ + 1
%(S s
$
s

s
1
! x P
P&,-( 1
After thir" constraint row < $ x pivot row
3
3
3/2/20129:14:46 AM
13
10+ 1 *1.0 + +.0 + +
70+ + +.0 + +.0 1 +
0+ + *+.0 1 +.0 + +
70+ + +.0 + *+.$ + 1
%(S s
$
s

s
1
! x P
n5 of P&,-( 1
3
1$" 1 *1.0 + +.0 + +
1$" + +.0 + +.0 1 +
2$" + *+.0 1 +.0 + +
1$" + +.0 + *+.$ + 1
%(S s
$
s

s
1
! x P
n5 of P&,-( 1 6e0 solution
P - 70+3 x ! 1$", y ! "3 s
1
- 0+3 s

- +3 s
$
- 10+
P -0.3y +0.5s
2
= 750
0.5y +s
1
+ = 250
x +0.5y +0.5s
2
= 750
0.5y -1.5s
2
+s
3
= 150
P -0.3y +0.5s
2
= 750
0.5y +s
1
+ = 250
x +0.5y +0.5s
2
= 750
0.5y -1.5s
2
+s
3
= 150
0
160
320
480
640
800
960
0 160 320 480 640 800 960
x
y
7raphical equivalent
)aximise P - x . +./!
subject to x . ! 1+++
x . ! 10++
$x . ! ,++
Solution after
pivot 11
P ! 1$"
at 270+3 +4
10+ 1 *1.0 + +.0 + +
70+ + +.0 + +.0 1 +
0+ + *+.0 1 +.0 + +
70+ + +.0 + *+.$ + 1
%(S s
$
s

s
1
! x P
P&,-( 2
)ost negative number in objective row
.hoosin/ the pivot column
3
10+6+.0
-$++
10+ 1 *1.0 + +.0 + +
70+6+.0
-10++
70+ + +.0 + +.0 1 +
0+6+.0
-0++
0+ + *+.0 1 +.0 + +
70+ + +.0 + *+.$ + 1
%(S s
$
s

s
1
! x P
P&,-( 2 .hoosin/ the pivot element
%atio test1 )in. of $ ratios gives "2$ as pivot element
3
4"" 2 34 " 1 " "
70+ + +.0 + +.0 1 +
0+ + *+.0 1 +.0 + +
70+ + +.0 + *+.$ + 1
%(S s
$
s

s
1
! x P
P&,-( 2 Makin/ the pivot
9ivi"e through the pivot row b! the pivot element
4
4
$++ *$ + 1 + +
8#" "29 3"2# " " " 1
%(S s
$
s

s
1
! x P
P&,-( 2 Makin/ the pivot
5bjective row . +.$ x pivot row
5
$++ *$ + 1 + +
1"" 31 1 1 " " "
/,+ +.= *+., + + + 1
%(S s
$
s

s
1
! x P
P&,-( 2 Makin/ the pivot
;irst constraint row < +.0 x pivot row
5
$++ *$ + 1 + +
9"" 31 2 " " 1 "
1++ *1 1 1 + + +
/,+ +.= *+., + + + 1
%(S s
$
s

s
1
! x P
P&,-( 2 Makin/ the pivot
Secon" constraint row < +.0 x pivot row
5
3/2/20129:14:46 AM
22
$++ *$ + 1 + +
=++ *1 + + 1 +
1++ *1 1 1 + + +
/,+ +.= *+., + + + 1
%(S s
$
s

s
1
! x P
n5 of P&,-( 2
5
4"" *$ + 1 + +
9"" *1 + + 1 +
1"" *1 1 1 + + +
8#" +.= *+., + + + 1
%(S s
$
s

s
1
! x P
n5 of P&,-( 2 6e0 solution
P - /,+3 x ! 9"", y ! 4""3 s
1
- 1++3 s

- +3 s
$
- +
5
0
160
320
480
640
800
960
0 160 320 480 640 800 960
x
y
)aximise P - x . +./!
subject to x . ! 1+++
x . ! 10++
$x . ! ,++
Solution after
pivot 1
P ! 8#"
at 2=++3 $++4
7raphical equivalent
5
$++ *$ + 1 + +
=++ *1 + + 1 +
1++ *1 1 1 + + +
/,+ +.= *+., + + + 1
%(S s
$
s

s
1
! x P
P&,-( 4 .hoosin/ the pivot column
)ost negative number in objective row
5
$++ *$ + 1 + +
=++6 =++ *1 + + 1 +
1++61 1++ *1 1 1 + + +
/,+ +.= *+., + + + 1
%(S s
$
s

s
1
! x P
P&,-( 4 .hoosin/ the pivot element
%atio test1 )in. of ratios gives 1 as pivot element
5
$++ *$ + 1 + +
=++ *1 + + 1 +
1"" 31 1 1 " " "
/,+ +.= *+., + + + 1
%(S s
$
s

s
1
! x P
P&,-( 4 Makin/ the pivot
9ivi"e through the pivot row b! the pivot element
6
1++ *1 1 1 + + +
88" "22 " "2# " " 1
%(S s
$
s

s
1
! x P
P&,-( 4 Makin/ the pivot
5bjective row . +., x pivot row
7
#"" 1 " 32 " 1 "
1++ *1 1 1 + + +
//+ +. + +., + + 1
%(S s
$
s

s
1
! x P
P&,-( 4 Makin/ the pivot
Secon" constraint row < x pivot row
7
9"" 31 " 4 1 " "
,++ 1 + * + 1 +
1++ *1 1 1 + + +
//+ +. + +., + + 1
%(S s
$
s

s
1
! x P
P&,-( 4 Makin/ the pivot
'hir" constraint row . $ x pivot row
7
6
3/2/20129:14:46 AM
31
=++ *1 + $ 1 + +
,++ 1 + * + 1 +
1++ *1 1 1 + + +
//+ +. + +., + + 1
%(S s
$
s

s
1
! x P
n5 of P&,-( 4
7
9"" *1 + $ 1 + +
#"" 1 + * + 1 +
1"" *1 1 1 + + +
88" +. + +., + + 1
%(S s
$
s

s
1
! x P
n5 of P&,-( 4 -ptimal solution
P - //+3 x ! #"", y ! 9""3 s
1
- +3 s

- 1++3 s
$
- +
8o more negative entries in 5bjective %ow
8o more negative entries in 5bjective %ow
7
0
160
320
480
640
800
960
0 160 320 480 640 800 960
x
y
)aximise P - x . +./!
subject to x . ! 1+++
x . ! 10++
$x . ! ,++
5ptimal solution
after pivot $1
P ! 88"
at 2,++3 =++4
7raphical equivalent
3/2/20129:14:46 AM
34
$*variable LP Problem
> ?xample from 9 ?x 1A @$ 2page 14
)aximise P - Ax.1+!.=z
Subject to
x . $! . ,z B $
=x . =! . z B /
x3 !3 z C +

You might also like