You are on page 1of 9

Min z=4x1+x2 Big M (surplus/artificial )

3x1+x2=3
4x1+3x2>=6
x1+2x2<=4

z=4x1+x2+MR1+MR2
3x1+x2 +R1 =3 welformed
4x1+3x2-x3 +R2 =6
x1+2x2 +x4 =4

iteration0
basic x1 x2 x3 R1 R2
z -4 -1 0 -100 -100
x100 R1 3 1 0 1 0
x100 R2 4 3 -1 0 1
x4 1 2 0 0 0

ent
iteration0 (corrected) basic x1 x2 x3 R1 R2
z 696 399 -100 0 0
R1 3 1 0 1 0
R2 4 3 -1 0 1
x4 1 2 0 0 0

basic r1 r2 x4
non basic x1, x2, x3=0
z=900/r1=3/r2=6/x4=4
ent
iteration 1 basic x1 x2 x3 R1 R2
row (20) -696 row(31) z 0 167 -100 -232 0
row(22)-x4 x1 1 1/3 0 1/3 0
lv R2 0 5/3 -1 -4/3 1
row(23)-row(31) x4 0 5/3 0 -1/3 0

for each other row


new vales=old values-(coff)xnew pivot row

x2=x3=r1=0
solution z=204/ x1=1 /r2=2/x4=3
iteration 2 basic x1 x2 x3 R1 R2
=row(30)-167xrow(44) z 0 0 0.2 -98.4 -100.2
=row(31)-(1/3)xrow(44) x1 1 0 1/5 1/15 -1/5
=row(32)/[5/3] x2 0 1 -3/5 -4/5 3/5
=row(33)-(5/3)-row(44) x4 0 0 1 1 -1

iteration3 basic x1 x2 x3 R1 R2
=row(42)-(0.2)xrow(53) z 0 0 0 -98.6 -100
x1 1 0 0 -2/15 0
=row(44)-(-3/5)xrow(53) x2 0 1 0 -1/5 0
x3 0 0 1 1 -1

r1=r2=x4=0
x1=2/5
x2=9/5 z=3.4
x3=1
welformed

x4 solution
0 0
0 3
0 6
1 4

x4 solution
0 900
0 3
0 6
1 4
solution x1
900 696
3 3 1
6 4 1.5
4 1 4
x4 solution
0 204
0 1 3
0 2 6/5
1 3 9/5

we keep on iterating
max: till we have a -ive coff in z row
min: till we have a +ive coff in the z row
x4 solution sol/x3
0 3.6
0 3/5 3
0 6/5 =-ive
1 1 1

x4 solution
-0.2 3.4
-1/5 2/5
3/5 9/5
1 1
2 Phase Method

Phase 1: Artificial Variables are removed and I BFS is found


Phase2: The original Problem is solved

Min z=4x1+x2
3x1+x2=3
4x1+3x2>=6
x1+2x2<=4

3x1+x2 +R1 =3
4x1+3x2-x3 +R2 =6
x1+2x2 +x4 =4

Phase 1:

Minimize: r=R1+R2 => r-R1-R2=0


subjected to:
3x1+x2 +R1 =3
4x1+3x2-x3 +R2 =6
x1+2x2 +x4 =4

//creating the tables

Basic r x1 x2 x3 R1 R2 x4
r 1 0 0 0 -1 -1 0
R1 0 3 1 0 1 0 0
R2 0 4 3 -1 0 1 0
x4 0 1 2 0 0 0 1

//to start solving we must check that the coff of basic variables should be 0 in obj fun()
// r=r+R1
Basic r x1 x2 x3 R1 R2 x4
r 1 7 4 -1 0 0 0
R1 0 3 1 0 1 0 0
R2 0 4 3 -1 0 1 0
x4 0 1 2 0 0 0 1

//welformed table to start with

Basic r x1 x2 x3 R1 R2 x4
row(37)-7x(row(46)) r 1 0 5/3 -1 -7/3 0 0
x1 0 1 1/3 0 1/3 0 0
R2 0 0 5/3 -1 -4/3 1 0
x4 0 0 5/3 0 -1/3 0 1

Basic r x1 x2 x3 R1 R2 x4
r 1 0 0 0 -1 -1 0
x1 0 1 0 1/5 3/5 -1/5 0
x2 0 0 1 -3/5 -4/5 3/5 0
x4 0 0 0 1 1 -1 1

Phase 2
Min z=4x1+x2
3x1+x2=3
4x1+3x2>=6
x1+2x2<=4

Min z=4x1+x2
Sub to
x1+(1/5)x3=3/5
x2-(3/5)x3=6/5
x3+x4=1

Basic r x1 x2 x3 x4 Solution
r 1 -4 -1 0 0 0
x1 0 1 0 1/5 0 3/5
x2 0 0 1 -3/5 0 6/5
x4 0 0 0 1 1 1

Basic r x1 x2 x3 x4 Solution
r 1 0 0 1/5 0 18/5
x1 0 1 0 1/5 0 3/5
x2 0 0 1 -3/5 0 6/5
x4 0 0 0 1 1 1

Basic r x1 x2 x3 x4 Solution
r 1 0 0 0 -1/5 17/5
x1 0 1 0 0 -1/5 2/5
x2 0 0 1 0 3/5 9/5
x3 0 0 0 1 1 1
solution
0
3
6
4

solution
9
3 1
6 1.x
4 4

solution
2
1 3
2 6/5
3 9/5

solution
0 //sum of artificial variables is 0
3/5 // if it is +-ive then the LPP is infeasible
6/5
1

You might also like