Simplex Method Examples
Simplex Method Examples
Simplex Method."
Getting Started:
Variables:
Maximize z- 3x,+2x2+x3
4.1 Setup!
4.2 Solving!
2x, + x2 + x3 <150
Subject to
4.3/4.4
Look Different
with
1. z is to be maximized
For example:
a)
Slack variables:
If
then
x, > 0
x,+x2<10
x, +x2 +x, = 10
and "takes up any slack"
2X,+4.5X2<8
ZX,
b)
tS, = g
X, + JXI<-2.5)<3
* Sj-i
<
Example 2:
Maximize z 3x]+2x2+x3
b) Name them
c) Use slack variables to convert each constraint into a linear equation
oi) 3
VT) Si,
Subject to
S3
?)
2y 2. i-
2x1
i-
z- 3x, +
By 3. i- )c3
rewr|TE the
with
+ S3 = 32o
objective function so all the variables are on the left and the constants are on the right.
2x2 +X3
-3*,-
|~*3y
-*3*0
- 2-Xi
?b
VPirvstlofi*-
ih. ctlpKo.
order
5230
WRITE the modified constraints (frSm step 1) and the objective function (from step 2) as an
augmented matrix. This is called the "simplex tableau."
r*>
CoKSfrafnb
c>)edi~p
Xz.
5,
S*.
S3
2.
05
3
2
o 15o
o o
Zoo
o 32 O
Example: Introduce slack variables as necessary, then write the initial simplex tableau for each linear
programming problem.
Ex 3)
Find
and
*1
lx, -3xz
NL*.
10
Ex. 4)
Find
-I
I3S
20 5
345
-2
-7
-3
-1
2x 1 +
4xt
4*
y 2.
- Sx 2.
S,
I
'6
-o
62.
(p
13
it
s,
2,
4-
X3
13
X|I
- *3
20
o
0)
5o
c;
10
t-Sa. - 5o
it
Example 5:
A businesswoman can travel to city A, city B, or city C. It is 122 miles to city A, 237 miles to city
B, and 307 miles to city C. She can travel up to 3000 miles. Dining and other expenses are $95 in city A, $130 in
city B, and $180 in city C. Her expense account allows her to spend $2000. A trip to city A will generate $800 in
sales, while a trip to city B will generate $1300 and a trip to city C will generate $1800. How many trips should
she make to each city to maximize sales? Write the initial simplex tableau.
U4 X, = #|rips Ci+V A
trip*
v- Son x } + S, ~ Bo oo
l 2 2 X| <-Z2>7 X z
\5X, +- V36 X2
-2.00
~o
Soo*, -I3cd
\-rfps
X -j,
237
Yp-
45
13 0
00
1500
MAX
*3
3O7 f $oOt>
\7-2-
2-31
130
ISO
5a.
X 2_ X 3
iSrO
1X00 MAX
VZ37Xz+ 307X3 * 3
v- 130/j. v ISOXj - %0
2." "Sooxi 4. \3<oc>x.z. loC)X3
Day 2:
Vz
s, s2 z
X,
x2
0
15
10 12
0 12
-2
1 16
x]
2.0 0 3
-<0O -1300
*3
Xv
IZ2-X,
T|
jjdSic
bftS'O
b5iC
One basic feasible solution can be found by finding the value of any basic variables and then setting all
remaining variables equal to zero.
X,
x2
0
(T)
X,
a)
-2
x,
5
s2
1
X,
0/12
002
0
0
b)
X3 S1
/Ijh -2
S2
10
0
0
0
1 16
2X2212.
*6 = 12
xi
H\-o
so
y 22s-
Sz-o
no
0
0 -30
0
2o
2
i
sr-b
Sz'2-
5-2-
i X3- 3 S3-0
I OX 330
Tz =4(p
X3~'I2
S3
2.-- 13
Unfortunately, solutions read off of the initial simplex tableau are seldom optimal.
We are going to alter our matrix using some restricted row operations using one of the entries in the tableau as
a pivot. The goal is to make all other elements in the column with the pivot equal to zero.,
O
0
Remember from Ch 2:
(Wf use rHS one Kert.
1. interchange two rows
O
2. multiply the elements in a row by a nonzero constant
0
3. add a multiple of one row to the elements of a multiple of any other row.
I-IT mwhi. bt| A negv use
fWe+
result.
Example 7: Pivot once as indicated in each simplex tableau. Read the solutiomfrom the
X,
a)
'Zb-
Y*.
5i
-5
-3
7.0
0 12
12.
c>
3(P
x3
4
s2
10
0 56
-1 -6 -2
S 2_
*%.
5,
x2
16
(woievc)
-3K2.+ R1
- <p -
CB
(.
-5
-2 o 3
1 -5
00
0
2*7,* 12
t -3
5 (A
2-e*
3FL2-
+ 12-3
R3
U 4
l -Ip
% o
"2
30
3 1 3 (9
Xr
1 YiT-fc
\ V-&
SfO
-- 13
l so
J5
-I
<5
25 o
2.
-I
2-
1 0 320
-3 -2 -1 0
b)
s*
0 150
s2 s3
110 0
S,
Si
f\
x2
x3
S!
X,
0 200
*3
-l
\nc>
H5o
YjarW-i
-2
1 H Ilf
O
2.
i 15*l
o -\
25 0
c)
2 0 -!
x,
x2
\*\0
v-r0
S3 -\4>
2-2z5
Sz.~ IZ*
.s, s2 s3
x3
4
X,
Yz
V3
0 30
-2,
*S
\\
0 15
"tp
[3]
0 10
-1 -9 -3
3)
St
XjSiRK-
"3
o
6
-S
50
a <ro
*\
~\
-4
<*
o o
M5
-2 o
<0
15
It
25
-3
o
<J
e>
-so
-2
3?
iVi-0
Wz3.3
2-5
IC
S,= 13.3
o 3o
40
33=M9
2>SZ~
P-H
U
o
~<e
3R3tlZ4
- 20
-4
30-50 *+0
-2-0
-l<?
**
s*
3Yz 10
Sz--li5
z 45
o o
45o
y, =i5
o o o -iso
o
o l O 32.0
-\ -i
-\
Zoo o
2y,-=lSo
-P.\
-2.
2
-It, -4
U 3 3 "3
o o t> -lSo
2oo
4P0
-I -l
-l
Sr 0
~\K\ +2R.1-*P-Z
3o
-D
5, -13.3
o
*530
Day 3:
4.2 Maximization Problems (text pgl77-190)
Day 1: Learn to set up a linear programming problem with many variables and create a "simplex tableau.
Day 2: Learn to identify basic variables, read feasible solutions from a tableau, and "pivot" to manipulate your
data.
Today - Learn to identify which variable to use as the pivot so your feasible solution gives the maximum value of
the objective function.
CoETFlCiertT
Step 4: Repeat Steps 2 & 3 if necessary Goal: no negative indicators in the bottom row.
Repeat steps 2 & 3 until all numbers on the bottom row are positive.
Step 5: Read the solution (Lesson 4.1, day 2)
X,
- loo
El
*2
1
*3
1
s, s2
10
0 100
0 500
smalVeyV
1 0
V HHO
Example 1:
v,
Vi-
v*
o
ic
U>
lb
U\
y [-5o
- (3
ncthve
sr- so
S 2-
~1
l
-lo
\o
a)
MAX <o(>oo
*> P-3
o -Soo
-4 -1 o -i
IO 111 o o Jooo
io
lo
a,
io
-1 o 5fl>
11.6
-\ 1.0
\%
4%
%4
- 40
-bo o
O
Soo
Soo
17-1
yjoRi
(ffiOb
II I (dOOO
[oOOO
fcr
P-3
an
Wc/tMc
-I Rl + RZ
Example 2:
2.
V <5
o
o
~7
~\R\
-ISO
2.00
50
R.2,12.3
- x -i
x2 > 0, x3 > 0
Xj >0,
-1 l
*2.
Maximize z = 3x1+2x2+x3
subject to
2Xj + x2 + x3 < 150
*>
7-
3f2.\
-v
-v
t
o
o
o -\5 o
o 32Q
<=> t 'TO
* 2R4- p-4
*+5 o
2. o
00
-(p
2>XI + YJ+S3-32.0
-3x,
y5
\tb
UpO
-3
s,
5}
o
o
*1 o
-x. -l
s i Si
T Vi
o
o
\5o
zoo
3ZO
?s
no
+30
*S} *z\,
0)
"fc
-1
<5
1-1 I
0
0
so
CD
-'H
l 5o
2_
-V
2.
-1
<?
-S>
ISO
e>
-i
7.
-it
-l
$0
r* Vi
s l Si
% * *3
II
l
1 60
-2RX + K.2
4So
2-
p,l
-6
&
-i
-t
l
-i
-It
_2
O -lOO
no
1C
-7-1
Rtt- K4 -4 R.4
s, 2
15
o -t
x i
Sj.
-I
<v
-H -X
-l
\
o
<?
2.x, - loo
Xi So
Yt'' So
S3- 70
Zi= S-oo
100
ISO
10
5 00
S|*
Sr'
Y3v)
Si-1
o
>
d>
o
X
So
4 So
x sc o
"
R 2.
+10(2.2,
-R|
Example 3:
Maximize z = 24x1+36x2
subject to
40xj + 80x2 < 560
- <ko
HO
to
teo
XO
-l
o o
\o
a
to o
-l
5(cO
7 2-Q
Me 0
6X1+8X2<72
with
x2 >0, x2 >0
+- SrOX+S, =5t0
6 Vi
-M
tS27l
~2.4X, -3(X2. +
*
n
40
fUT)
57e0
6>
12-
<0
L-
2-M -?>fc
CJ
~lXO
2.0
-IXO
X.O
-to
4o
S-c*
So
S,
Sj.
40
%o
TX5]
-1
jo
c>
o
- Jzo
Zo
f+
X, *z
VO
-\
10
tiO
Sx
KPC
s<?40
0
7-0
-3XO
o
o
Sfeo
i -xo
\ 2-0
te
(tO
2.40
4(p0
zo Soto
te 020
ZO X 1
- I te O
Xi~
%OVZ-ZMO
Xa.3
-zo o
-XO
(coo
b 4p 6
Sot
R2,
>4
Z-
Lf Rx
"\XCD
Xa.
50M0
12.1
-2P-X + R(
V AJi
*1
<>|
- M-5-o
l-2-i
2-40
l(cO
lo 0C>0
</VXlM.U M, - 300
S! ~
S 2--0
Z.O fc
- boo o
Day 4:
cUb
arena.
*1
danwu-s
tx
5
SfnxynA
2.
Musician*
2.
1
Moo
Hr
dJ
30
l
\S
15 6
MO
150
-H5 -H0O
<-=10
S3
2.
1
*2.
Sx
o
O
nsx,
MA-y
W i Vh
~IR1
150
f Yt
Go
iek. C
s>s3-=
-7-
~<\*>
o
*0
S3
5.
50
o
O
ISO
u>oo
to
S2. - TO
roevt:
3 2 So 2-S 0
ifo
()
So club+oWS
Q_O ci.re.TtAS
INCCK\
p*y.)
+ SP.4
r
Vi.-- 20
5,
-HSXj-HooXj.Vfco
y,-5o
SV
IS
[
3x,=\60
Sjz
Si ~ 160
y, 4- 5yx
V +- 1XZ
x,
Ke.vtL-
t-Hocy
y, + Syz S \so
y 1 rzy*--**0
2-Xi
't
150
-2R1
MayMse:
5.
Vx
'
S x-
S,
&
-5
o 30 o
-2-
-1*
so
H-ne
*o
50
150
6)
seH
lef
V%
Set
q,\tk>z
deluxe
*
-3.0
2
I
W&4
e 2-00
4o
tpO
fAA*
S,
2
1
*l
e>
o
o
'HO -to
:
Ho o
UOO
o
-R3t
icoRt RH-R-H
Y,
iox, +40Xztt0Xj
tot?
Such
y2 1
t-
Yz t
"30
20
3OY
2.00
* J 2, OC> O
16
Sj-o
200
-s-
206
&
2.
200
I200
<5 r 2o o
15
15, oO to
I 0 0 t>.sfc
Qj
Sa. *3
1
o
Z.6 6
(vdovk
Yz-0
+1
S( D
-1
c?
VV
X3=2oo
.~-\6ooc>
-1
I
Il
-3
R.2.
a
o
+ Sj - Hoo
Xj-f- 53
x, 10 752
Sa. S*
Yt Vt Y*
-200
-fU f
t7>0
Sj
X. )YJ_>*J>O
-K j-200
Y*. y3
o
0
124
4-2xat33-?oc>
Y*- f
Mfljimie-e
X i t X2 4
9, a
X* *3
XJ.
CW4>
0)
[>.
s4-s
CyvJL&LA-
jrg
<iziW
t#>oo
YsJCfclc
10
p. '2-
-7. Rl * SR-T.
~ 10
-2-
to
- n-
-X
-5
-V
-300
a.
-45-
2,
-1
_a
t 50
<1
f 12.4-
4oo
\*\S
40 O
IS
-t 5o
150
-t-
y v0
12,000
e>
-3
MJ>OO
&
le>
3o
-46
-5
P.3 -=>
312.2
Ot-15
-1
a.
1
o
<3
-2.
5-15
q>5- pL2. v
2% 5
2_%S
<0
4
-llo
2.40
50
BO
00
u> o o
ISO
44 5
4>0
-IBO
&>6b
<3
2X>d>
|t|/x5o\
3 3 <P, 6 o
- 2.00
*+> o
-I
C5
5/T-S o
'
-15
+
44 S
-|
p-t AT EL4
45o
3
CJ
o-4So
~ 15
-fc.1 + 2-R9.
0-3
%t>
- 3
o
-3 o
7,00
+ K4 -3 4
?0
*2- V
-5
15
=>
p.3
V5~
-(
-3
yo
-3
-fc3t-E.23Pl
<io
o
<=>
-t
-> R.1
o-l -1
1
t
<3
-t
to
'
-3 3 -HG.I
* 5 PL 3 -3 R3
1R t
c,
?3 11
U> 6
o
C3
2.
1(0
30
-2.
1 1jOO
-Z.OO
400
to
7.
2-)0
ELLf.
15
2.
\ 5
4 5
L>
t>
i5
3 &0 &
1 Z.OO&
l5o<->
Day 5:
|4.3 Minimization Problems & Duality! (text pg 191-202)
[i 2]
1 3 5
A=
2 4 6
AT =
3 4
Notice the 1st row becomes the 1st column and the 2nd row
becomes the 2nd column.
5 6
Example 1: Find the transpose of the given matrix.
a)
b)
-4 1
2.
-4
5 3"
5 6 0 2
2 0 7 7
1 8
"2 5"
1
0
5 o l
3 t 1
Getting Started:
If we are going to minimize an objective function, we have to approach the problem a little differently.
Minimize
Subject to
w-Sy]+l6y2
y,+5y2>9
2yl+2y2 > 10
with
> 0, y2 > 0
Notice:
We use "w" instead of "z" for the objective function and we use "y" as our variable instead of x.
This is just to remind us we are doing a minimization problem, which needs to be approached differently.
Minimize w = 8y)+16y2
Subject to
with
JI+52>9
2y] +2y2 >10
_y]>0,-y2>0
Cansttmts
Objective function
2
W 8
2
16
10
0
Mayi MI teS
Objective function -
Constants
*1
5
9
2
10
16
Su-VecV" Vo
Yt
6v.,rZy-z.llp
ft
y,> o
vjqtHn
Maxtiwim Problem
Minimum Problem
4 (0,4)'
(2.3)
(ft 5
K'
=4+ 1
-1F
(9,0)
w = 8y, 4*
-.....
(0.5)
80
I6y2*
Corner Point
9x
CTti)
(9,0)
*1
*
Corner Point
-+2
(O.O)
ft
(f 0)
Ki'Vy- <0-0)
7,
72
M>
f<a>3)__
IjKoj
/a#
-V'A
0
40
, + lftr2 .
mm
48
ffeirmm)
28.8
'
Simplex Method
If you solve the maximization problem using simplex method:
*1 *2 Z
0 0
2 0 10
10 0 0
X2
I
*2
1 2
-R, + Rr"*Kj
.-4
problem.
h S2 Z
0 0
*j
i+R*
8
16
0
l 0
0 1
8
a
40
z
5 -1 0
WllMMM*
'ir'L XT*
s2
0
4
-Rl
Rt + Ra
1 0
i
-1.
ova On
R*
24
8
(4sj)
1
las\r.
slack
Example 2: State the dual problem for the linear programming problem.
Minimize
SwckHv-
3, + 62+9 > -5
Subject to:
when
+7J3
w~y\
+9
IsXi
3Xa ~
1C|
\l
l
k>
3x,-
5-5
l l5
?> 1
r*
] io
n
f:\-5
*2>
,1 13
15
\0
vuUwrt-
Minimize
Such that
w = 2yi+y2+3y3
y+y2+y3
5y,+y2 >47
2 \
15
l
3
o 41
2.
3_
T\0
k>0,y2>0,y3>0
with
0 MAjoMie
(?)
1-
Suck
+ 5 y 2. 1-
X,
*2.
3
wifk
%ld>) ?%IC>
t-
+- S3 - 3
Xi
o.4
><
-1
S v
*o
2.
l
o
I
o
(3
-4H
S*
- 1R.I +*5R2.
4W + 5Rt
*2.
S,
?z
*t
Hi
'A
2,
<?
<2
2-
&
<?
hi
fT5
Si
\
"l
0.4
7.
3
3
18. %
(55__ii
18.8
g,--W
y*v- 0
ATr7tcHD) fyjm
16
Example 4: One gram of soybean meal provides at least 2.5 units of vitamins and 5 calories. One gram of meat
provides at least 4.5 units of vitamins and 3 calories. One gram of grain provides at least 5 units of vitamins and
10 calories. If a gram of soybean meal costs 7 cents, a gram of meat costs 9 cents, and a gram of grain costs 11
cents, what mixture of these three ingredients will provide at least 60 units of vitamins and 66 calories per
serving at a minimum cost? What will be the minimum cost?
wml
So j
vr+o.<wtr\5
HSx,
Iff t>
&r
wSw tk
4.\3
T-
o'H
>1]
c>
5
tofe
-bb
2-6? (o
&
,0
32-
2.5
s,
g,
* y-t
.o3*
fkct-k
+
-0
-tooy.,
M )U
vSx
SY.I v \ov. x + S3
,07
dost-
H- 5
5
B
2y
&.oAsrri e$
* Sfi + S, - 'OH
2,5*i
y'a.'vn
o7
*
wijUO
\C>p,3, -3 R3
-3R3+-
&
2,5
o.n
4-5
3
bo
2.5 5
10
(0 to
.oi .11
10
bo tow
33 4-5p.1t
6,N
0.07
r*
0. ll
,oii
- too
xOV-
+-W(oXx-
V 2.
S,
2-
IUcoci
'53
5
)0
-13S
Sx S* "Zr
O
jc?
~3
<?
35
.03
.SI
It
3. 0 3
,0 3
,51
,0l
Suck+'k*1-'
aSy,
y,
,0
t- 3
(\\2.a.v
30
+ lOy.ll
Wku.
fL>10
s,
Si S 3
7,
o
-\
10 3
C|
-10
60
bO O
y\ l>3r
par
0
1 S.f)
1.23
0 Sotj
/[A IN
J'l-ZV
n lU?
Qj
"5
-\
-i
2*5
-B
'23S
2-
47
+ S PL4
HH
(4)
{23.
-1RI +. $
- 2-
o o
45
000B0
47
-5
-ID
1D
>
-\
o -\
W.
'3
-33+ i0jz-3s
(*+
O
-Hi
5 l4
15
-3o
45
3o
C?
10
Bo
l<5 33o
- 300 "5 30
O. f
S7
-3 12-4
o33
O
o
o
o
>
-.5 3
CJ
010-3
33 13 + .4
-135
-3
3,3
5*
13 "*3
5" "7
<* (
C?
-3d
Gs 0
(0
-ID
C?
5>
6>
"10
-* 0
-n
6s 4
0|{2.g
a.70
-X7D
0
DO
0
[0
3*v
~[MP
Tb
\2.,S4
Consider:
*3 + s, 100
+ 1X3+2 -500
Xi
lOX,
Maximize
y 2, v- y
X\
When
x,,x2,x3 > 0
'V-T.
t>/\ =[00
etfo - So
H3l
to
S3 ~U>o
U>c>x 3 +-2--0
-lao-*
For
+ x3 100
lOx, + 4x2 + 7X3 <500
x, + x2 + x3 > 60
-1
*5 1
1\
o
\
o
0
0-
--
\---lio HO -IcO o
p,Vc)f
$.
=2o 10 o
50 o
o
O
bo
0
US.iv Column1
2.
3.
4.
Solve the problem using simplex method. If there are negative #'s in your bottom row, use the most
5.
once.
negative column & calculate the test ratio. Use the test ratio to identify the pivot. Pivot
If all numbers in the bottom row are positive, read the solution from the tableau. If any numbers are
6.
negative, repeat step 5.
7.
VJO&*.
Solve:
Example 2 -
x3 + x2 + 2X3 < 38
2X3 + x2 + x3 > 24
x1 > 0, x2 > 0, x3 > 0
with
i -I
t
I
7fc
52_
3P.-Z- n R-3 -* 3
U
*>?>
-'So
-4-H o
* +
V2sc3
<
4-
o-
&
\7-
- 2.
-3
o 3S
o 2H
*.
z.
>4
#-*>
3VZ.\
T_
*2"
-IRZ t
Kfv fff
3z
Coll
0*
TTT o
-I
2_
2-
2_
Oj
t V7
X3
3
Si
5i
SwiUe$V
2-H
+es+!
[ft
ra,
Sx
S,
-I
4-73- JZ-3
U.V-
7-
t '2U
-2u
*> '2-
-i
7-m
o o 76,
IP
11
/y, ' 3
oV.
Sz.
\
c?
0
Oy
p-
0'S
o -| -1 o -3 i 11.
Oj
-Z
EC
71
7-
5*-
3>
i
6V.
7 2.
7-X i +
Vi Vs
-'0 '3
t s38
V,
- ZH
-z.
<
+ 2~<Z\
5x
7CP
2/ 2-ZS
%iK'
'0
SI
ST"
3. ""
6,
2. z2.
Solve
Example 3:
Minimize
w = 3yi+2y2
Such that
>',+3J2<6
2j,+j2>3
+ ~>
and
0,'
a M.
I'
0-4
2.
\o/ \
/ \ l
-\(?Z+
-z
2RI -3 **l
A3
-802. + 2-A3
S,
\ s
a.
St
I
I -\*
(*
o
\i
\
l.s
'o
Si"
-VvJ
SiT-a
V
VJ ~
4-V
M.*C
J\MN-4-S"
HOMEWORK: 4.4 Day 1
-t
P209 #1,3,9,15
ei
-2_
<P
o 3
tr
12O
P-3
-3fcz <-ze3
-U
&
o
irtv
-nz.2 +
4?
0
o
3 o
- f
z>
2-?