3.
Linear Programming Problem with ‘Mixed Constraints’
Question # 6:
Objective Function:
Max z 2 x1 3 x 2 4 x3
Subject to Constant:
3 x1 x 2 4 x3 600
2 x1 4 x 2 2 x3 480
2 x1 3 x 2 3 x3 540
Solution:
Rules for constraints:
For ≥ type constraint
Subtract slack variable and add artificial variable [-s, +A]
For ≤ type constraint
Add only slack variable [+s]
For = type constraint
Add only artificial variable [+A]
3 x1 x 2 4 x3 s1 600
2 x1 4 x 2 2 x3 s 2 A1 480
2 x1 3 x 2 3 x3 A2 540
9
Objective function for maximise case
Max z 2 x1 3 x2 4 x3 0 s1 0 s2 MA1 MA2
M-means here any largest value
*******For the minimise case all the values should be added (+) by default
Simplex Table 1
CBi Cj 2 3 4 0 0 -M -M
BV x1 x2 X3 s1 s2 A1 A2 Solution Ratio
0 s1 3 1 4 1 0 0 0 600
-M A1 2 4 2 0 -1 1 0 480
-M A2 2 3 3 0 0 0 1 540
Zj -4M -7M -5M 0 M -M -M
Cj -Zj 2+4M 3+7M 4+5M 0 -M 0 0
CBi = coefficient (value) of slack variable
Cj = coefficient of objective faction
BV = Basic Variable
Solution = Inequality converted as Equality
Ratio = Solution / Key Column values
Always given the preference to the Artificial Variables over the Slack Variable
After obtaining the table check the values Cj – Zj for the optimal solution purpose.
10
Condition of Feasible Solution (Optimal Solution)
Maximum Case Minimum Case
Cj – Zj Cj – Zj
All All
≤0 ≥0
0, - Values 0, + Values
M-MENAS LARGEST VALUE
7M value is the largest value will prove therefore selected as key column
Key column decided that x2 is the entering variable. The after key row will be decided
the exit variable.
Simplex Table 1
CBi Cj 2 3 4 0 0 -M -M
BV x1 x2 X3 s1 s2 A1 A2 Solution Ratio
0 s1 3 1 4 1 0 0 0 600 600/1 = 600
-M A1 2 4 2 0 -1 1 0 480 480/4 = 120
=-M A2 2 3 3 0 0 0 1 540 540/3 = 180
Zj -4M -7M -5M 0 M -M -M
Cj -Zj 2+4M 3+7M 4+5M 0 -M 0 0
X2 is entering and A1 is leaving
11
Simplex Table 2
CBi Cj 2 3 4 0 0 -M
BV x1 x2 X3 s1 s2 A2 Solution Ratio
0 s1 5/2 0 7/2 1 1/4 0 480 480/7/2
= 960/7
3 x2 1/2 1 1/2 0 -1/4 0 480/4 = 240
120
-M A2 1/2 0 3/2 0 3/4 1 180 120
Zj 3/2-M/2 3 3/2-3M/2 0 -3/4-3M/4 -M
Cj -Zj ½+M/2 0 5/2+3M/2 0 ¾+3M/4 0
x3 is entering variable and A2 is leaving variable
Simplex Table 3
CBi Cj 2 3 4 0 0
BV x1 x2 x3 s1 s2 Solution Ratio
0 s1 4/3 0 0 1 -3/2 60
3 x2 1/3 1 0 0 -1/2 60
4 x3 1/3 0 1 0 1/2 120
Zj 7/3 3 4 0 1/2 660
Cj -Zj -1/3 0 0 0 -1/2
12
Max z 2 x1 3 x2 4 x3
x2 60
x3 120
x1 0
Max z 660
Question # 7 (Practice Problem)
Objective Function:
Min z 4 x1 x 2
Subject to Constant:
3 x1 x 2 3
4 x1 3 x 2 6
x1 2 x 2 4
x1 , x1 0
13
Linear Programming Problem (LPP)
By Two-Phase Method
Two types of problems:
Objective Function can maximise and can minimise
Only minimise type of objective function can be solved with the help of Two-phase
method.
If there is maximise problem case, then first we convert into minimise case then apply
two phase method.
Rules for constraints:
For ≥ type constraint
Subtract slack variable and add artificial variable [-s, +A]
For ≤ type constraint
Add only slack variable [+s]
For = type constraint
Add only artificial variable [+A]
Question # 8:
Objective Function:
Min z 3 x1 2 x 2 x 2
Subject to:
x1 4 x 2 3 x3 50
2 x1 x 2 x3 30
-3 x1 2 x 2 x 3 -40
x1 , x 2 , x3 0
14
Solution:
Converting into equalities according to the rules are
Subject to:
x1 4 x 2 3 x3 s1 A1 50
2 x1 x 2 x3 s2 A2 30
-3 x1 2 x 2 x 3 s3 -40
x1 , x 2 , x3 0
Objective Function:
Min z 3 x1 2 x 2 x 2 0 s1 0 s 2 0 s3 1 A1 1 A2
Procedure for method for Phase I and Phase II
For Phase I
1. Follow the previous simplex method with revised objective function
2. Follow that till we obtained the feasible solution and searched the optimality
condition
3. revised objective function means taken only Artificial variable constant and take Zero
all others
4. Priority given to A1 over s1
5. At the end of Phase I, check weather the objective function values are zero or not in
the optimal table.
6. If YES, then move to phase II.
7. If No, then that will be the Answer and Infeasible Solution as well.
15
Simplex Table 1
CBi Cj 0 0 0 0 0 0 1 1
BV x1 x2 x3 s1 s2 s3 A1 A2 Solution
1 A1 1 4 3 -1 0 0 1 0 50
1 A2 2 1 1 0 -1 0 0 1 30
0 s3 -3 -2 -1 0 0 1 0 0 -40
Zj 3 5 4 -1 -1 0 1 1 80
Cj -Zj -3 -5 -4 1 1 0 0 0
CBi = coefficient (value) of slack variable
Cj = coefficient of objective faction
BV = Basic Variable
Solution = Inequality converted as Equality
Ratio = Solution / Key Column values
Zj = (obtained by multiplying and adding all the CBi)
After computing the Cj – Zj values, check the optimality condition. For Minimisation
cases,
Cj – Zj ≥ 0
We will select the highest negative value (-5)
Selecting the maximum positive vale for row (50)
16
Simplex Table 1
CBi Cj 0 0 0 0 0 0 1 1
BV x1 x2 x3 s1 s2 s3 A1 A2 Solution
1 A1 1 4 3 -1 0 0 1 0 50
1 A2 2 1 1 0 -1 0 0 1 30
0 s3 -3 -2 -1 0 0 1 0 0 -40
Zj 3 5 4 -1 -1 0 1 1 80
Cj -Zj -3 -5 -4 1 1 0 0 0
x2 is entering variable and A1 is the leaving variable
Simplex Table 2
CBi Cj 0 0 0 0 0 0 1
BV x1 x2 x3 s1 s2 s3 A2 Solution
0 x2 1/4 1 3/4 -1/4 0 0 0 25/2
1 A2 7/4 0 ¼ 1/4 -1 0 0 35/2
0 s3 -10/4 0 1/2 -1/2 0 0 0 -15
Zj 7/4 0 1/4 1/4 -1 0 0
Cj -Zj -7/4 0 -1/4 -1/4 1 0 1
For Minimisation cases Cj – Zj ≥ 0
17
Simplex Table 2
CBi Cj 0 0 0 0 0 0 1
BV x1 x2 x3 s1 s2 s3 A2 Solution
0 x2 1/4 1 3/4 -1/4 0 0 0 25/2
1 A2 7/4 0 ¼ 1/4 -1 0 0 35/2
0 s3 -10/4 0 1/2 -1/2 0 0 0 -15
Zj 7/4 0 1/4 1/4 -1 0 0
Cj -Zj -7/4 0 -1/4 -1/4 1 0 1
x1 is entering variable and A2 is the leaving variable
Simplex Table 3
CBi Cj 0 0 0 0 0 0
BV x1 x2 x3 s1 s2 s3 Solution
0 x2 0 1 5/7 -2/7 -1/7 0 10
0 x1 1 0 1/7 1/7 -4/7 0 10
0 s3 0 0 6/7 -1/7 10/7 0 10
Zj 0 0 0 0 0 0 0
Cj -Zj 0 0 0 0 0 0
Optimality condition fulfil here
18
For Phase II:
We will use the previous table as it as. However, objective function actual/original
values will be using.
Simplex Table 4
CBi Cj 3 2 1 0 0 0
BV x1 x2 x3 s1 s2 s3 Solution
2 x2 0 1 5/7 -2/7 -1/7 0 10
3 x1 1 0 1/7 1/7 -4/7 0 10
0 s3 0 0 6/7 -1/7 10/7 0 10
Zj 3 2 13/7 -1/7 -14/7 0 50
Cj -Zj 00 00 -6/7 1/7 14/7 0
For Minimisation cases Cj – Zj ≥ 0
Simplex Table 4
CBi Cj 3 2 1 0 0 0
BV x1 x2 x3 s1 s2 s3 Solution
2 x2 0 1 5/7 -2/7 -1/7 0 10
3 x1 1 0 1/7 1/7 -4/7 0 10
0 s3 0 0 6/7 -1/7 10/7 0 10
Zj 3 2 13/7 -1/7 -14/7 0 50
Cj -Zj 00 00 -6/7 1/7 14/7 0
19
x3 is entering variable and s3 is leaving variable
Simplex Table 5
CBi Cj 3 2 1 0 0
BV x1 x2 x3 s1 s2 Solution
2 x2 0 1 0 -1/6 -4/3 5/3
3 x1 1 0 0 1/6 1/3 25/3
1 x3 0 0 1 -1/6 5/3 35/3
Zj 3 2 1 0 0 40
Cj -Zj 0 0 0 0 0
Condition satisfied
Z j 40, when
x1 25 / 3
x2 5 / 3
x3 35 / 3
Substitute x1 to x3 in question then (O.F.), then Zj is coming out to be 40.
20