Professional Documents
Culture Documents
Standard model : a) All variables must be non-negative i) If xi is any value Substitute xi with xi+ - xi++ ii) If xi <= 0 Substitute xi with xi++ b) All constrains are equations with non-negative RHS Constraints : e.g : 2x1 +3x2 <= 8 then 2x1 + x2 +s1 = 8 (Slack Variable) e.g: 2x1+ 3x2 => 6 then 2x1 + 3x2 s2 = 6 (Surplus Variable) Non-negative RHS : e.g: 2x1 + x2 3x3 = -5 then -2x1 x2 +3x3 = 5 e.g : 2x1 3x2 +5x3 <= -10 then -2x1 + 3x2 5x3 => 10 Basic Variable : variable with non-negative values. Non-Basic Variable : variable with value of 0. Maximization : achieve when all coefficient in the z-row is non-negative. Minimization : achieve when all coefficient in the z-row is non-positive. Example of Simplex Method : Maximize z = 5x1 + 4x2 Subject to 6x1 + 4x2 <= 24 x1 + 2x2 <= 6 -x1 + x2 <= 1 x2 <= 2 x1,x2 => 0 arrange the equation in the table Basic x1 x2 z -5 -4 s1 6 4 s2 1 2 s3 -1 1 s4 0 1
change to standard model
Maximize z = 5x1 + 4x2 Subject to 6x1 + 4x2 + s1 = 24 x1 + 2x2 + s2 = 6 -x1 + x2 + s3 = 1 x2 +s4 = 2 x1,x2,s1,s2,s3,s4 => 0
s1 0 1 0 0 0
s2 0 0 1 0 0
s3 0 0 0 1 0
s4 0 0 0 0 1
solution 0 24 6 1 2
For MAXIMIZATION problem, since -5 is more negative than -4, the entering variable is x1
100853
Mechanical Engineering
Since the entering variable is x1. Leaving variable = min { 24/6, 6/1, -, - } = min { 4, 6, -, - } Thus, the leaving variable is s1. Step 1 : determine the pivot equation New Pivot Equation = ( Current Pivot Equation ) / (Pivot Element) New x1-row = ( 6, 4, 1, 0, 0, 0, 24 ) / ( 6 ) = ( 1, 2/3, 1/6, 0, 0, 0, 4 ) Step 2 : other equation New Equation = Current Equation ( Pivot Column Coefficient )( New Pivot Equation ) New z-row = ( -5, -4, 0, 0, 0, 0, 0 ) ( -5 )( 1, 2/3, 1/6, 0, 0, 0, 4 ) = ( 0, -2/3, 5/6, 0, 0, 0, 20 ) New s2-row = ( 1, 2, 0, 1, 0, 0, 6 ) ( 1 )( 1, 2/3, 1/6, 0, 0, 0, 4 ) = ( 0, 4/3, -1/6, 1, 0, 0, 2 ) New s3-row = ( -1, 1, 0, 0, 1, 0, 1 ) ( -1 )( 1, 2/3, 1/6, 0, 0, 0, 4 ) = ( 0, 5/3, 1/6, 0, 1, 0, 5 ) New s4-row = ( 0, 1, 0, 0, 0, 1, 2 ) ( 0 )( 1, 2/3, 1/6, 0, 0, 0, 4 ) = ( 0, 1, 0, 0, 0, 1, 2 ) Step 3 : arrange the data in the new table Basic x1 x2 s1 z 0 -2/3 5/6 x1 1 2/3 1/6 s2 0 4/3 -1/6 s3 0 5/3 1/6 s4 0 1 0
s2 0 0 1 0 0
s3 0 0 0 1 0
s4 0 0 0 0 1
solution 20 4 2 5 2
For MAXIMIZATION problem, since -2/3 is more negative than 5/6, the entering variable is x2
Since the entering variable is x2. Leaving variable = min { 4/(2/3), 2/(4/3), 5/(5/3), 2/1 } = min { 6, 1.5, 3, 2 } Thus, the leaving variable is s2. Repating step 1 and 2, arranging the data in the table.
100853
Mechanical Engineering
Basic z x1 s2 s3 s4
x1 0 1 0 0 0
x2 0 0 1 0 0
s3 0 0 0 1 0
s4 0 0 0 0 1
For MAXIMIZATION problem, the all coefficient in the z-row is NON-NEGATIVE. Since all the coefficient in z-row is NON-NEGATIVE, thus the solution is optimum
Minimize z = 4x1 + x2 + MR1 + MR2 Subject to 3x1 + x2 + R1 = 3 4x1 + 3x2 + R2 s2 = 6 x1 + 2x2 + s3 = 4 x1,x2,R1,R2,s2,s3 => 0
s2 0 0 -1 0
s3 0 0 0 1
R1 -M 1 0 0
R2 -M 0 1 0
solution 0 3 6 4
100853
Mechanical Engineering
New z-row
= Old z-row + M( R1-row ) + M( R2-row ) = ( -4, -1, 0, -M, 0, -M, 0 ) + M( 4, 3, -1, 0, 0, 1, 6 ) + M( 3, 1, 0, 0, 1, 0, 3 ) = [( -4 + 7M ), ( -1 + 4M ), -M, 0, 0, 0, 9M ] Arrange new table Basic x1 x2 s2 s3 R1 R2 solution z (7M-4) (4M-1) -M 0 0 0 9M R1 3 1 0 0 1 0 3 R2 4 3 -1 0 0 1 6 s3 1 2 0 1 0 0 4
For MINIMIZATION problem, since 7M-4 is more positive than 4M-1 and -M, the entering variable is x1
Since the entering variable is x1. Leaving variable = min { 3/3, 6/4, 4/1 } = min { 1, 3/2, 4 } Thus, the leaving variable is R1. By using step 1 and step 2, we get the new table Basic x1 x2 s2 z 0 (1+5M)/3 -M x1 1 1/3 0 R2 0 5/3 -1 s3 0 5/3 0
s3 0 0 0 1
R2 0 0 1 0
solution (4+2M) 1 2 3
For MINIMIZATION problem, since 1+5M/3 is more positive than 4-7M/3 and -M, the entering variable is x2
Since the entering variable is x2. Leaving variable = min { 1/(1/3), 2/(5/3), 3/(5/3) } = min { 3, 1.2, 1.8 } Thus, the leaving variable is R2.
100853
Mechanical Engineering
By using step 1 and step 2, we get the new table Basic x1 x2 s2 z 0 0 1/5 x1 1 0 1/5 x2 0 1 -3/5 s3 0 0 1
s3 0 0 0 1
For MINIMIZATION problem, since 1/5 is more positive than (8/5) - M and (-1/5) - M, the entering variable is s2
Since the entering variable is s2. Leaving variable = min { (3/5)/(1/5), -, 1/1 } = min { 3, -, 1 } Thus, the leaving variable is s3. By using step 1 and step 2, we get the new table Basic x1 x2 s2 s3 z 0 0 0 -1/5 x1 1 0 0 -1/5 x2 0 1 0 3/5 s2 0 0 1 1
R2 -M 0 0 -1
For MINIMIZATION problem, the all coefficient in the z-row is NON-POSITIVE. Thus, the table is now optimum
100853
Mechanical Engineering
Example of Two Phase Method : PHASE I Minimize z = 4x1 + x2 Subject to 3x1 + x2 = 3 4x1 + 3x2 => 6 x1 + 2x2 <= 4 x1,x2 => 0 arrange the equation in the table Basic x1 x2 R 0 0 R1 3 1 R2 4 3 s3 1 2
change to standard model
s2 0 0 -1 0
s3 0 0 0 1
R1 -1 1 0 0
R2 -1 0 1 0
solution 0 3 6 4
Change R-row equation into new z-row equation by eliminating the R1 and R2 column
New R-row
= R-row + R1-row + R2-row = ( 0, 0, 0, 0, -1, -1, 0 ) + ( 4, 3, -1, 0, 0, 1, 6 ) + ( 3, 1, 0, 0, 1, 0, 3 ) = ( 7, 4, -1, 0, 0, 0, 9 ) Arrange new table Basic x1 x2 s2 s3 R1 R2 solution z 7 4 -1 0 0 0 9 R1 3 1 0 0 1 0 3 R2 4 3 -1 0 0 1 6 s3 1 2 0 1 0 0 4
For MINIMIZATION problem, since 7is more positive than 4 and -1, the entering variable is x1 For PHASE I problem, all the coefficient in the z-row is NON-POSITIVE
Since the entering variable is x1. Leaving variable = min { 3/3, 6/4, 4/1 } = min { 1, 3/2, 4 } Thus, the leaving variable is R1.
100853
Mechanical Engineering
By using step 1 and step 2, we get the new table Basic x1 x2 s2 z 0 5/3 -1 x1 1 1/3 0 R2 0 5/3 -1 s3 0 5/3 0
s3 0 0 0 1
R2 0 0 1 0
solution 2 1 2 3
For MINIMIZATION problem, since 5/3 is more positive than -7/3 and -1, the entering variable is x2
Since the entering variable is x2. Leaving variable = min { 1/(1/3), 2/(5/3), 3/(5/3) } = min { 3, 1.2, 1.8 } Thus, the leaving variable is R2. By using step 1 and step 2, we get the new table Basic x1 x2 s2 s3 z 0 0 0 0 x1 1 0 1/5 0 x2 0 1 -3/5 0 s3 0 0 1 1
R1 -1 3/5 -4/5 1
R2 -1 -1/5 3/5 -1
For PHASE I problem, the all coefficient in the z-row is NON-POSITIVE. The table is now optimum.
PHASE II Minimize z = 4x1 + x2 Subject to x1 + (1/5)s2 = 3/5 x2 (3/5)s2 = 6/5 s2 + s3 = 1 x1,x2,s2,s3 => 0 arrange the equation in the table Basic x1 x2 z -4 -1 x1 1 0 x2 0 1 s3 0 0
s2 0 1/5 -3/5 1
s3 0 0 0 1
Change z-row equation into new z-row equation by eliminating the value in x1 and x2 column
100853
Mechanical Engineering
New z-row
= Old z-row + 4( x1-row ) + ( x2-row ) = ( -4, -1, 0, 0, 0 ) + 4( 1, 0, 1/5, 0, 3/5 ) + ( 0, 1, -3/5, 0, 6/5 ) = ( 0, 0, 1/5, 0, 18/5 )
x2 0 0 1 0
s3 0 0 0 1
Since the entering variable is s2. Leaving variable = min { (3/5)/(1/5), -, 1/1 } = min { 3, -, 1 } Thus, the leaving variable is s3. By using step 1 and step 2, we get the new table Basic x1 x2 s2 s3 z 0 0 0 -1/5 x1 1 0 0 -1/5 x2 0 1 0 3/5 s2 0 0 1 1
For MINIMIZATION problem, the all coefficient in the z-row is NON-POSITIVE. Thus, the table is now optimum
100853
Mechanical Engineering
Example of Dual Simplex Method : Minimize z = 3x1 + 2x2 Subject to 3x1 + x2 => 3 4x1 + 3x2 => 6 x1 + x2 <= 3 x1,x2 => 0 arrange the equation in the table Basic x1 x2 z -3 -2 s1 -3 -1 s2 -4 -3 s3 1 1
change to standard model
s1 0 1 0 0
s2 0 0 1 0
s3 0 0 0 1
solution 0 -3 -6 3
For MINIMIZATION problem, the all coefficient in the z-row is NON-POSITIVE. The table seems to look optimum but it is not feasible since the solution column have negative value (not feasible)
Since -6 is more negative than -3 and 3, s2-row it is chosen to be leaving variable. The entering variable is the non-basic variable with SMALLEST RATIO (for MINIMIZATION) and SMALLEST ABSOLUTE RATIO (for MAXIMIZATION)
The entering variable is, ( z-row ) / ( s2-row ) = ( -3, -2, 0, 0, 0 ) / ( -4, -3, 0, 1, 0 ) = ( 3/4, 2/3, -, -, - ) Since the SMALLEST RATIO is 2/3, thus the entering variable is x2. By using step 1 and step 2, we get the new table Basic x1 x2 s1 s2 z -1/3 0 0 -2/3 s1 -5/3 0 1 -1/3 x2 4/3 1 0 -1/3 s3 -1/3 0 0 1/3
For MINIMIZATION problem, the all coefficient in the z-row is NON-POSITIVE. The table seems to look optimum but it is not feasible since the solution column have negative value (not feasible)
s3 0 0 0 1
solution 4 -1 2 1
Since -1 is more negative than 2 and 1, s1row it is chosen to be leaving variable. The entering variable is the non-basic variable with SMALLEST RATIO (for MINIMIZATION) and SMALLEST ABSOLUTE RATIO (for MAXIMIZATION)
100853
Mechanical Engineering
The entering variable is, ( z-row ) / ( s1-row ) = ( -1/3, 0, 0, -2/3, 0 ) / ( -5/3, 0, 1, -1/3, 0 ) = ( 1/5, -, -, 2, - ) Since the SMALLEST RATIO is 2/3, thus the entering variable is x1. By using step 1 and step 2, we get the new table Basic x1 x2 s1 s2 z 0 0 -1/5 -3/5 s1 1 0 -3/5 -1/5 x2 0 1 4/5 -3/5 s3 0 0 -1/5 2/5
s3 0 0 0 1
100853
Mechanical Engineering
A) DEGENERACY - More than 1 basic variable can be the non-basic variable at the next iteration Basic x1 x2 s1 s2 solution z -12 -4 0 0 0 z-row s1 4 1 1 0 8 s1-row s2 2 2 0 1 4 s2-row
B) ALTERNATIVE OPTIMA - More than 1 solution point which can assume the same optimal value. Basic x1 x2 s1 s2 solution z 0 0 2 0 10 s1 1/2 1 0 5/2 s2 0 -1/2 1 3/2
The table is optimum but x1 can enter the basis without changing the value of z
Basic z s1 s2
x1 0 0 1
x2 0 1 0
s1 2 1 -1
s2 0 -1 2
solution 10 1 3
Alternative optima occurs when the objective function is parallel with one of the constraints
s2 0 0 1
solution 0 10 40
For MAXIMIZATION PROBLEM, -4 is chosen to leave because -4 is more negative than -2.
But, the problem occurs here. Since 10/-1 and 40/0 cant give any value, so there are no variable can leave the basis
100853
Mechanical Engineering
D) NON-EXISTING ( OR FEASIBLE ) SOLUTION - The region for the solution does not exist Basic x1 x2 s1 s2 z 1+5M 0 M 2+4M x2 2 1 0 1 R2 -5 0 -1 -4
R2 0 0 1
solution 4-4M 2 4
For MAXIMIZATION PROBLEM, the table is now optimum. BUT value of M cant be exists at solution. THUS THE SOLUTION IS NOT FEASIBLE
SENSITIVITY ANALYSIS
Determine whether change in parameters of the model within certain limits would cause the optimum solution to change Changes due to : a) Parameters value which have changed b) Conditions which have changed Reason for changes : a) New price b) New technology c) New option d) Inaccurate parameters estimates Advantages : a) Determine the accuracy of the data input b) Determine the control range for the parameters values so that obtained solutions are always optimum c) Used in process planning
100853
Mechanical Engineering
*objective of the model is to DETERMINE THE UNKNOWN xij that will MINIMIZE the total transportation cost. THEEE steps of NORTHWEST CORNER METHOD i) Allocate as much as possible to the selected cell and adjust the associated amount of supply and demand by substracting the allocated amount. ii) Cross out the row or column with zero supply or demand to indicate that no further assignment can be made to that row or column. If both a row and a column net to 0 simultaneously, cross out one only, and leave a zero supply (or dema iii) nd) in the un-crossed row(or column) iv) If exactly one row or column is left uncrossed, stop. Otherwise, move to the cell to the right if a column has just been crossed out or below if a row just was crossed out. Go to step 1. EXAMPLE TRANSPORTATIONAL PROBLEM An electric company has 4 electric power plants which uses coal. The coals are supplied by 3 coalmines. The cost of transport ting a unit of coal from the coalmines to the power plants are : Power plants Supply 1 2 3 4 1 10 2 3 4 5 Coalmines 2 15 5 4 3 1 3 21 1 3 3 2 Demand 6 11 17 12 Using step 1 : Power plants Supply 1 2 3 4 1 6 2 4 3 10 4 5 Coalmines 2 7 4 8 3 15 5 1 3 9 3 12 2 21 1 3 Demand 6 11 17 12
The 1st step is choose 6 and put in 1st column 1st row since 6 is the minimum value in the demand and supply.
Cost = (6x2) + (4x3) + (7x4) + (8x3) + (9x3) + (12x2) = 127 units A. Determination of entering variable. x11 : u1 + v1 = c11 = 2 x12 : u1 + v2 = c12 = 3 x22 : u2 + v2 = c22 = 4 x23 : u2 + v3 = c23 = 3 x33 : u3 + v3 = c33 = 3 x34 : u3 + v4 = c34 = 2
100853
Mechanical Engineering
let u1 = 0 then v1 =2, v2 =3, v3 =2, v4 =1, u2 =1, u3 =1 B. Determination of optimality. Since the problem is MINIMIZATION, thus all the entering variable must be NON-NEGATIVE. x13 : u1 + v3 - c11 = 0 + 2 4 = -2 x14 : u1 + v4 - c14 = 0 + 1 5 = -4 x21 : u2 + v1 c21 = 1 + 2 5 = -2 x24 : u2 + v4 - c24 = 1 + 1 1 = 1 x31 : u3 + v1 c31 = 1 + 2 1 = 2 since x31 have the larger positive number, the loop start at x31 x32 : u3 + v2 c32 = 1 + 3 3 = 1 Power plants 2 2 4 +3 7 - 4 8 5 1 9 3 11 Supply 3 4 + 3 - 3 17 4 5 1 2 12 10 15 21
1 Coalmines Demand 1 2 3 6 + 6 -
12
C. Determination of leaving variable. a) The leaving variable is the basic variable with the SMALLEST negative sign. In this case 6 is SMALLER than 7 and 9. b) Basic variable with +ve sign, add the value of leaving variable. c) Basic variable with -ve sign, minus the value of leaving variable. Construct new table. 1 Coalmines Demand 1 2 3 2 5 1 6 Power plants 2 3 10 3 1 4 14 3 3 11 17 Supply 4 4 3 3 5 1 2 12 10 15 21
12
Cost = (6x1) + (10x3) + (1x4) + (14x3) + (3x3) + (12x2) = 115 unit The step A, B and C is repeated. A. Determination of entering variable. B. Determintaion of optimality Power plants 1 2 3 1 -2 2 10 3 -2 4 Coalmines 2 -4 5 1 4 14 + 3 3 6 1 1 + 3 3 - 3 Demand 6 11 17 The entering variable is either x32 or x24. In this case we choose x32.
Supply 4 -4 1 12 12 5 1 2 10 15 21
100853
Mechanical Engineering
A. Determination of leaving variable. The leaving variable is x22 since it is SMALLER than x33. Construct new table. 1 Coalmines Demand 1 2 3 2 5 1 6 Power plants 2 3 10 3 4 15 1 3 2 11 17 Supply 4 4 3 3 5 1 2 12 10 15 21
12
Cost = (6x1) + (10x3) + (1x3) + (15x3) + (2x3) + (12x2) = 114 unit The step A, B and C is repeated. C. Determination of entering variable. D. Determination of optimality Power plants 1 2 3 4 1 -1 2 10 3 -1 4 -3 5 Coalmines 2 -4 5 -1 4 15 3 1 +1 3 6 1 1 3 2 + 3 12 -2 Demand 6 11 17 12 The entering variable is x24 B. Determination of leaving variable. The leaving variable is x34 since it is SMALLER than x23. Construct new table. 1 Coalmines Demand 1 2 3 2 5 1 6 Power plants 2 3 10 3 3 4 1 3 14 11 17
Supply 10 15 21
Supply 4 4 3 3 12 12 5 1 2 10 15 21
Cost = (6x1) + (10x3) + (1x3) + (3x3) + (14x3) + (12x1) = 102unit The step A, B and C is repeated. A. Determination of entering variable. B. Determination of optimality Power plants 1 2 3 1 -1 2 10 3 -1 Coalmines 2 -4 5 -1 4 3 3 6 1 1 3 14 Demand 6 11 17 The table is optimum.
Supply 4 4 3 3 -4 12 -1 12 5 1 2 10 15 21
100853
Mechanical Engineering
Assign n workers to n jobs cij is the cost of assigning worker i to job j. MINIMIZING the cost.
The HUNGARIAN METHOD : i) From original cost matrix, identify each row minimum, and substract it from all entries of the row. ii) For the matrix resulting from (i), identify each column minimum and substract it from all the entries of the column. iii) Identify the optimal solution as the feasible assignment associated with the zero element of the matrix obtained in (ii) iv) If no feasible solution (with 0 entries) :a) Draw the minimum number of horizontal and vertical line in the last reduced matrix that will cover all the 0 entries. b) Select the smallest uncovered element and then add it to every element at the intersection of 2 lines. c) Repeat this step until feasible solution is obtained. EXAMPLE OF ASSIGNMENT MODEL 1 1 5 2 14 3 15 Machine 1 Find the optimal assignment.
2 7 10 13 1
3 9 12 16 1
Worker 1 1 1
3 9 12 16 1
Worker 1 1 1
MIN 5 10 13
1 2 3 1 0 2 4 2 4 0 2 3 2 0 3 Machine 1 1 1 MIN 0 0 2 Substract each column with the minimum number of the column.
Worker 1 1 1
100853
Mechanical Engineering
Thus, Worker 1 can be assign to machine 1 with cost of 5 units. Worker 2 can be assign to machine 3 with cost of 12 units. Worker 3 can be assign to machine 2 with cost of 13 units. The MINIMUM COST = 30 units EXAMPLE OF ASSIGNMENT MODEL 1 2 1 1 4 2 9 7 3 4 5 4 8 7 Machine 1 1 Find the optimal assignment. 1 2 3 1 1 4 6 2 9 7 10 3 4 5 11 4 8 7 8 Machine 1 1 1 Subtract each row with minimum number of the row.
3 6 10 11 8 1
4 3 9 7 5 1
Worker 1 1 1 1
4 3 9 7 5 1
Worker 1 1 1 1
MIN 1 7 4 5
1 2 3 1 0 3 5 2 2 0 3 3 0 1 7 4 3 2 3 Machine 1 1 1 MIN 0 0 3 Substract each column with the minimum number of the column.
4 2 2 3 0 1 0
Worker 1 1 1 1
100853
Mechanical Engineering
1 2 3 4 Machine
1 0 2 0 3 1
2 3 0 1 2 1
3 2 0 4 0 1
4 2 2 3 0 1
Worker 1 1 1 1
The table is not optimum yet. DRAW THE HORIZONTAL AND VERTICAL LINE THAT COVER ALL THE 0 ENTRIES. The SMALLEST UNCOVERED element is 1. Then substract each uncovered element with 1 and add the intersection of line with 1. 1 2 3 1 0 2 1 2 3 0 0 3 0 0 3 4 4 2 0 Machine 1 1 1 The table is now optimum. Thus, Worker 1 can be assign to machine 1 with cost of 1 units. Worker 2 can be assign to machine 3 with cost of 5 units. Worker 3 can be assign to machine 2 with cost of 10 units. Worker 4 can be assign to machine 4 with cost of 5 units. The MINIMUM COST = 21 units 4 1 2 2 0 1 Worker 1 1 1 1
100853
Mechanical Engineering