simplex algorithm chapter7 mat gsia cmu edu
TRANSCRIPT
-
7/22/2019 Simplex Algorithm Chapter7 Mat Gsia Cmu Edu
1/10
C h a p t e r 7
T h e S i m p l e x M e t h o d
I n t h i s c h a p t e r , y o u w i l l l e a r n h o w t o s o l v e l i n e a r p r o g r a m s . T h i s w i l l g i v e y o u i n s i g h t s i n t o
w h a t S O L V E R a n d o t h e r c o m m e r c i a l l i n e a r p r o g r a m m i n g s o f t w a r e p a c k a g e s a c t u a l l y d o . S u c h a n
u n d e r s t a n d i n g c a n b e u s e f u l i n s e v e r a l w a y s . F o r e x a m p l e , y o u w i l l b e a b l e t o i d e n t i f y w h e n a
p r o b l e m h a s a l t e r n a t e o p t i m a l s o l u t i o n s S O L V E R n e v e r t e l l s y o u t h i s : i t a l w a y s g i v e y o u o n l y o n e
o p t i m a l s o l u t i o n . Y o u w i l l a l s o l e a r n a b o u t d e g e n e r a c y i n l i n e a r p r o g r a m m i n g a n d h o w t h i s c o u l d
l e a d t o a v e r y l a r g e n u m b e r o f i t e r a t i o n s w h e n t r y i n g t o s o l v e t h e p r o b l e m .
7 . 1 L i n e a r P r o g r a m s i n S t a n d a r d F o r m
B e f o r e w e s t a r t d i s c u s s i n g t h e s i m p l e x m e t h o d , w e p o i n t o u t t h a t e v e r y l i n e a r p r o g r a m c a n b e
c o n v e r t e d i n t o s t a n d a r d " f o r m
M a x c
1
x
1
+ c
2
x
2
+ + c
n
x
n
s u b j e c t t o a
1 1
x
1
+ a
1 2
x
2
+ + a
1 n
x
n
= b
1
: : : : : : : : :
a
m 1
x
1
+ a
m 2
x
2
+ + a
m n
x
n
= b
m
x
1
0 ; : : : x
n
0
w h e r e t h e o b j e c t i v e i s m a x i m i z e d , t h e c o n s t r a i n t s a r e e q u a l i t i e s a n d t h e v a r i a b l e s a r e a l l n o n n e g a -
t i v e .
T h i s i s d o n e a s f o l l o w s :
I f t h e p r o b l e m i s m i n z , c o n v e r t i t t o m a x , z
I f a c o n s t r a i n t i s a
i 1
x
1
+ a
i 2
x
2
+ + a
i n
x
n
b
i
, c o n v e r t i t i n t o a n e q u a l i t y c o n s t r a i n t b y a d d i n g
a n o n n e g a t i v e s l a c k v a r i a b l e s
i
. T h e r e s u l t i n g c o n s t r a i n t i s a
i 1
x
1
+ a
i 2
x
2
+ + a
i n
x
n
+ s
i
= b
i
,
w h e r e s
i
0
I f a c o n s t r a i n t i s a
i 1
x
1
+ a
i 2
x
2
+ + a
i n
x
n
b
i
, c o n v e r t i t i n t o a n e q u a l i t y c o n s t r a i n t b y
s u b t r a c t i n g a n o n n e g a t i v e s u r p l u s v a r i a b l e s
i
. T h e r e s u l t i n g c o n s t r a i n t i s a
i 1
x
1
+ a
i 2
x
2
+ +
a
i n
x
n
, s
i
= b
i
, w h e r e s
i
0
I f s o m e v a r i a b l e x
j
i s u n r e s t r i c t e d i n s i g n , r e p l a c e i t e v e r y w h e r e i n t h e f o r m u l a t i o n b y x
0
j
, x
0 0
j
,
w h e r e x
0
j
0 a n d x
0 0
j
0
8 7
-
7/22/2019 Simplex Algorithm Chapter7 Mat Gsia Cmu Edu
2/10
8 8 C H A P T E R 7 . T H E S I M P L E X M E T H O D
E x a m p l e 7 . 1 . 1 T r a n s f o r m t h e f o l l o w i n g l i n e a r p r o g r a m i n t o s t a n d a r d f o r m .
M i n , 2 x
1
+ 3 x
2
x
1
, 3 x
2
+ 2 x
3
3
, x
1
+ 2 x
2
2
x
1
u r s ; x
2
0 ; x
3
0
L e t u s r s t t u r n t h e o b j e c t i v e i n t o a m a x a n d t h e c o n s t r a i n t s i n t o e q u a l i t i e s .
M a x 2 x
1
, 3 x
2
x
1
, 3 x
2
+ 2 x
3
+ s
1
= 3
, x
1
+ 2 x
2
, s
2
= 2
x
1
u r s ; x
2
0 ; x
3
0 s
1
0 s
2
0
T h e l a s t s t e p i s t o c o n v e r t t h e u n r e s t r i c t e d v a r i a b l e x
1
i n t o t w o n o n n e g a t i v e v a r i a b l e s : x
1
=
x
0
1
, x
0 0
1
M a x 2 x
0
1
, 2 x
0 0
1
, 3 x
2
x
0
1
, x
0 0
1
, 3 x
2
+ 2 x
3
+ s
1
= 3
, x
0
1
+ x
0 0
1
+ 2 x
2
, s
2
= 2
x
0
1
0 ; x
0 0
1
0 ; x
2
0 ; x
3
0 s
1
0 s
2
0
7 . 2 S o l u t i o n o f L i n e a r P r o g r a m s b y t h e S i m p l e x M e t h o d
F o r s i m p l i c i t y , i n t h i s c o u r s e w e s o l v e b y h a n d " o n l y t h e c a s e w h e r e t h e c o n s t r a i n t s a r e o f t h e
f o r m a n d t h e r i g h t - h a n d - s i d e s a r e n o n n e g a t i v e . W e w i l l e x p l a i n t h e s t e p s o f t h e s i m p l e x m e t h o d
w h i l e w e p r o g r e s s t h r o u g h a n e x a m p l e .
E x a m p l e 7 . 2 . 1 S o l v e t h e l i n e a r p r o g r a m
m a x x
1
+ x
2
2 x
1
+ x
2
4
x
1
+ 2 x
2
3
x
1
0 ; x
2
0
F i r s t , w e c o n v e r t t h e p r o b l e m i n t o s t a n d a r d f o r m b y a d d i n g s l a c k v a r i a b l e s x
3
0 a n d x
4
0
m a x x
1
+ x
2
2 x
1
+ x
2
+ x
3
= 4
x
1
+ 2 x
2
+ x
4
= 3
x
1
0 ; x
2
0 x
3
0 ; x
4
0
L e t z d e n o t e t h e o b j e c t i v e f u n c t i o n v a l u e . H e r e , z = x
1
+ x
2
o r , e q u i v a l e n t l y ,
z , x
1
, x
2
= 0
P u t t i n g t h i s e q u a t i o n t o g e t h e r w i t h t h e c o n s t r a i n t s , w e g e t t h e f o l l o w i n g s y s t e m o f l i n e a r e q u a -
t i o n s .
z , x
1
, x
2
= 0 R o w 0
2 x
1
+ x
2
+ x
3
= 4 R o w 1
x
1
+ 2 x
2
+ x
4
= 3 R o w 2
7 . 1
-
7/22/2019 Simplex Algorithm Chapter7 Mat Gsia Cmu Edu
3/10
7 . 2 . S O L U T I O N O F L I N E A R P R O G R A M S B Y T H E S I M P L E X M E T H O D 8 9
O u r g o a l i s t o m a x i m i z e z , w h i l e s a t i s f y i n g t h e s e e q u a t i o n s a n d , i n a d d i t i o n , x
1
0 , x
2
0 ,
x
3
0 , x
4
0
N o t e t h a t t h e e q u a t i o n s a r e a l r e a d y i n t h e f o r m t h a t w e e x p e c t a t t h e l a s t s t e p o f t h e G a u s s -
J o r d a n p r o c e d u r e . N a m e l y , t h e e q u a t i o n s a r e s o l v e d i n t e r m s o f t h e n o n b a s i c v a r i a b l e s x
1
, x
2
T h e v a r i a b l e s o t h e r t h a n t h e s p e c i a l v a r i a b l e z w h i c h a p p e a r i n o n l y o n e e q u a t i o n a r e t h e b a s i c
v a r i a b l e s . H e r e t h e b a s i c v a r i a b l e s a r e x
3
a n d x
4
A b a s i c s o l u t i o n i s o b t a i n e d f r o m t h e s y s t e m o f
e q u a t i o n s b y s e t t i n g t h e n o n b a s i c v a r i a b l e s t o z e r o . H e r e t h i s y i e l d s
x
1
= x
2
= 0 x
3
= 4 x
4
= 3 z = 0
I s t h i s a n o p t i m a l s o l u t i o n o r c a n w e i n c r e a s e z ? O u r g o a l
B y l o o k i n g a t R o w 0 a b o v e , w e s e e t h a t w e c a n i n c r e a s e z b y i n c r e a s i n g x
1
o r x
2
. T h i s i s
b e c a u s e t h e s e v a r i a b l e s h a v e a n e g a t i v e c o e c i e n t i n R o w 0 . I f a l l c o e c i e n t s i n R o w 0 h a d b e e n
n o n n e g a t i v e , w e c o u l d h a v e c o n c l u d e d t h a t t h e c u r r e n t b a s i c s o l u t i o n i s o p t i m u m , s i n c e t h e r e w o u l d
b e n o w a y t o i n c r e a s e z r e m e m b e r t h a t a l l v a r i a b l e s x
i
m u s t r e m a i n 0 . W e h a v e j u s t d i s c o v e r e d
t h e r s t r u l e o f t h e s i m p l e x m e t h o d .
R u l e 1 I f a l l v a r i a b l e s h a v e a n o n n e g a t i v e c o e c i e n t i n R o w 0 , t h e c u r r e n t b a s i c s o l u t i o n i s
o p t i m a l .
O t h e r w i s e , p i c k a v a r i a b l e x
j
w i t h a n e g a t i v e c o e c i e n t i n R o w 0 .
T h e v a r i a b l e c h o s e n b y R u l e 1 i s c a l l e d t h e e n t e r i n g v a r i a b l e . H e r e l e t u s c h o o s e , s a y , x
1
a s o u r
e n t e r i n g v a r i a b l e . I t r e a l l y d o e s n o t m a t t e r w h i c h v a r i a b l e w e c h o o s e a s l o n g a s i t h a s a n e g a t i v e
c o e c i e n t i n R o w 0 . T h e i d e a i s t o p i v o t i n o r d e r t o m a k e t h e n o n b a s i c v a r i a b l e x
1
b e c o m e a b a s i c
v a r i a b l e . I n t h e p r o c e s s , s o m e b a s i c v a r i a b l e w i l l b e c o m e n o n b a s i c t h e l e a v i n g v a r i a b l e . T h i s
c h a n g e o f b a s i s i s d o n e u s i n g t h e G a u s s - J o r d a n p r o c e d u r e . W h a t i s n e e d e d n e x t i s t o c h o o s e t h e
p i v o t e l e m e n t . I t w i l l b e f o u n d u s i n g R u l e 2 o f t h e s i m p l e x m e t h o d . I n o r d e r t o b e t t e r u n d e r s t a n d
t h e r a t i o n a l e b e h i n g t h i s s e c o n d r u l e , l e t u s t r y b o t h p o s s i b l e p i v o t s a n d s e e w h y o n l y o n e i s
a c c e p t a b l e .
F i r s t , t r y t h e p i v o t e l e m e n t i n R o w 1 .
z , x
1
, x
2
= 0 R o w 0
2 x
1
+ x
2
+ x
3
= 4 R o w 1
x
1
+ 2 x
2
+ x
4
= 3 R o w 2
T h i s y i e l d s
z ,
1
2
x
2
+
1
3
x
3
= 2 R o w 0
x
1
+
1
2
x
2
+
1
2
x
3
= 2 R o w 1
3
2
x
2
,
1
2
x
3
+ x
4
= 1 R o w 2
w i t h b a s i c s o l u t i o n x
2
= x
3
= 0 x
1
= 2 x
4
= 1 z = 2
N o w , t r y t h e p i v o t e l e m e n t i n R o w 2 .
z , x
1
, x
2
= 0 R o w 0
2 x
1
+ x
2
+ x
3
= 4 R o w 1
x
1
+ 2 x
2
+ x
4
= 3 R o w 2
T h i s y i e l d s
-
7/22/2019 Simplex Algorithm Chapter7 Mat Gsia Cmu Edu
4/10
9 0 C H A P T E R 7 . T H E S I M P L E X M E T H O D
z + x
2
+ x
4
= 3 R o w 0
, 3 x
2
+ x
3
, 2 x
4
= , 2 R o w 1
x
1
+ 2 x
2
+ x
4
= 3 R o w 2
w i t h b a s i c s o l u t i o n x
2
= x
4
= 0 x
1
= 3 x
3
= , 2 z = 3
W h i c h p i v o t s h o u l d w e c h o o s e ? T h e r s t o n e , o f c o u r s e , s i n c e t h e s e c o n d y i e l d s a n i n f e a s i b l e
b a s i c s o l u t i o n ! I n d e e d , r e m e m b e r t h a t w e m u s t k e e p a l l v a r i a b l e s 0 . W i t h t h e s e c o n d p i v o t , w e
g e t x
3
= , 2 w h i c h i s i n f e a s i b l e . H o w c o u l d w e h a v e k n o w n t h i s a h e a d o f t i m e , b e f o r e a c t u a l l y
p e r f o r m i n g t h e p i v o t s ? T h e a n s w e r i s , b y c o m p a r i n g t h e r a t i o s
R i g h t H a n d S i d e
E n t e r i n g V a r i a b l e C o e c i e n t
i n
R o w s 1 a n d 2 o f 7 . 1 . H e r e w e g e t
4
2
i n R o w 1 a n d
3
1
i n R o w 2 . I f y o u p i v o t i n a r o w w i t h m i n i m u m
r a t i o , y o u w i l l e n d u p w i t h a f e a s i b l e b a s i c s o l u t i o n i . e . y o u w i l l n o t i n t r o d u c e n e g a t i v e e n t r i e s i n
t h e R i g h t H a n d S i d e , w h e r e a s i f y o u p i v o t i n a r o w w i t h a r a t i o w h i c h i s n o t m i n i m u m y o u w i l l
a l w a y s e n d u p w i t h a n i n f e a s i b l e b a s i c s o l u t i o n . J u s t s i m p l e a l g e b r a ! A n e g a t i v e p i v o t e l e m e n t
w o u l d n o t b e g o o d e i t h e r , f o r t h e s a m e r e a s o n . W e h a v e j u s t d i s c o v e r e d t h e s e c o n d r u l e o f t h e
s i m p l e x m e t h o d .
R u l e 2 F o r e a c h R o w i , i 1 , w h e r e t h e r e i s a s t r i c t l y p o s i t i v e e n t e r i n g v a r i a b l e c o e c i e n t " ,
c o m p u t e t h e r a t i o o f t h e R i g h t H a n d S i d e t o t h e e n t e r i n g v a r i a b l e c o e c i e n t " . C h o o s e t h e p i v o t
r o w a s b e i n g t h e o n e w i t h M I N I M U M r a t i o .
O n c e y o u h a v e i d e n d i e d t h e p i v o t e l e m e n t b y R u l e 2 , y o u p e r f o r m a G a u s s - J o r d a n p i v o t . T h i s
g i v e s y o u a n e w b a s i c s o l u t i o n . I s i t a n o p t i m a l s o l u t i o n ? T h i s q u e s t i o n i s a d d r e s s e d b y R u l e 1 , s o
w e h a v e c l o s e d t h e l o o p . T h e s i m p l e x m e t h o d i t e r a t e s b e t w e e n R u l e s 1 , 2 a n d p i v o t i n g u n t i l R u l e
1 g u a r a n t e e s t h a t t h e c u r r e n t b a s i c s o l u t i o n i s o p t i m a l . T h a t ' s a l l t h e r e i s t o t h e s i m p l e x m e t h o d .
A f t e r o u r r s t p i v o t , w e o b t a i n e d t h e f o l l o w i n g s y s t e m o f e q u a t i o n s .
z ,
1
2
x
2
+
1
3
x
3
= 2 R o w 0
x
1
+
1
2
x
2
+
1
2
x
3
= 2 R o w 1
3
2
x
2
,
1
2
x
3
+ x
4
= 1 R o w 2
w i t h b a s i c s o l u t i o n x
2
= x
3
= 0 x
1
= 2 x
4
= 1 z = 2
I s t h i s s o l u t i o n o p t i m a l ? N o , R u l e 1 t e l l s u s t o c h o o s e x
2
a s e n t e r i n g v a r i a b l e . W h e r e s h o u l d
w e p i v o t ? R u l e 2 t e l l s u s t o p i v o t i n R o w 2 , s i n c e t h e r a t i o s a r e
2
1 = 2
= 4 f o r R o w 1 , a n d
1
3 = 2
=
2
3
f o r
R o w 2 , a n d t h e m i n i m u m o c c u r s i n R o w 2 . S o w e p i v o t o n
3
2
x
2
i n t h e a b o v e s y s t e m o f e q u a t i o n s .
T h i s y i e l d s
z +
1
3
x
3
+
1
3
x
4
=
7
3
R o w 0
x
1
+
2
3
x
3
,
1
3
x
4
=
5
3
R o w 1
x
2
,
1
3
x
3
+
2
3
x
4
=
2
3
R o w 2
w i t h b a s i c s o l u t i o n x
3
= x
4
= 0 x
1
=
5
3
x
2
=
2
3
z =
7
3
N o w R u l e 1 t e l l s u s t h a t t h i s b a s i c s o l u t i o n i s o p t i m a l , s i n c e t h e r e a r e n o m o r e n e g a t i v e e n t r i e s
i n R o w 0 .
A l l t h e a b o v e c o m p u t a t i o n s c a n b e r e p r e s e n t e d v e r y c o m p a c t l y i n t a b l e a u f o r m
-
7/22/2019 Simplex Algorithm Chapter7 Mat Gsia Cmu Edu
5/10
7 . 2 . S O L U T I O N O F L I N E A R P R O G R A M S B Y T H E S I M P L E X M E T H O D 9 1
z x
1
x
2
x
3
x
4
R H S B a s i c s o l u t i o n
1 , 1 , 1 0 0 0 b a s i c x
3
= 4 x
4
= 3
0 2 1 1 0 4 n o n b a s i c x
1
= x
2
= 0
0 1 2 0 1 3 z = 0
1 0 ,
1
2
1
2
0 2 b a s i c x
1
= 2 x
4
= 1
0 1
1
2
1
2
0 2 n o n b a s i c x
2
= x
3
= 0
0 0
3
2
,
1
2
1 1 z = 2
1 0 0
1
3
1
3
7
3
b a s i c x
1
=
5
3
x
2
=
2
3
0 1 0
2
3
,
1
3
5
3
n o n b a s i c x
3
= x
4
= 0
0 0 1 ,
1
3
2
3
2
3
z =
7
3
S i n c e t h e a b o v e e x a m p l e h a s o n l y t w o v a r i a b l e s , i t i s i n t e r e s t i n g t o i n t e r p r e t t h e s t e p s o f t h e
s i m p l e x m e t h o d g r a p h i c a l l y . S e e F i g u r e 7 . 1 . T h e s i m p l e x m e t h o d s t a r t s i n t h e c o r n e r p o i n t x
1
=
0 ; x
2
= 0 w i t h z = 0 . T h e n i t d i s c o v e r s t h a t z c a n i n c r e a s e b y i n c r e a s i n g , s a y , x
1
. S i n c e w e k e e p
x
2
= 0 , t h i s m e a n s w e m o v e a l o n g t h e x
1
a x i s . H o w f a r c a n w e g o ? O n l y u n t i l w e h i t a c o n s t r a i n t :
i f w e w e n t a n y f u r t h e r , t h e s o l u t i o n w o u l d b e c o m e i n f e a s i b l e . T h a t ' s e x a c t l y w h a t R u l e 2 o f t h e
s i m p l e x m e t h o d d o e s : t h e m i n i m u m r a t i o r u l e i d e n t i e s t h e r s t c o n s t r a i n t t h a t w i l l b e e n c o u n t e r e d .
A n d w h e n t h e c o n s t r a i n t i s r e a c h e d , i t s s l a c k x
3
b e c o m e s z e r o . S o , a f t e r t h e r s t p i v o t , w e a r e a t
t h e p o i n t x
1
= 2 ; x
2
= 0 . R u l e 1 d i s c o v e r s t h a t z c a n b e i n c r e a s e d b y i n c r e a s i n g x
2
w h i l e k e e p i n g
x
3
= 0 . T h i s m e a n s t h a t w e m o v e a l o n g t h e b o u n d a r y o f t h e f e a s i b l e r e g i o n 2 x
1
+ x
2
= 4 u n t i l w e
r e a c h a n o t h e r c o n s t r a i n t ! A f t e r p i v o t i n g , w e r e a c h t h e o p t i m a l p o i n t x
1
=
5
3
; x
2
=
2
3
z=7/3
x2
x1z=0 z=2
F i g u r e 7 . 1 : G r a p h i c a l I n t e r p r e t a t i o n
-
7/22/2019 Simplex Algorithm Chapter7 Mat Gsia Cmu Edu
6/10
9 2 C H A P T E R 7 . T H E S I M P L E X M E T H O D
E x e r c i s e 6 2 S o l v e t h e f o l l o w i n g l i n e a r p r o g r a m b y t h e s i m p l e x m e t h o d .
m a x 4 x
1
+ x
2
, x
3
x
1
+ 3 x
3
6
3 x
1
+ x
2
+ 3 x
3
9
x
1
0 ; x
2
0 x
3
0
7 . 3 A l t e r n a t e O p t i m a l S o l u t i o n s , D e g e n e r a c y , U n b o u d e d n e s s , I n -
f e a s i b i l i t y
A l t e r n a t e O p t i m a l S o l u t i o n s
L e t u s s o l v e a s m a l l v a r i a t i o n o f t h e e a r l i e r e x a m p l e , w i t h t h e s a m e c o n s t r a i n t s b u t a s l i g h t l y
d i e r e n t o b j e c t i v e :
m a x x
1
+
1
2
x
2
2 x
1
+ x
2
4
x
1
+ 2 x
2
3
x
1
0 ; x
2
0
A s b e f o r e , w e a d d s l a c k s x
3
a n d x
4
, a n d w e s o l v e b y t h e s i m p l e x m e t h o d , u s i n g t a b l e a u r e p r e -
s e n t a t i o n .
z x
1
x
2
x
3
x
4
R H S B a s i c s o l u t i o n
1 , 1 ,
1
2
0 0 0 b a s i c x
3
= 4 x
4
= 3
0 2 1 1 0 4 n o n b a s i c x
1
= x
2
= 0
0 1 2 0 1 3 z = 0
1 0 0
1
2
0 2 b a s i c x
1
= 2 x
4
= 1
0 1
1
2
1
2
0 2 n o n b a s i c x
2
= x
3
= 0
0 0
3
2
,
1
2
1 1 z = 2
N o w R u l e 1 s h o w s t h a t t h i s i s a n o p t i m a l s o l u t i o n . I n t e r e s t i n g l y , t h e c o e c i e n t o f t h e n o n b a s i c
v a r i a b l e x
2
i n R o w 0 h a p p e n s t o b e e q u a l t o 0 . G o i n g b a c k t o t h e r a t i o n a l e t h a t a l l o w e d u s t o
d e r i v e R u l e 1 , w e o b s e r v e t h a t , i f w e i n c r e a s e x
2
f r o m i t s c u r r e n t v a l u e o f 0 , t h i s w i l l n o t e e c t t h e
v a l u e o f z . I n c r e a s i n g x
2
p r o d u c e s c h a n g e s i n t h e o t h e r v a r i a b l e s , o f c o u r s e , t h r o u g h t h e e q u a t i o n s
i n R o w s 1 a n d 2 . I n f a c t , w e c a n u s e R u l e 2 a n d p i v o t t o g e t a d i e r e n t b a s i c s o l u t i o n w i t h t h e
s a m e o b j e c t i v e v a l u e z = 2
z x
1
x
2
x
3
x
4
R H S B a s i c s o l u t i o n
1 0 0
1
2
0 2 b a s i c x
1
=
5
3
x
2
=
2
3
0 1 0
2
3
,
1
3
5
3
n o n b a s i c x
3
= x
4
= 0
0 0 1 ,
1
3
2
3
2
3
z = 2
N o t e t h a t t h e c o e c i e n t o f t h e n o n b a s i c v a r i a b l e x
4
i n R o w 0 i s e q u a l t o 0 . U s i n g x
4
a s e n t e r i n g
v a r i a b l e a n d p i v o t i n g , w e w o u l d r e c o v e r t h e p r e v i o u s s o l u t i o n !
-
7/22/2019 Simplex Algorithm Chapter7 Mat Gsia Cmu Edu
7/10
7 . 3 . A L T E R N A T E O P T I M A L S O L U T I O N S , D E G E N E R A C Y , U N B O U D E D N E S S , I N F E A S I B I L I T Y 9 3
D e g e n e r a c y
E x a m p l e 7 . 3 . 1
m a x 2 x
1
+ x
2
3 x
1
+ x
2
6
x
1
, x
2
2
x
2
3
x
1
0 ; x
2
0
L e t u s s o l v e t h i s p r o b l e m u s i n g t h e b y n o w f a m i l i a r s i m p l e x m e t h o d . I n t h e i n i t i a l t a b l e a u ,
w e c a n c h o o s e x
1
a s t h e e n t e r i n g v a r i a b l e R u l e 1 a n d R o w 2 a s t h e p i v o t r o w t h e m i n i m u m r a t i o
i n R u l e 2 i s a t i e , a n d t i e s a r e b r o k e n a r b i t r a r i l y . W e p i v o t a n d t h i s y i e l d s t h e s e c o n d t a b l e a u
b e l o w .
z x
1
x
2
x
3
x
4
x
5
R H S B a s i c s o l u t i o n
1 , 2 , 1 0 0 0 0 b a s i c x
3
= 6 x
4
= 2 x
5
= 3
0 3 1 1 0 0 6 n o n b a s i c x
1
= x
2
= 0
0 1 , 1 0 1 0 2 z = 0
0 0 1 0 0 1 3
1 0 , 3 0 2 0 4 b a s i c x
1
= 2 x
3
= 0 x
5
= 3
0 0 4 1 , 3 0 0 n o n b a s i c x
2
= x
4
= 0
0 1 , 1 0 1 0 2 z = 4
0 0 1 0 0 1 3
N o t e t h a t t h i s b a s i c s o l u t i o n h a s a b a s i c v a r i a b l e n a m e l y x
3
w h i c h i s e q u a l t o z e r o . W h e n t h i s
o c c u r s , w e s a y t h a t t h e b a s i c s o l u t i o n i s d e g e n e r a t e . S h o u l d t h i s b e o f c o n c e r n ? L e t u s c o n t i n u e t h e
s t e p s o f t h e s i m p l e x m e t h o d . R u l e 1 i n d i c a t e s t h a t x
2
i s t h e e n t e r i n g v a r i a b l e . N o w l e t u s a p p l y
R u l e 2 . T h e r a t i o s t o c o n s i d e r a r e
0
4
i n R o w 1 a n d
3
1
i n R o w 3 . T h e m i n i m u m r a t i o o c c u r s i n R o w
1 , s o l e t u s p e r f o r m t h e c o r r e s p o n d i n g p i v o t .
z x
1
x
2
x
3
x
4
x
5
R H S B a s i c s o l u t i o n
1 0 0
3
4
,
1
4
0 4 b a s i c x
1
= 2 x
2
= 0 x
5
= 3
0 0 1
1
4
,
3
4
0 0 n o n b a s i c x
3
= x
4
= 0
0 1 0
1
4
1
4
0 2 z = 4
0 0 0 ,
1
4
3
4
1 3
W e g e t e x a c t l y t h e s a m e s o l u t i o n ! T h e o n l y d i e r e n c e i s t h a t w e h a v e i n t e r c h a n g e d t h e n a m e s
o f a n o n b a s i c v a r i a b l e w i t h t h a t o f a d e g e n e r a t e b a s i c v a r i a b l e x
2
a n d x
3
. R u l e 1 t e l l s u s t h e
s o l u t i o n i s n o t o p t i m a l , s o l e t u s c o n t i n u e t h e s t e p s o f t h e s i m p l e x m e t h o d . V a r i a b l e x
4
i s t h e
e n t e r i n g v a r i a b l e a n d t h e l a s t r o w w i n s t h e m i n i m u m r a t i o t e s t . A f t e r p i v o t i n g , w e g e t t h e t a b l e a u :
z x
1
x
2
x
3
x
4
x
5
R H S B a s i c s o l u t i o n
1 0 0
2
3
0
1
3
5 b a s i c x
1
= 1 x
2
= 3 x
4
= 4
0 0 1 0 0 1 3 n o n b a s i c x
3
= x
5
= 0
0 1 0
1
3
0 ,
1
3
1 z = 5
0 0 0 ,
1
3
1
4
3
4
B y R u l e 1 , t h i s i s t h e o p t i m a l s o l u t i o n . S o , a f t e r a l l , d e g e n e r a c y d i d n o t p r e v e n t t h e s i m p l e x
m e t h o d t o n d t h e o p t i m a l s o l u t i o n i n t h i s e x a m p l e . I t j u s t s l o w e d t h i n g s d o w n a l i t t l e . U n f o r -
t u n a t e l y , o n o t h e r e x a m p l e s , d e g e n e r a c y m a y l e a d t o c y c l i n g , i . e . a s e q u e n c e o f p i v o t s t h a t g o e s
-
7/22/2019 Simplex Algorithm Chapter7 Mat Gsia Cmu Edu
8/10
9 4 C H A P T E R 7 . T H E S I M P L E X M E T H O D
t h r o u g h t h e s a m e t a b l e a u s a n d r e p e a t s i t s e l f i n d e n i t e l y . I n t h e o r y , c y c l i n g c a n b e a v o i d e d b y
c h o o s i n g t h e e n t e r i n g v a r i a b l e w i t h s m a l l e s t i n d e x i n R u l e 1 , a m o n g a l l t h o s e w i t h a n e g a t i v e c o e f -
c i e n t i n R o w 0 , a n d b y b r e a k i n g t i e s i n t h e m i n i m u m r a t i o t e s t b y c h o o s i n g t h e l e a v i n g v a r i a b l e
w i t h s m a l l e s t i n d e x t h i s i s k n o w n a s B l a n d ' s r u l e . T h i s r u l e , a l t h o u g h i t g u a r a n t i e s t h a t c y c l i n g
w i l l n e v e r o c c u r , t u r n s o u t t o b e s o m e w h a t i n e c i e n t . A c t u a l l y , i n c o m m e r c i a l c o d e s , n o e o r t i s
m a d e t o a v o i d c y c l i n g . T h i s m a y c o m e a s a s u r p r i s e , s i n c e d e g e n e r a c y i s a f r e q u e n t o c c u r e n c e . B u t
t h e r e a r e t w o r e a s o n s f o r t h i s :
A l t h o u g h d e g e n e r a c y i s f r e q u e n t , c y c l i n g i s e x t r e m e l y r a r e .
T h e p r e c i s i o n o f c o m p u t e r a r i t h m e t i c t a k e s c a r e o f c y c l i n g b y i t s e l f : r o u n d o e r r o r s a c c u m u -
l a t e a n d e v e n t u a l l y g e t s t h e m e t h o d o u t o f c y c l i n g .
O u r e x a m p l e o f d e g e n e r a c y i s a 2 - v a r i a b l e p r o b l e m , s o y o u m i g h t w a n t t o d r a w t h e c o n s t r a i n t
s e t i n t h e p l a n e a n d i n t e r p r e t d e g e n e r a c y g r a p h i c a l l y .
U n b o u n d e d O p t i m u m
E x a m p l e 7 . 3 . 2
m a x 2 x
1
+ x
2
, x
1
+ x
2
1
x
1
, 2 x
2
2
x
1
0 ; x
2
0
S o l v i n g b y t h e s i m p l e x m e t h o d , w e g e t :
z x
1
x
2
x
3
x
4
R H S B a s i c s o l u t i o n
1 , 2 , 1 0 0 0 b a s i c x
3
= 1 x
4
= 2
0 , 1 1 1 0 1 n o n b a s i c x
1
= x
2
= 0
0 1 , 2 0 1 2 z = 0
1 0 , 5 0 2 4 b a s i c x
1
= 2 x
3
= 3
0 0 , 1 1 1 3 n o n b a s i c x
2
= x
4
= 0
0 1 , 2 0 1 2 z = 4
A t t h i s s t a g e , R u l e 1 c h o o s e s x
2
a s t h e e n t e r i n g v a r i a b l e , b u t t h e r e i s n o r a t i o t o c o m p u t e , s i n c e
t h e r e i s n o p o s i t i v e e n t r y i n t h e c o l u m n o f x
2
. A s w e s t a r t i n c r e a s i n g x
2
, t h e v a l u e o f z i n c r e a s e s
f r o m R o w 0 a n d t h e v a l u e s o f t h e b a s i c v a r i a b l e s i n c r e a s e a s w e l l f r o m R o w s 1 a n d 2 . T h e r e i s
n o t h i n g t o s t o p t h e m g o i n g o t o i n n i t y . S o t h e p r o b l e m i s u n b o u n d e d .
I n t e r p r e t t h e s t e p s o f t h e s i m p l e x m e t h o d g r a p h i c a l l y f o r t h i s e x a m p l e .
I n f e a s i b l e L i n e a r P r o g r a m s
I t i s e a s y t o c o n s t r u c t c o n s t r a i n t s t h a t h a v e n o s o l u t i o n . T h e s i m p l e x m e t h o d i s a b l e t o i d e n t i f y
s u c h c a s e s . W e d o n o t d i s c u s s i t h e r e . T h e i n t e r e s t e d r e a d e r i s r e f e r r e d t o W i n s t o n , f o r e x a m p l e .
P r o p e r t i e s o f L i n e a r P r o g r a m s
T h e r e a r e t h r e e p o s s i b l e o u t c o m e s f o r a l i n e a r p r o g r a m : i t i s i n f e a s i b l e , i t h a s a n u n b o u n d e d
o p t i m u m o r i t h a s a n o p t i m a l s o l u t i o n .
-
7/22/2019 Simplex Algorithm Chapter7 Mat Gsia Cmu Edu
9/10
7 . 3 . A L T E R N A T E O P T I M A L S O L U T I O N S , D E G E N E R A C Y , U N B O U D E D N E S S , I N F E A S I B I L I T Y 9 5
I f t h e r e i s a n o p t i m a l s o l u t i o n , t h e r e i s a b a s i c o p t i m a l s o l u t i o n . R e m e m b e r t h a t t h e n u m b e r o f
b a s i c v a r i a b l e s i n a b a s i c s o l u t i o n i s e q u a l t o t h e n u m b e r o f c o n s t r a i n t s o f t h e p r o b l e m , s a y m . S o ,
e v e n i f t h e t o t a l n u m b e r o f v a r i a b l e s , s a y n , i s g r e a t e r t h a n m , a t m o s t m o f t h e s e v a r i a b l e s c a n
h a v e a p o s i t i v e v a l u e i n a n o p t i m a l b a s i c s o l u t i o n .
E x e r c i s e 6 3 T h e f o l l o w i n g t a b l e a u s w e r e o b t a i n e d i n t h e c o u r s e o f s o l v i n g l i n e a r p r o g r a m s w i t h 2
n o n n e g a t i v e v a r i a b l e s x
1
a n d x
2
a n d 2 i n e q u a l i t y c o n s t r a i n t s t h e o b j e c t i v e f u n c t i o n z i s m a x i m i z e d .
S l a c k v a r i a b l e s s
1
a n d s
2
w e r e a d d e d . I n e a c h c a s e , i n d i c a t e w h e t h e r t h e l i n e a r p r o g r a m
i i s u n b o u n d e d
i i h a s a u n i q u e o p t i m u m s o l u t i o n
i i i h a s a n a l t e r n a t e o p t i m u m s o l u t i o n
i v i s d e g e n e r a t e i n t h i s c a s e , i n d i c a t e w h e t h e r a n y o f t h e a b o v e h o l d s .
a
z x
1
x
2
s
1
s
2
R H S
1 0 3 2 0 2 0
0 1 , 2 , 1 0 4
0 0 , 1 0 1 2
b
z x
1
x
2
s
1
s
2
R H S
1 0 , 1 0 2 2 0
0 0 0 1 , 2 5
0 1 , 2 0 3 6
c
z x
1
x
2
s
1
s
2
R H S
1 2 0 0 1 8
0 3 1 0 , 2 4
0 , 2 0 1 1 0
d
z x
1
x
2
s
1
s
2
R H S
1 0 0 2 0 5
0 0 , 1 1 1 4
0 1 1 , 1 0 4
E x e r c i s e 6 4 S u p p o s e t h e f o l l o w i n g t a b l e a u w a s o b t a i n e d i n t h e c o u r s e o f s o l v i n g a l i n e a r p r o g r a m
w i t h n o n n e g a t i v e v a r i a b l e s x
1
; x
2
; x
3
a n d t w o i n e q u a l i t i e s . T h e o b j e c t i v e f u n c t i o n i s m a x i m i z e d a n d
s l a c k v a r i a b l e s s
1
a n d s
2
w e r e a d d e d .
z x
1
x
2
x
3
s
1
s
2
R H S
1 0 a b 0 4 8 2
0 0 , 2 2 1 3 c
0 1 , 1 3 0 , 5 3
G i v e c o n d i t i o n s o n a , b a n d c t h a t a r e r e q u i r e d f o r t h e f o l l o w i n g s t a t e m e n t s t o b e t r u e :
i T h e c u r r e n t b a s i c s o l u t i o n i s a f e a s i b l e b a s i c s o l u t i o n .
A s s u m e t h a t t h e c o n d i t i o n f o u n d i n i h o l d s i n t h e r e s t o f t h e e x e r c i s e .
i i T h e c u r r e n t b a s i c s o l u t i o n i s o p t i m a l .
-
7/22/2019 Simplex Algorithm Chapter7 Mat Gsia Cmu Edu
10/10
9 6 C H A P T E R 7 . T H E S I M P L E X M E T H O D
i i i T h e l i n e a r p r o g r a m i s u n b o u n d e d f o r t h i s q u e s t i o n , a s s u m e t h a t b 0
i v T h e c u r r r e n t b a s i c s o l u t i o n i s o p t i m a l a n d t h e r e a r e a l t e r n a t e o p t i m a l s o l u t i o n s f o r t h i s
q u e s t i o n , a s s u m e a 0
E x e r c i s e 6 5 A p l a n t c a n m a n u f a c t u r e v e p r o d u c t s P
1
, P
2
, P
3
, P
4
a n d P
5
. T h e p l a n t c o n s i s t s
o f t w o w o r k a r e a s : t h e j o b s h o p a r e a A
1
a n d t h e a s s e m b l y a r e a A
2
. T h e t i m e r e q u i r e d t o p r o c e s s
o n e u n i t o f p r o d u c t P
j
i n w o r k a r e a A
i
i s p
i j
i n h o u r s , f o r i = 1 ; 2 a n d j = 1 ; : : : ; 5 . T h e w e e k l y
c a p a c i t y o f w o r k a r e a A
i
i s C
i
i n h o u r s . T h e c o m p a n y c a n s e l l a l l i t p r o d u c e s o f p r o d u c t P
j
a t a
p r o t o f s
j
, f o r i = 1 ; : : : ; 5
T h e p l a n t m a n a g e r t h o u g h t o f w r i t i n g a l i n e a r p r o g r a m t o m a x i m i z e p r o t s , b u t n e v e r a c t u a l l y
d i d f o r t h e f o l l o w i n g r e a s o n : F r o m p a s t e x p e r i e n c e , h e o b s e r v e d t h a t t h e p l a n t o p e r a t e s b e s t w h e n
a t m o s t t w o p r o d u c t s a r e m a n u f a c t u r e d a t a t i m e . H e b e l i e v e s t h a t i f h e u s e s l i n e a r p r o g r a m m i n g ,
t h e o p t i m a l s o l u t i o n w i l l c o n s i s t o f p r o d u c i n g a l l v e p r o d u c t s . D o y o u a g r e e w i t h h i m ? E x p l a i n ,
b a s e d o n y o u r k n o w l e d g e o f l i n e a r p r o g r a m m i n g .
E x e r c i s e 6 6 C o n s i d e r t h e l i n e a r p r o g r a m
M a x i m i z e 5 x
1
+ 3 x
2
+ x
3
S u b j e c t t o
x
1
+ x
2
+ x
3
6
5 x
1
+ 3 x
2
+ 6 x
3
1 5
x
1
; x
2
; x
3
0
a n d a n a s s o c i a t e d t a b l e a u
z x
1
x
2
x
3
s
1
s
2
R H S
1 0 0 5 0 1 1 5
0 0 . 4 - 0 . 2 1 - . 2 3
0 1 . 6 1 . 2 0 . 2 3
a W h a t b a s i c s o l u t i o n d o e s t h i s t a b l e a u r e p r e s e n t ? I s t h i s s o l u t i o n o p t i m a l ? W h y o r w h y n o t ?
b D o e s t h i s t a b l e a u r e p r e s e n t a u n i q u e o p t i m u m . I f n o t , n d a n a l t e r n a t i v e o p t i m a l s o l u t i o n .
A n s w e r :
a T h e s o l u t i o n i s x
1
= 3 , x
2
; x
3
= 0 , o b j e c t i v e 1 5 . I t i s o p t i m a l s i n c e c o s t r o w i s a l l a t l e a s t 0 .
b I t i s n o t u n i q u e s i n c e x
2
h a s r e d u c e d c o s t 0 b u t i s n o t b a s i c . A l t e r n a t i v e f o u n d b y p i v o t i n g
i n x
2
q u e s t i o n c o u l d h a v e a s k e d f o r d e t a i l s o n s u c h a p i v o t f o r s o l u t i o n x
2
= 5 , x
1
; x
3
= 0 ,
o b j e c t i v e 1 5 .