Linear Programming
Linear Programming
By
AREMU, A.O. (04/30GB024)
Department of Civil Engineering
University of Ilorin, Nigeria
¿ equation ( 2 )
when x 1=0 , x 2 ≤ 6(0 , 6)
x 2=0 , x 1 ≤ 3(3 , 0)
¿ equation ( 3 )
when x 1=0 , x 2 ≤ 3.5(0 , 3.5)
x 2=0 , x 1 ≤ 4 (4 , 0)
¿ graph(1)
x 1=2.22 , x 2=1.58 Z (2.22 ,1.58)
Z=120 ×2.22+80 ×1.58
¿ 266.4+ 126.4
¿ 392.8
Graph 1: x 2 Vs x 1
7
x2
6
4 2 x1 + x 2 ≤6
3
Z (2.22 ,1.58)
2
7 x 1+ 8 x2 ≤28
0
0 0.5 1 1.5 2 2.5 3 3.5 4x 4.5
1
2. Max Z=140 x 1 +160 x 2 …………………………………………………………….. (1)
s . t 2 x 1 + 4 x 2 ≤ 28 …………………………………………………………….. (2)
5 x 1+5 x 2 ≤ 50 …………………………………………………………….. (3)
x1 , x2 ≥ 0
¿ equation ( 2 )
when x 1=0 , x 2 ≤ 7(0 , 7)
x 2=0 , x 1 ≤ 14(14 , 0)
¿ equation ( 3 )
when x 1=0 , x 2 ≤ 10(0 , 10)
x 2=0 , x 1 ≤ 10(10 , 0)
¿ graph(2)
x 1=6 x 2=4 Z (6 , 4)
Z=140 ×6+160 × 4
¿ 840+640
¿ 1480
Graph 2: x 2 Vs x 1
12
x2
10
5 x 1+5 x 2 ≤ 50
8
6 Z (6 , 4)
2 x1 + 4 x 2 ≤ 28
4
0
0 2 4 6 8 10 12 14 16
x1
SIMPLEX METHOD
1. Converting the linear programming to standard form by introducing slack variables and equate Z = 0
¿ ( i ) Z−4 x 1−3 x2 −6 x3 =0 Row 0
¿ ( ii ) 2 x 1 +3 x 2+ 2 x 3 +S 1=440 Row 1
¿ ( iii ) 4 x 1+ 3 x 3 + S2=470 Row 2
¿ ( iv ) 2 x1 +5 x 2+ S 3=430 Row 3
x1 , x2 , x3 ≥ 0
∴ x3 is the entering variables being the one of the NBV that gives the highest value of Z (It has the most
negative coefficient in row 0)
440
¿ =220
2
470
Row 2 limit on x 3= =156.67
3
∴Row 2 is the “winner of ratio test” being the row with smallest ratio (pivot row). The smallest ratio is
the largest entering variable that will keep the current basic variable non-negative.
ERO 1
4 x 1 3 x 2 S 2 470
+ + =
3 3 3 3
'
1.33 x 1+ x 3 +0.33 S2=156.67 … … … … … … … … … … … … … … … ..(Row 2 )
ERO 2
To create a zero coefficient for x 3 in row 0, by replacing row 0 with 6(row 2’) + row 0 i.e eliminate x 3
'
Z+3.98 x 1−3 x 2 +1.98 S 2=940 … … … … … … … … … … … … … … … … .(Row 0 )
ERO 3
To create a zero coefficient for x 3 in row 1, by replacing row 1 with -2(row 2’) + row 1 i.e eliminate x 3
'
−0.66 x 1 +3 x2 + S1−0.66 S 2=126.66 … … … … … … … … … … … … … … … … .(Row 1 )
ERO 4
To create a zero coefficient for x 3 in row 3, since x 3 does not appear in row 3, then we don’t need to
perform ERO.
Therefore BV = [ Z , S1 , S 3 , x 3 ]
NBV = [ S2 , x 1 , x2 ]
Basic Variables
i.e from Row 0’ S2=x 1=x 2 Z=940
Row 1’ x 1=x 2=S2=0 S1 =126.66
Row 2’ x 1=S2=0 x 3=156.67
Row 3’ x 1=x 2=0 S3=430
Repeating step 3
2nd iteration
Entering variable
Increasing NBV x 1 by 1 while x 2=S2=0 will decrease Z by 3.98
Increasing NBV x 2 by 1 while x 1=S2=0 will increase Z by 3
Increasing NBV S2 by 1 while x 1=x 2=0 will decrease Z by 1.98
∴ x2 is the entering variables being the one of the NBV that gives the highest value of Z (It has the most
negative coefficient in row 0)
126.66
¿ =42.22
3
Row 2’ limit on x 2=No Limit (Because coefficient of x 2 is non positive∨zero ∈row 2 ').
430
Row 3’ limit on x 3= =86
5
∴Row 1’ is the “winner of ratio test” being the row with smallest ratio (pivot row). The smallest ratio is
the largest entering variable that will keep the current basic variable non-negative.
ERO 1
ERO 2
To create a zero coefficient for x 2 in row 0’, by replacing row 0’ with 3(row 1’’) + row 0’ i.e eliminate x 2
ERO 3
To create a zero coefficient for x 2 in row 2’, since x 2 does not appear in row 2’, then we don’t need to
perform ERO.
To create a zero coefficient for x 2 in row 3’, by replacing row 3’ with -5(row 1’’) + row 3’ i.e eliminate x 2
Basic Variables
i.e from Row 0’’ x 1=S1=S2 Z =1066.66
Row 1’’ x 1=S1=S2 x 2=42.22
Row 2’’ x 1=S2=0 x 3=156.67
Row 3’’ x 1=S1=S2 0 S 3=218.9
Therefore ,
Z=1066.667 , x1 =0.0000 , x 2=42.22 , x 3=156.67