انعام سمير صادق1

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

Optimization

Q1//
MAX Z = 3x1 + 5x2 + 4x3
subject to
2x1 + 3x2 <= 8
2x2 + 5x3 <= 10
3x1 + 2x2 + 4x3 <= 15
and x1,x2,x3 >= 0
Solution:
Problem is
Max Z = 3 x1 + 5 x2 + 4 x3
subject to
2 x1 + 3 x2 ≤8
2 x2 + 5 x3 ≤ 10
3 x1 + 2 x2 + 4 x3 ≤ 15
and x1,x2,x3≥0;

The problem is converted to canonical form by adding slack, surplus and artificial
variables as appropiate

1. As the constraint-1 is of type '≤' we should add slack variable S1

2. As the constraint-2 is of type '≤' we should add slack variable S2

3. As the constraint-3 is of type '≤' we should add slack variable S3

After introducing slack variables


Max Z = 3 x1 + 5 x2 + 4 x3 + 0 S1 + 0 S2 + 0 S3
subject to
2 x1 + 3 x2 + S1 =8
2 x2 + 5 x3 + S2 = 10
3 x1 + 2 x2 + 4 x3 + S3 = 15
and x1,x2,x3,S1,S2,S3≥0

Iteration-1 Cj 3 5 4 0 0 0

MinRatio
B CB XB x1 x2 x3 S1 S2 S3
XB/x2

S1 0 8 2 (3) 0 1 0 0 8/3=2.6667→

S2 0 10 0 2 5 0 1 0 10/2=5

S3 0 15 3 2 4 0 0 1 15/2=7.5

Z=0 Zj 0 0 0 0 0 0

Zj-Cj -3 -5↑ -4 0 0 0
Negative minimum Zj-Cj is -5 and its column index is 2. So, the entering variable is x2.

Minimum ratio is 2.6667 and its row index is 1. So, the leaving basis variable is S1.

∴ The pivot element is 3.

Entering =x2, Departing =S1, Key Element =3

R1(new)=R1(old)÷3
R1(old) = 8 2 3 0 1 0 0

R1(new)=R1(old)÷3 2.6667 0.6667 1 0 0.3333 0 0

R2(new)=R2(old) - 2R1(new)
R2(old) = 10 0 2 5 0 1 0

R1(new) = 2.6667 0.6667 1 0 0.3333 0 0

2×R1(new) = 5.3333 1.3333 2 0 0.6667 0 0

R2(new)=R2(old) - 2R1(new) 4.6667 -1.3333 0 5 -0.6667 1 0

R3(new)=R3(old) - 2R1(new)
R3(old) = 15 3 2 4 0 0 1

R1(new) = 2.6667 0.6667 1 0 0.3333 0 0

2×R1(new) = 5.3333 1.3333 2 0 0.6667 0 0

R3(new)=R3(old) - 2R1(new) 9.6667 1.6667 0 4 -0.6667 0 1

Iteration-2 Cj 3 5 4 0 0 0

MinRatio
B CB XB x1 x2 x3 S1 S2 S3
XB/x3

x2 5 2.6667 0.6667 1 0 0.3333 0 0 ---

S2 0 4.6667 -1.3333 0 (5) -0.6667 1 0 4.666/75=0.9333→

S3 0 9.6667 1.6667 0 4 -0.6667 0 1 9.666/74=2.4167

Z=13.3333 Zj 3.3333 5 0 1.6667 0 0

Zj-Cj 0.3333 0 -4↑ 1.6667 0 0


Negative minimum Zj-Cj is -4 and its column index is 3. So, the entering variable is x3.

Minimum ratio is 0.9333 and its row index is 2. So, the leaving basis variable is S2.

∴ The pivot element is 5.

Entering =x3, Departing =S2, Key Element =5

R2(new)=R2(old)÷5
R2(old) = 4.6667 -1.3333 0 5 -0.6667 1 0

R2(new)=R2(old)÷5 0.9333 -0.2667 0 1 -0.1333 0.2 0

R1(new)=R1(old)
R1(old) = 2.6667 0.6667 1 0 0.3333 0 0

R1(new)=R1(old) 2.6667 0.6667 1 0 0.3333 0 0

R3(new)=R3(old) - 4R2(new)
R3(old) = 9.6667 1.6667 0 4 -0.6667 0 1

R2(new) = 0.9333 -0.2667 0 1 -0.1333 0.2 0

4×R2(new) = 3.7333 -1.0667 0 4 -0.5333 0.8 0

R3(new)=R3(old) - 4R2(new) 5.9333 2.7333 0 0 -0.1333 -0.8 1

Iteration-3 Cj 3 5 4 0 0 0

MinRatio
B CB XB x1 x2 x3 S1 S2 S3
XB/x1

x2 5 2.6667 0.6667 1 0 0.3333 0 0 2.66670.6667=4

x3 4 0.9333 -0.2667 0 1 -0.1333 0.2 0 ---

S3 0 5.9333 (2.7333) 0 0 -0.1333 -0.8 1 5.93332.7333=2.1707→

Z=17.0667 Zj 2.2667 5 4 1.1333 0.8 0

Zj-Cj -0.7333↑ 0 0 1.1333 0.8 0


Negative minimum Zj-Cj is -0.7333 and its column index is 1. So, the entering variable
is x1.

Minimum ratio is 2.1707 and its row index is 3. So, the leaving basis variable is S3.

∴ The pivot element is 2.7333.

Entering =x1, Departing =S3, Key Element =2.7333

R3(new)=R3(old)÷2.7333
R3(old) = 5.9333 2.7333 0 0 -0.1333 -0.8 1

R3(new)=R3(old)÷2.7333 2.1707 1 0 0 -0.0488 -0.2927 0.3659

R1(new)=R1(old) - 0.6667R3(new)
R1(old) = 2.6667 0.6667 1 0 0.3333 0 0

R3(new) = 2.1707 1 0 0 -0.0488 -0.2927 0.3659

0.6667×R3(new) = 1.4472 0.6667 0 0 -0.0325 -0.1951 0.2439

R1(new)=R1(old) - 0.6667R3(new) 1.2195 0 1 0 0.3659 0.1951 -0.2439

R2(new)=R2(old) + 0.2667R3(new)
R2(old) = 0.9333 -0.2667 0 1 -0.1333 0.2 0

R3(new) = 2.1707 1 0 0 -0.0488 -0.2927 0.3659

0.2667×R3(new) = 0.5789 0.2667 0 0 -0.013 -0.078 0.0976

R2(new)=R2(old) + 0.2667R3(new) 1.5122 0 0 1 -0.1463 0.122 0.0976

Iteration-4 Cj 3 5 4 0 0 0

B CB XB x1 x2 x3 S1 S2 S3 MinRatio

x2 5 1.2195 0 1 0 0.3659 0.1951 -0.2439

x3 4 1.5122 0 0 1 -0.1463 0.122 0.0976

x1 3 2.1707 1 0 0 -0.0488 -0.2927 0.3659

Z=18.6585 Zj 3 5 4 1.0976 0.5854 0.2683

Zj-Cj 0 0 0 1.0976 0.5854 0.2683


Since all Zj-Cj≥0

Hence, optimal solution is arrived with value of variables as :


x1=2.1707,x2=1.2195,x3=1.5122

Max Z=18.6585

Q2//
MAX Z = 4x1 + 3x2
subject to
2x1 + x2 <= 1000
x1 + x2 <= 800
x1 <= 400
x2 <= 700
and x1,x2 >= 0

Solution:
Problem is
Max Z = 4 x1 + 3 x2
subject to
2 x1 + x2 ≤ 1000
x1 + x2 ≤ 800
x1 ≤ 400
x2 ≤ 700
and x1,x2≥0;

The problem is converted to canonical form by adding slack, surplus and artificial
variables as appropiate

1. As the constraint-1 is of type '≤' we should add slack variable S1

2. As the constraint-2 is of type '≤' we should add slack variable S2

3. As the constraint-3 is of type '≤' we should add slack variable S3

4. As the constraint-4 is of type '≤' we should add slack variable S4

After introducing slack variables


Max Z = 4 x1 + 3 x2 + 0 S1 + 0 S2 + 0 S3 + 0 S4
subject to
2 x1 + x2 + S1 = 1000
x1 + x2 + S2 = 800
x1 + S3 = 400
x2 + S4 = 700
and x1,x2,S1,S2,S3,S4≥0
Iteration-1 Cj 4 3 0 0 0 0

MinRatio
B CB XB x1 x2 S1 S2 S3 S4
XB/x1

S1 0 1000 2 1 1 0 0 0 1000/2=500

S2 0 800 1 1 0 1 0 0 800/1=800

S3 0 400 (1) 0 0 0 1 0 400/1=400→

S4 0 700 0 1 0 0 0 1 ---

Z=0 Zj 0 0 0 0 0 0

Zj-Cj -4↑ -3 0 0 0 0

Negative minimum Zj-Cj is -4 and its column index is 1. So, the entering variable is x1.

Minimum ratio is 400 and its row index is 3. So, the leaving basis variable is S3.

∴ The pivot element is 1.

Entering =x1, Departing =S3, Key Element =1

R3(new)=R3(old)
R3(old) = 400 1 0 0 0 1 0

R3(new)=R3(old) 400 1 0 0 0 1 0

R1(new)=R1(old) - 2R3(new)
R1(old) = 1000 2 1 1 0 0 0

R3(new) = 400 1 0 0 0 1 0

2×R3(new) = 800 2 0 0 0 2 0

R1(new)=R1(old) - 2R3(new) 200 0 1 1 0 -2 0

R2(new)=R2(old) - R3(new)
R2(old) = 800 1 1 0 1 0 0

R3(new) = 400 1 0 0 0 1 0

R2(new)=R2(old) - R3(new) 400 0 1 0 1 -1 0


R4(new)=R4(old)
R4(old) = 700 0 1 0 0 0 1

R4(new)=R4(old) 700 0 1 0 0 0 1

Iteration-2 Cj 4 3 0 0 0 0

MinRatio
B CB XB x1 x2 S1 S2 S3 S4
XB/x2

S1 0 200 0 (1) 1 0 -2 0 200/1=200→

S2 0 400 0 1 0 1 -1 0 400/1=400

x1 4 400 1 0 0 0 1 0 ---

S4 0 700 0 1 0 0 0 1 700/1=700

Z=1600 Zj 4 0 0 0 4 0

Zj-Cj 0 -3↑ 0 0 4 0

Negative minimum Zj-Cj is -3 and its column index is 2. So, the entering variable is x2.

Minimum ratio is 200 and its row index is 1. So, the leaving basis variable is S1.

∴ The pivot element is 1.

Entering =x2, Departing =S1, Key Element =1

R1(new)=R1(old)
R1(old) = 200 0 1 1 0 -2 0

R1(new)=R1(old) 200 0 1 1 0 -2 0

R2(new)=R2(old) - R1(new)
R2(old) = 400 0 1 0 1 -1 0

R1(new) = 200 0 1 1 0 -2 0

R2(new)=R2(old) - R1(new) 200 0 0 -1 1 1 0


R3(new)=R3(old)
R3(old) = 400 1 0 0 0 1 0

R3(new)=R3(old) 400 1 0 0 0 1 0

R4(new)=R4(old) - R1(new)
R4(old) = 700 0 1 0 0 0 1

R1(new) = 200 0 1 1 0 -2 0

R4(new)=R4(old) - R1(new) 500 0 0 -1 0 2 1

Iteration-3 Cj 4 3 0 0 0 0

MinRatio
B CB XB x1 x2 S1 S2 S3 S4
XB/S3

x2 3 200 0 1 1 0 -2 0 ---

S2 0 200 0 0 -1 1 (1) 0 200/1=200→

x1 4 400 1 0 0 0 1 0 400/1=400

S4 0 500 0 0 -1 0 2 1 500/2=250

Z=2200 Zj 4 3 3 0 -2 0

Zj-Cj 0 0 3 0 -2↑ 0

Negative minimum Zj-Cj is -2 and its column index is 5. So, the entering variable is S3.

Minimum ratio is 200 and its row index is 2. So, the leaving basis variable is S2.

∴ The pivot element is 1.

Entering =S3, Departing =S2, Key Element =1

R2(new)=R2(old)
R2(old) = 200 0 0 -1 1 1 0

R2(new)=R2(old) 200 0 0 -1 1 1 0
R1(new)=R1(old) + 2R2(new)
R1(old) = 200 0 1 1 0 -2 0

R2(new) = 200 0 0 -1 1 1 0

2×R2(new) = 400 0 0 -2 2 2 0

R1(new)=R1(old) + 2R2(new) 600 0 1 -1 2 0 0

R3(new)=R3(old) - R2(new)
R3(old) = 400 1 0 0 0 1 0

R2(new) = 200 0 0 -1 1 1 0

R3(new)=R3(old) - R2(new) 200 1 0 1 -1 0 0

R4(new)=R4(old) - 2R2(new)
R4(old) = 500 0 0 -1 0 2 1

R2(new) = 200 0 0 -1 1 1 0

2×R2(new) = 400 0 0 -2 2 2 0

R4(new)=R4(old) - 2R2(new) 100 0 0 1 -2 0 1

Iteration-4 Cj 4 3 0 0 0 0

B CB XB x1 x2 S1 S2 S3 S4 MinRatio

x2 3 600 0 1 -1 2 0 0

S3 0 200 0 0 -1 1 1 0

x1 4 200 1 0 1 -1 0 0

S4 0 100 0 0 1 -2 0 1

Z=2600 Zj 4 3 1 2 0 0

Zj-Cj 0 0 1 2 0 0

Since all Zj-Cj≥0


Hence, optimal solution is arrived with value of variables as :
x1=200,x2=600

Max Z=2600
Q3//
MIN Z = 5x1 + 3x2
subject to
2x1 + 4x2 <= 12
2x1 + 2x2 = 10
5x1 + 2x2 >= 10
and x1,x2 >= 0
Solution:
Problem is
Min Z = 5 x1 + 3 x2
subject to
2 x1 + 4 x2 ≤ 12
2 x1 + 2 x2 = 10
5 x1 + 2 x2 ≥ 10
and x1,x2≥0;

The problem is converted to canonical form by adding slack, surplus and artificial
variables as appropiate

1. As the constraint-1 is of type '≤' we should add slack variable S1

2. As the constraint-2 is of type '=' we should add artificial variable A1

3. As the constraint-3 is of type '≥' we should subtract surplus variable S2 and add
artificial variable A2

After introducing slack,surplus,artificial variables


Min Z = 5 x1 + 3 x2 + 0 S1 + 0 S2 + M A1 + M A2
subject to
2 x1 + 4 x2 + S1 = 12
2 x1 + 2 x2 + A1 = 10
5 x1 + 2 x2 - S2 + A2 = 10
and x1,x2,S1,S2,A1,A2≥0

Iteration-1 Cj 5 3 0 0 M M
MinRatio
B CB XB x1 x2 S1 S2 A1 A2
XBx1

S1 0 12 2 4 1 0 0 0 122=6

A1 M 10 2 2 0 0 1 0 102=5

A2 M 10 (5) 2 0 -1 0 1 105=2→

Z=20M Zj 7M 4M 0 -M M M

Zj-Cj 7M-5↑ 4M-3 0 -M 0 0


Positive maximum Zj-Cj is 7M-5 and its column index is 1. So, the entering variable is x1.

Minimum ratio is 2 and its row index is 3. So, the leaving basis variable is A2.

∴ The pivot element is 5.

Entering =x1, Departing =A2, Key Element =5

R3(new)=R3(old)÷5
R3(old) = 10 5 2 0 -1 0

R3(new)=R3(old)÷5 2 1 0.4 0 -0.2 0

R1(new)=R1(old) - 2R3(new)
R1(old) = 12 2 4 1 0 0

R3(new) = 2 1 0.4 0 -0.2 0

2×R3(new) = 4 2 0.8 0 -0.4 0

R1(new)=R1(old) - 2R3(new) 8 0 3.2 1 0.4 0

R2(new)=R2(old) - 2R3(new)
R2(old) = 10 2 2 0 0 1

R3(new) = 2 1 0.4 0 -0.2 0

2×R3(new) = 4 2 0.8 0 -0.4 0

R2(new)=R2(old) - 2R3(new) 6 0 1.2 0 0.4 1

Iteration-2 Cj 5 3 0 0 M

MinRatio
B CB XB x1 x2 S1 S2 A1
XBx2

S1 0 8 0 (3.2) 1 0.4 0 83.2=2.5→

A1 M 6 0 1.2 0 0.4 1 61.2=5

x1 5 2 1 0.4 0 -0.2 0 20.4=5

Z=6M+10 Zj 5 1.2M+2 0 0.4M-1 M

Zj-Cj 0 1.2M-1↑ 0 0.4M-1 0


Positive maximum Zj-Cj is 1.2M-1 and its column index is 2. So, the entering variable
is x2.

Minimum ratio is 2.5 and its row index is 1. So, the leaving basis variable is S1.

∴ The pivot element is 3.2.

Entering =x2, Departing =S1, Key Element =3.2

R1(new)=R1(old)÷3.2
R1(old) = 8 0 3.2 1 0.4 0

R1(new)=R1(old)÷3.2 2.5 0 1 0.3125 0.125 0

R2(new)=R2(old) - 1.2R1(new)
R2(old) = 6 0 1.2 0 0.4 1

R1(new) = 2.5 0 1 0.3125 0.125 0

1.2×R1(new) = 3 0 1.2 0.375 0.15 0

R2(new)=R2(old) - 1.2R1(new) 3 0 0 -0.375 0.25 1

R3(new)=R3(old) - 0.4R1(new)
R3(old) = 2 1 0.4 0 -0.2 0

R1(new) = 2.5 0 1 0.3125 0.125 0

0.4×R1(new) = 1 0 0.4 0.125 0.05 0

R3(new)=R3(old) - 0.4R1(new) 1 1 0 -0.125 -0.25 0

Iteration-3 Cj 5 3 0 0 M

MinRatio
B CB XB x1 x2 S1 S2 A1
XBS2

x2 3 2.5 0 1 0.3125 0.125 0 2.50.125=20

A1 M 3 0 0 -0.375 (0.25) 1 30.25=12→

x1 5 1 1 0 -0.125 -0.25 0 ---

Z=3M+12.5 Zj 5 3 -0.375M+0.3125 0.25M-0.875 M

Zj-Cj 0 0 -0.375M+0.3125 0.25M-0.875↑ 0


Positive maximum Zj-Cj is 0.25M-0.875 and its column index is 4. So, the entering
variable is S2.

Minimum ratio is 12 and its row index is 2. So, the leaving basis variable is A1.

∴ The pivot element is 0.25.

Entering =S2, Departing =A1, Key Element =0.25

R2(new)=R2(old)÷0.25
R2(old) = 3 0 0 -0.375 0.25

R2(new)=R2(old)÷0.25 12 0 0 -1.5 1

R1(new)=R1(old) - 0.125R2(new)
R1(old) = 2.5 0 1 0.3125 0.125

R2(new) = 12 0 0 -1.5 1

0.125×R2(new) = 1.5 0 0 -0.1875 0.125

R1(new)=R1(old) - 0.125R2(new) 1 0 1 0.5 0

R3(new)=R3(old) + 0.25R2(new)
R3(old) = 1 1 0 -0.125 -0.25

R2(new) = 12 0 0 -1.5 1

0.25×R2(new) = 3 0 0 -0.375 0.25

R3(new)=R3(old) + 0.25R2(new) 4 1 0 -0.5 0

Iteration-4 Cj 5 3 0 0

B CB XB x1 x2 S1 S2 MinRatio

x2 3 1 0 1 0.5 0

S2 0 12 0 0 -1.5 1

x1 5 4 1 0 -0.5 0

Z=23 Zj 5 3 -1 0

Zj-Cj 0 0 -1 0
Since all Zj-Cj≤0

Hence, optimal solution is arrived with value of variables as :


x1=4,x2=1

Min Z=23

Q4//
MAX Z = x1 + 2x2 + 3x3 - x4
subject to
x1 + 2x2 + 3x3 = 15
2x1 + x2 + 5x3 = 20
x1 + 2x2 + x3 + x4 = 10
and x1,x2,x3,x4 >= 0

Solution:
Problem is
Max Z = x1 + 2 x2 + 3 x3 - x4
subject to
x1 + 2 x2 + 3 x3 = 15
2 x1 + x2 + 5 x3 = 20
x1 + 2 x2 + x3 + x4 = 10
and x1,x2,x3,x4≥0;

The problem is converted to canonical form by adding slack, surplus and artificial
variables as appropiate

1. As the constraint-1 is of type '=' we should add artificial variable A1

2. As the constraint-2 is of type '=' we should add artificial variable A2

3. As the constraint-3 is of type '=' we should add artificial variable A3

After introducing artificial variables


Max Z = x1 + 2 x2 + 3 x3 - x4 - M A1 - M A2 - M A3
subject to
x1 + 2 x2 + 3 x3 + A1 = 15
2 x1 + x2 + 5 x3 + A2 = 20
x1 + 2 x2 + x3 + x4 + A3 = 10
and x1,x2,x3,x4,A1,A2,A3≥0
Iteration-1 Cj 1 2 3 -1 -M -M -M

MinRatio
B CB XB x1 x2 x3 x4 A1 A2 A3
XBx3

A1 -M 15 1 2 3 0 1 0 0 15/3=5

A2 -M 20 2 1 (5) 0 0 1 0 20/5=4→

A3 -M 10 1 2 1 1 0 0 1 10/1=10

Z=-45M Zj -4M -5M -9M -M -M -M -M

Zj-Cj -4M-1 -5M-2 -9M-3↑ -M+1 0 0 0

Negative minimum Zj-Cj is -9M-3 and its column index is 3. So, the entering variable is x3.

Minimum ratio is 4 and its row index is 2. So, the leaving basis variable is A2.

∴ The pivot element is 5.

Entering =x3, Departing =A2, Key Element =5

R2(new)=R2(old)÷5
R2(old) = 20 2 1 5 0 0 0

R2(new)=R2(old)÷5 4 0.4 0.2 1 0 0 0

R1(new)=R1(old) - 3R2(new)
R1(old) = 15 1 2 3 0 1 0

R2(new) = 4 0.4 0.2 1 0 0 0

3×R2(new) = 12 1.2 0.6 3 0 0 0

R1(new)=R1(old) - 3R2(new) 3 -0.2 1.4 0 0 1 0

R3(new)=R3(old) - R2(new)
R3(old) = 10 1 2 1 1 0 1

R2(new) = 4 0.4 0.2 1 0 0 0

R3(new)=R3(old) - R2(new) 6 0.6 1.8 0 1 0 1


Iteration-2 Cj 1 2 3 -1 -M -M

MinRatio
B CB XB x1 x2 x3 x4 A1 A3
XBx2

A1 -M 3 -0.2 (1.4) 0 0 1 0 3/1.4=2.1429→

x3 3 4 0.4 0.2 1 0 0 0 4/0.2=20

A3 -M 6 0.6 1.8 0 1 0 1 6/1.8=3.3333

Z=-9M+12 Zj -0.4M+1.2 -3.2M+0.6 3 -M -M -M

Zj-Cj -0.4M+0.2 -3.2M-1.4↑ 0 -M+1 0 0

Negative minimum Zj-Cj is -3.2M-1.4 and its column index is 2. So, the entering variable
is x2.

Minimum ratio is 2.1429 and its row index is 1. So, the leaving basis variable is A1.

∴ The pivot element is 1.4.

Entering =x2, Departing =A1, Key Element =1.4

R1(new)=R1(old)÷1.4
R1(old) = 3 -0.2 1.4 0 0 0

R1(new)=R1(old)÷1.4 2.1429 -0.1429 1 0 0 0

R2(new)=R2(old) - 0.2R1(new)
R2(old) = 4 0.4 0.2 1 0 0

R1(new) = 2.1429 -0.1429 1 0 0 0

0.2×R1(new) = 0.4286 -0.0286 0.2 0 0 0

R2(new)=R2(old) - 0.2R1(new) 3.5714 0.4286 0 1 0 0

R3(new)=R3(old) - 1.8R1(new)
R3(old) = 6 0.6 1.8 0 1 1

R1(new) = 2.1429 -0.1429 1 0 0 0

1.8×R1(new) = 3.8571 -0.2571 1.8 0 0 0

R3(new)=R3(old) - 1.8R1(new) 2.1429 0.8571 0 0 1 1


Iteration-3 Cj 1 2 3 -1 -M

MinRatio
B CB XB x1 x2 x3 x4 A3
XBx4

x2 2 2.1429 -0.1429 1 0 0 0 ---

x3 3 3.5714 0.4286 0 1 0 0 ---

A3 -M 2.1429 0.8571 0 0 (1) 1 2.1429/1=2.1429→

Z=-2.1429M+15 Zj -0.8571M+1 2 3 -M -M

Zj-Cj -0.8571M+0 0 0 -M+1↑ 0

Negative minimum Zj-Cj is -M+1 and its column index is 4. So, the entering variable is x4.

Minimum ratio is 2.1429 and its row index is 3. So, the leaving basis variable is A3.

∴ The pivot element is 1.

Entering =x4, Departing =A3, Key Element =1

R3(new)=R3(old)
R3(old) = 2.1429 0.8571 0 0 1

R3(new)=R3(old) 2.1429 0.8571 0 0 1

R1(new)=R1(old)
R1(old) = 2.1429 -0.1429 1 0 0

R1(new)=R1(old) 2.1429 -0.1429 1 0 0

R2(new)=R2(old)
R2(old) = 3.5714 0.4286 0 1 0

R2(new)=R2(old) 3.5714 0.4286 0 1 0


Iteration-4 Cj 1 2 3 -1

MinRatio
B CB XB x1 x2 x3 x4
XB/x1

x2 2 2.1429 -0.1429 1 0 0 ---

x3 3 3.5714 0.4286 0 1 0 3.5714/0.4286=8.3333

x4 -1 2.1429 (0.8571) 0 0 1 2.1429/0.8571=2.5→

Z=12.8571 Zj 0.1429 2 3 -1

Zj-Cj -0.8571↑ 0 0 0

Negative minimum Zj-Cj is -0.8571 and its column index is 1. So, the entering variable
is x1.

Minimum ratio is 2.5 and its row index is 3. So, the leaving basis variable is x4.

∴ The pivot element is 0.8571.

Entering =x1, Departing =x4, Key Element =0.8571

R3(new)=R3(old)÷0.8571
R3(old) = 2.1429 0.8571 0 0 1

R3(new)=R3(old)÷0.8571 2.5 1 0 0 1.1667

R1(new)=R1(old) + 0.1429R3(new)
R1(old) = 2.1429 -0.1429 1 0 0

R3(new) = 2.5 1 0 0 1.1667

0.1429×R3(new) = 0.3571 0.1429 0 0 0.1667

R1(new)=R1(old) + 0.1429R3(new) 2.5 0 1 0 0.1667

R2(new)=R2(old) - 0.4286R3(new)
R2(old) = 3.5714 0.4286 0 1 0

R3(new) = 2.5 1 0 0 1.1667

0.4286×R3(new) = 1.0714 0.4286 0 0 0.5

R2(new)=R2(old) - 0.4286R3(new) 2.5 0 0 1 -0.5


Iteration-5 Cj 1 2 3 -1

B CB XB x1 x2 x3 x4 MinRatio

x2 2 2.5 0 1 0 0.1667

x3 3 2.5 0 0 1 -0.5

x1 1 2.5 1 0 0 1.1667

Z=15 Zj 1 2 3 0

Zj-Cj 0 0 0 1

Since all Zj-Cj≥0

Hence, optimal solution is arrived with value of variables as :


x1=2.5,x2=2.5,x3=2.5,x4=0

Max Z=15

Q5//
MAX Z = 3x1 + 9x2
subject to
x1 + 4x2 <= 8
x1 + 2x2 <= 4
and x1,x2 >= 0

Solution:
Problem is
Max Z = 3 x1 + 9 x2
subject to
x1 + 4 x2 ≤ 8
x1 + 2 x2 ≤ 4
and x1,x2≥0;

The problem is converted to canonical form by adding slack, surplus and artificial
variables as appropiate

1. As the constraint-1 is of type '≤' we should add slack variable S1

2. As the constraint-2 is of type '≤' we should add slack variable S2


After introducing slack variables
Max Z = 3 x1 + 9 x2 + 0 S1 + 0 S2
subject to
x1 + 4 x2 + S1 =8
x1 + 2 x2 + S2 = 4
and x1,x2,S1,S2≥0

Iteration-1 Cj 3 9 0 0

MinRatio
B CB XB x1 x2 S1 S2
XBx2

S1 0 8 1 4 1 0 8/4=2

S2 0 4 1 (2) 0 1 4/2=2→

Z=0 Zj 0 0 0 0

Zj-Cj -3 -9↑ 0 0

Negative minimum Zj-Cj is -9 and its column index is 2. So, the entering variable is x2.

Minimum ratio is 2 and its row index is 2. So, the leaving basis variable is S2.

∴ The pivot element is 2.

Entering =x2, Departing =S2, Key Element =2

R2(new)=R2(old)÷2
R2(old) = 4 1 2 0 1

R2(new)=R2(old)÷2 2 0.5 1 0 0.5

R1(new)=R1(old) - 4R2(new)
R1(old) = 8 1 4 1 0

R2(new) = 2 0.5 1 0 0.5

4×R2(new) = 8 2 4 0 2

R1(new)=R1(old) - 4R2(new) 0 -1 0 1 -2
Iteration-2 Cj 3 9 0 0

B CB XB x1 x2 S1 S2 MinRatio

S1 0 0 -1 0 1 -2

x2 9 2 0.5 1 0 0.5

Z=18 Zj 4.5 9 0 4.5

Zj-Cj 1.5 0 0 4.5

Since all Zj-Cj≥0

Hence, optimal solution is arrived with value of variables as :


x1=0,x2=2

Max Z=18

Q6//
MAX Z = 3x1 + 2x2 + x3
subject to
2x1 + 5x2 + x3 = 12
3x1 + 4x2 = 11
and x2,x3 >= 0 and x1 unrestricted in sign

Solution:
Problem is
Max Z = 3 x1 + 2 x2 + x3
subject to
2 x1 + 5 x2 + x3 = 12
3 x1 + 4 x2 = 11
and x2,x3≥0;x1 unrestricted in sign

Since x1 is unrestricted in sign, introduce the non-negative variables x1′,x1′′

so that x1=x1′-x1′′;x1′,x1′′≥0.

The standard form of the LP problem becomes


Problem is
Max Z = 3 x1′ - 3 x1′′ + 2 x2 + x3
subject to
2 x1′ - 2 x1′′ + 5 x2 + x3 = 12
3 x1′ - 3 x1′′ + 4 x2 = 11
and x1′,x1′′,x2,x3≥0;

The problem is converted to canonical form by adding slack, surplus and artificial
variables as appropiate

1. As the constraint-1 is of type '=' we should add artificial variable A1

2. As the constraint-2 is of type '=' we should add artificial variable A2

After introducing artificial variables


Max Z = 3 x1′ - 3 x1′′ + 2 x2 + x3 - M A1 - M A2
subject to
2 x1′ - 2 x1′′ + 5 x2 + x3 + A1 = 12
3 x1′ - 3 x1′′ + 4 x2 + A2 = 11
and x1′,x1′′,x2,x3,A1,A2≥0

Iteration-1 Cj 3 -3 2 1 -M -M

MinRatio
B CB XB x1′ x1′′ x2 x3 A1 A2
XB/x2

A1 -M 12 2 -2 (5) 1 1 0 12/5=2.4→

A2 -M 11 3 -3 4 0 0 1 11/4=2.75

Z=-23M Zj -5M 5M -9M -M -M -M

Zj-Cj -5M-3 5M+3 -9M-2↑ -M-1 0 0

Negative minimum Zj-Cj is -9M-2 and its column index is 3. So, the entering variable is x2.

Minimum ratio is 2.4 and its row index is 1. So, the leaving basis variable is A1.

∴ The pivot element is 5.

Entering =x2, Departing =A1, Key Element =5

R1(new)=R1(old)÷5
R1(old) = 12 2 -2 5 1 0

R1(new)=R1(old)÷5 2.4 0.4 -0.4 1 0.2 0


R2(new)=R2(old) - 4R1(new)
R2(old) = 11 3 -3 4 0 1

R1(new) = 2.4 0.4 -0.4 1 0.2 0

4×R1(new) = 9.6 1.6 -1.6 4 0.8 0

R2(new)=R2(old) - 4R1(new) 1.4 1.4 -1.4 0 -0.8 1

Iteration-2 Cj 3 -3 2 1 -M

MinRatio
B CB XB x1′ x1′′ x2 x3 A2
XB/x1′

x2 2 2.4 0.4 -0.4 1 0.2 0 2.4/0.4=6

A2 -M 1.4 (1.4) -1.4 0 -0.8 1 1.4/1.4=1→

Z=-1.4M+4.8 Zj -1.4M+0.8 1.4M-0.8 2 0.8M+0.4 -M

Zj-Cj -1.4M-2.2↑ 1.4M+2.2 0 0.8M-0.6 0

Negative minimum Zj-Cj is -1.4M-2.2 and its column index is 1. So, the entering variable
is x1′.

Minimum ratio is 1 and its row index is 2. So, the leaving basis variable is A2.

∴ The pivot element is 1.4.

Entering =x1′, Departing =A2, Key Element =1.4

R2(new)=R2(old)÷1.4
R2(old) = 1.4 1.4 -1.4 0 -0.8

R2(new)=R2(old)÷1.4 1 1 -1 0 -0.5714

R1(new)=R1(old) - 0.4R2(new)
R1(old) = 2.4 0.4 -0.4 1 0.2

R2(new) = 1 1 -1 0 -0.5714

0.4×R2(new) = 0.4 0.4 -0.4 0 -0.2286

R1(new)=R1(old) - 0.4R2(new) 2 0 0 1 0.4286


Iteration-3 Cj 3 -3 2 1

MinRatio
B CB XB x1′ x1′′ x2 x3
XB/x3

x2 2 2 0 0 1 (0.4286) 2/0.4286=4.6667→

x1′ 3 1 1 -1 0 -0.5714 ---

Z=7 Zj 3 -3 2 -0.8571

Zj-Cj 0 0 0 -1.8571↑

Negative minimum Zj-Cj is -1.8571 and its column index is 4. So, the entering variable
is x3.

Minimum ratio is 4.6667 and its row index is 1. So, the leaving basis variable is x2.

∴ The pivot element is 0.4286.

Entering =x3, Departing =x2, Key Element =0.4286

R1(new)=R1(old)÷0.4286
R1(old) = 2 0 0 1 0.4286

R1(new)=R1(old)÷0.4286 4.6667 0 0 2.3333 1

R2(new)=R2(old) + 0.5714R1(new)
R2(old) = 1 1 -1 0 -0.5714

R1(new) = 4.6667 0 0 2.3333 1

0.5714×R1(new) = 2.6667 0 0 1.3333 0.5714

R2(new)=R2(old) + 0.5714R1(new) 3.6667 1 -1 1.3333 0

Iteration-4 Cj 3 -3 2 1

B CB XB x1′ x1′′ x2 x3 MinRatio

x3 1 4.6667 0 0 2.3333 1

x1′ 3 3.6667 1 -1 1.3333 0

Z=15.6667 Zj 3 -3 6.3333 1

Zj-Cj 0 0 4.3333 0
Since all Zj-Cj≥0

Hence, optimal solution is arrived with value of variables as :


x1′=3.6667,x1′′=0,x2=0,x3=4.6667

Max Z=15.6667

Q7//
MAX Z = 6x1 + 4x2
subject to
2x1 + 3x2 <= 30
3x1 + 2x2 <= 24
x1 + x2 >= 3
and x1,x2 >= 0

Solution:
Problem is
Max Z = 6 x1 + 4 x2
subject to
2 x1 + 3 x2 ≤ 30
3 x1 + 2 x2 ≤ 24
x1 + x2 ≥ 3
and x1,x2≥0;

The problem is converted to canonical form by adding slack, surplus and artificial
variables as appropiate

1. As the constraint-1 is of type '≤' we should add slack variable S1

2. As the constraint-2 is of type '≤' we should add slack variable S2

3. As the constraint-3 is of type '≥' we should subtract surplus variable S3 and add
artificial variable A1

After introducing slack,surplus,artificial variables


Max Z = 6 x1 + 4 x2 + 0 S1 + 0 S2 + 0 S3 - M A1
subject to
2 x1 + 3 x2 + S1 = 30
3 x1 + 2 x2 + S2 = 24
x1 + x2 - S3 + A1 = 3
and x1,x2,S1,S2,S3,A1≥0
Iteration-1 Cj 6 4 0 0 0 -M

MinRatio
B CB XB x1 x2 S1 S2 S3 A1
XB/x1

S1 0 30 2 3 1 0 0 0 30/2=15

S2 0 24 3 2 0 1 0 0 24/3=8

A1 -M 3 (1) 1 0 0 -1 1 3/1=3→

Z=-3M Zj -M -M 0 0 M -M

Zj-Cj -M-6↑ -M-4 0 0 M 0

Negative minimum Zj-Cj is -M-6 and its column index is 1. So, the entering variable is x1.

Minimum ratio is 3 and its row index is 3. So, the leaving basis variable is A1.

∴ The pivot element is 1.

Entering =x1, Departing =A1, Key Element =1

R3(new)=R3(old)
R3(old) = 3 1 1 0 0 -1

R3(new)=R3(old) 3 1 1 0 0 -1

R1(new)=R1(old) - 2R3(new)
R1(old) = 30 2 3 1 0 0

R3(new) = 3 1 1 0 0 -1

2×R3(new) = 6 2 2 0 0 -2

R1(new)=R1(old) - 2R3(new) 24 0 1 1 0 2

R2(new)=R2(old) - 3R3(new)
R2(old) = 24 3 2 0 1 0

R3(new) = 3 1 1 0 0 -1

3×R3(new) = 9 3 3 0 0 -3

R2(new)=R2(old) - 3R3(new) 15 0 -1 0 1 3
Iteration-2 Cj 6 4 0 0 0

MinRatio
B CB XB x1 x2 S1 S2 S3
XB/S3

S1 0 24 0 1 1 0 2 24/2=12

S2 0 15 0 -1 0 1 (3) 15/3=5→

x1 6 3 1 1 0 0 -1 ---

Z=18 Zj 6 6 0 0 -6

Zj-Cj 0 2 0 0 -6↑

Negative minimum Zj-Cj is -6 and its column index is 5. So, the entering variable is S3.

Minimum ratio is 5 and its row index is 2. So, the leaving basis variable is S2.

∴ The pivot element is 3.

Entering =S3, Departing =S2, Key Element =3

R2(new)=R2(old)÷3
R2(old) = 15 0 -1 0 1 3

R2(new)=R2(old)÷3 5 0 -0.3333 0 0.3333 1

R1(new)=R1(old) - 2R2(new)
R1(old) = 24 0 1 1 0 2

R2(new) = 5 0 -0.3333 0 0.3333 1

2×R2(new) = 10 0 -0.6667 0 0.6667 2

R1(new)=R1(old) - 2R2(new) 14 0 1.6667 1 -0.6667 0

R3(new)=R3(old) + R2(new)
R3(old) = 3 1 1 0 0 -1

R2(new) = 5 0 -0.3333 0 0.3333 1

R3(new)=R3(old) + R2(new) 8 1 0.6667 0 0.3333 0


Iteration-3 Cj 6 4 0 0 0

B CB XB x1 x2 S1 S2 S3 MinRatio

S1 0 14 0 1.6667 1 -0.6667 0

S3 0 5 0 -0.3333 0 0.3333 1

x1 6 8 1 0.6667 0 0.3333 0

Z=48 Zj 6 4 0 2 0

Zj-Cj 0 0 0 2 0

Since all Zj-Cj≥0

Hence, optimal solution is arrived with value of variables as :


x1=8,x2=0

Max Z=48

Q8//
MAX Z = 3x1 + 5x2
subject to
x1 - 2x2 <= 6
x1 <= 10
x2 >= 1
and x1,x2 >= 0

Solution:
Problem is
Max Z = 3 x1 + 5 x2
subject to
x1 - 2 x2 ≤ 6
x1 ≤ 10
x2 ≥ 1
and x1,x2≥0;

The problem is converted to canonical form by adding slack, surplus and artificial
variables as appropiate

1. As the constraint-1 is of type '≤' we should add slack variable S1

2. As the constraint-2 is of type '≤' we should add slack variable S2


3. As the constraint-3 is of type '≥' we should subtract surplus variable S3 and add
artificial variable A1

After introducing slack, surplus, artificial variables


Max Z = 3 x1 + 5 x2 + 0 S1 + 0 S2 + 0 S3 - M A1
subject to
x1 - 2 x2 + S1 =6
x1 + S2 = 10
x2 - S3 + A1 = 1
and x1,x2,S1,S2,S3,A1≥0

Iteration-1 Cj 3 5 0 0 0 -M

MinRatio
B CB XB x1 x2 S1 S2 S3 A1
XB/x2

S1 0 6 1 -2 1 0 0 0 ---

S2 0 10 1 0 0 1 0 0 ---

A1 -M 1 0 (1) 0 0 -1 1 1/1=1→

Z=-M Zj 0 -M 0 0 M -M

Zj-Cj -3 -M-5↑ 0 0 M 0

Negative minimum Zj-Cj is -M-5 and its column index is 2. So, the entering variable is x2.

Minimum ratio is 1 and its row index is 3. So, the leaving basis variable is A1.

∴ The pivot element is 1.

Entering =x2, Departing =A1, Key Element =1

R3(new)=R3(old)
R3(old) = 1 0 1 0 0 -1

R3(new)=R3(old) 1 0 1 0 0 -1

R1(new)=R1(old) + 2R3(new)
R1(old) = 6 1 -2 1 0 0

R3(new) = 1 0 1 0 0 -1

2×R3(new) = 2 0 2 0 0 -2

R1(new)=R1(old) + 2R3(new) 8 1 0 1 0 -2
R2(new)=R2(old)
R2(old) = 10 1 0 0 1 0

R2(new)=R2(old) 10 1 0 0 1 0

Iteration-2 Cj 3 5 0 0 0

MinRatio
B CB XB x1 x2 S1 S2 S3
XB/S3

S1 0 8 1 0 1 0 -2 ---

S2 0 10 1 0 0 1 0 ---

x2 5 1 0 1 0 0 -1 ---

Z=5 Zj 0 5 0 0 -5

Zj-Cj -3 0 0 0 -5↑

Variable S3 should enter into the basis, but all the coefficients in the S3 column are
negative or zero. So S3 can not be entered into the basis.

Hence, the solution to the given problem is unbounded

Q9//
MAX Z = 6x1 + 4x2
subject to
x1 + x2 <= 5
x2 >= 8
and x1,x2 >= 0

Solution:
Problem is
Max Z = 6 x1 + 4 x2
subject to
x1 + x2 ≤ 5
x2 ≥ 8
and x1,x2≥0;
The problem is converted to canonical form by adding slack, surplus and artificial
variables as appropiate

1. As the constraint-1 is of type '≤' we should add slack variable S1

2. As the constraint-2 is of type '≥' we should subtract surplus variable S2 and add
artificial variable A1

After introducing slack,surplus,artificial variables


Max Z = 6 x1 + 4 x2 + 0 S1 + 0 S2 - M A1
subject to
x1 + x2 + S1 =5
x2 - S2 + A1 = 8
and x1,x2,S1,S2,A1≥0

Iteration-1 Cj 6 4 0 0 -M

MinRatio
B CB XB x1 x2 S1 S2 A1
XB/x2

S1 0 5 1 (1) 1 0 0 5/1=5→

A1 -M 8 0 1 0 -1 1 8/1=8

Z=-8M Zj 0 -M 0 M -M

Zj-Cj -6 -M-4↑ 0 M 0

Negative minimum Zj-Cj is -M-4 and its column index is 2. So, the entering variable is x2.

Minimum ratio is 5 and its row index is 1. So, the leaving basis variable is S1.

∴ The pivot element is 1.

Entering =x2, Departing =S1, Key Element =1

R1(new)=R1(old)
R1(old) = 5 1 1 1 0 0

R1(new)=R1(old) 5 1 1 1 0 0
R2(new)=R2(old) - R1(new)
R2(old) = 8 0 1 0 -1 1

R1(new) = 5 1 1 1 0 0

R2(new)=R2(old) - R1(new) 3 -1 0 -1 -1 1

Iteration-2 Cj 6 4 0 0 -M

B CB XB x1 x2 S1 S2 A1 MinRatio

x2 4 5 1 1 1 0 0

A1 -M 3 -1 0 -1 -1 1

Z=-3M+20 Zj M+4 4 M+4 M -M

Zj-Cj M-2 0 M+4 M 0

Since all Zj-Cj≥0

Hence, optimal solution is arrived with value of variables as :


x1=0,x2=5

Max Z=20

But this solution is not feasible


because the final solution violates the 2nd constraint x2 ≥ 8.

and the artificial variable A1 appears in the basis with positive value 3

You might also like