Operations Research - Linear Programming - Primal Simplex Tableaux Generator
by
Elmer G. Wiens
Egwald's popular web pages are provided without cost to users. Please show your support by joining Egwald Web Services as a Facebook Fan:
Follow Elmer Wiens on Twitter:
The primal simplex method transforms an initial tableau into a final tableau containing the solutions to the primal and dual problems. Each stage of the algorithm generates an intermediate tableau as the algorithm gropes towards a solution.
This web page permits you to enter your own linear programming problem and generate these tableaux with a user friendly interface. You can specify up to 6 variables and 10 constraints in the primal problem, with any mixture of <=, >=, and = constraints.
To illustrate the procedure you need to follow, consider the problem:
To generate the form used to enter the l.p. data you must set the parameters that specify your l.p. problem as I have done below for the problem above.
After you fill in your form and click submit paramters, a web page will pop with a table, like the one below, where you can enter the data of your l.p. problem. Notice that you need neither multiply = constrainst by -1, nor convert >= constraints to <= constraints.
FormTable =
After you fill in your data and click submit, the program will automatically calculate a sequence of tableaux that solves the primal and dual l.p. problems. Examine the tableaux that follow to see how the primal simplex method proceeds to find the solution.
To perform a sensitivity analysis on your linear programming problem, change the data in the table above, and click Submit L.P. again.
Primal Simplex Algorithm.
The standard form for the initial primal simplex tableau is:
Initial Tableau
b
A
I3
0
-cT
O3T
The primal simplex algorithm calculates a sequence of tableaux. Tableauk has the form:
Tableauk
ß
U
B
µ
tT
yT
=
Tableauk
ß
Û
µ
Ø
after consolidating the center 2 by 2 block of matrices.
The "three-phase method" of the primal simplex algorithm:
Phase 0 - drive all artificial variables (associated with = constraints) to zero, i.e. eliminate them from the basis;
Phase I - find a tableau with ß >= 0, i.e. a feasible primal program;
Phase II - generate tableaux that increase the value of µ, without dropping back into Phase 0 or I, until Ø >= 0 for all sign restricted variables, i.e. find a feasible primal program that maximizes the objective function.
Phase 0: Drive the artificial variables from the basis.
Tableau0
b0
x01
x02
x03
s01
s02
s*03
row sum
b / Ûk
L01
85
1
1
1
1
0
0
89
Warning: A non-numeric value encountered in /services/webpages/e/g/egwald.ca/public/operationsresearch/functions/primalsimplex.php on line 64
0
L02
-90
-1.25
-0.5
-1
0
1
0
-91.75
Warning: A non-numeric value encountered in /services/webpages/e/g/egwald.ca/public/operationsresearch/functions/primalsimplex.php on line 64
0
L03
55
0.6
1
0.5
0
0
1
58.1
Warning: A non-numeric value encountered in /services/webpages/e/g/egwald.ca/public/operationsresearch/functions/primalsimplex.php on line 64
0
P0
0
-15
-10
-17
0
0
0
-42
Basis for Tableau0: [s1, s2, s3, ]. Value of Objective Function = 0.
Proceed to the next tableau as follows:
Phase 0: Drive the artificial variables from the basis.
A. In Tableau0:
1. Select an artificial variable in the basis: s*3. The pivot row = 3.
2. Select a nonzero element in row L3 as pivot: Û3,2 = 1. The pivot column = 2.
B. To create Tableau1:
3. Compute row L13 = L03 / (1).
4. Subtract multiples of row L13 from all other rows of Tableau0 so that x12 = e3 in Tableau1.
Phase I: Goal: get ß >= 0.
Tableau1
b1
x11
x12
x13
s11
s12
s*13
row sum
b / Ûk
L11 = L01 - (1) * L13
30
0.4
0
0.5
1
0
-1
30.9
75
L12 = L02 - (-0.5) * L13
-62.5
-0.95
0
-0.75
0
1
0.5
-62.7
65.789
L13 = L03 / (1)
55
0.6
1
0.5
0
0
1
58.1
91.667
P1 = P0 - (-10) * L13
550
-9
0
-12
0
0
10
539
Basis for Tableau1: [s1, s2, x2, ]. Value of Objective Function = 550.
Proceed to the next tableau as follows:
Phase 0: Complete.
Phase I: Goal: get ß >= 0.
A. In Tableau1:
1. Select a target row, r, with br < 0: b12 = -62.5, r = 2.
2. Select any column, col, with a negative entry in row = 2 as the pivot column: col = 1 associated with Û2,1 = -0.95 and constraint L2.
3. Compute the ratios bi / Ûi,1 as per the last column.
Select the row with the least positive ratio as the pivot row: row = 2 associated with constraint L2. Thus Û2,1 = -0.95 is the pivot; variable s2 will leave the basis; variable x21 will enter the basis.
B. To create Tableau2:
4. Compute row L22 = L12 / (-0.95).
5. Subtract multiples of row L22 from all other rows of Tableau1 so that x21 = e2 in Tableau2.
Phase II: Goal: get Ø >= 0.
Tableau2
b2
x21
x22
x23
s21
s22
s*23
row sum
b / Ûk
L21 = L11 - (0.4) * L22
3.684
0
0
0.184
1
0.421
-0.789
4.5
8.75
L22 = L12 / (-0.95)
65.789
1
-0
0.789
-0
-1.053
-0.526
66
0
L23 = L13 - (0.6) * L22
15.526
0
1
0.026
0
0.632
1.316
18.5
24.583
P2 = P1 - (-9) * L22
1142.105
0
0
-4.895
0
-9.474
5.263
1133
Basis for Tableau2: [s1, x1, x2, ]. Value of Objective Function = 1142.11.
Proceed to the next tableau as follows:
Phase 0: Complete.
Phase I: Complete.
Phase II: Goal: get Ø >= 0.
A. In Tableau2:
1. Select the pivot column, col, with the most negative value in Ø: col = 5, Ø5 = -9.474: s32 will enter the basis.
2. Compute the ratios bi / Ûi,5 as per the last column.
Select the row with the least positive ratio as the pivot row: row = 1 associated with constraint L1. Thus Û1,5 = 0.421 is the pivot; variable s1 will leave the basis; variable s32 will enter the basis.
B. To create Tableau3:
3. Compute row L31 = L21 / (0.421).
4. Subtract multiples of row L31 from all other rows of Tableau2 so that s32 = e1 in Tableau3.
Tableau3
b3
x31
x32
x33
s31
s32
s*33
row sum
b / Ûk
L31 = L21 / (0.421)
8.75
0
0
0.438
2.375
1
-1.875
10.688
20
L32 = L22 - (-1.053) * L31
75
1
0
1.25
2.5
0
-2.5
77.25
60
L33 = L23 - (0.632) * L31
10
0
1
-0.25
-1.5
0
2.5
11.75
0
P3 = P2 - (-9.47) * L31
1225
0
0
-0.75
22.5
0
-12.5
1234.25
Basis for Tableau3: [s2, x1, x2, ]. Value of Objective Function = 1225.
Proceed to the next tableau as follows:
Phase 0: Complete.
Phase I: Complete.
Phase II: Goal: get Ø >= 0.
A. In Tableau3:
1. Select the pivot column, col, with the most negative value in Ø: col = 3, Ø3 = -0.75: x43 will enter the basis.
2. Compute the ratios bi / Ûi,3 as per the last column.
Select the row with the least positive ratio as the pivot row: row = 1 associated with constraint L1. Thus Û1,3 = 0.438 is the pivot; variable s2 will leave the basis; variable x43 will enter the basis.
B. To create Tableau4:
3. Compute row L41 = L31 / (0.438).
4. Subtract multiples of row L41 from all other rows of Tableau3 so that x43 = e1 in Tableau4.
Tableau4
b4
x41
x42
x43
s41
s42
s*43
row sum
b / Ûk
L41 = L31 / (0.438)
20
0
0
1
5.429
2.286
-4.286
24.429
Warning: A non-numeric value encountered in /services/webpages/e/g/egwald.ca/public/operationsresearch/functions/primalsimplex.php on line 64
0
L42 = L32 - (1.25) * L41
50
1
0
0
-4.286
-2.857
2.857
46.714
Warning: A non-numeric value encountered in /services/webpages/e/g/egwald.ca/public/operationsresearch/functions/primalsimplex.php on line 64
0
L43 = L33 - (-0.25) * L41
15
0
1
0
-0.143
0.571
1.429
17.857
Warning: A non-numeric value encountered in /services/webpages/e/g/egwald.ca/public/operationsresearch/functions/primalsimplex.php on line 64
0
P4 = P3 - (-0.75) * L41
1240
0
0
0
26.571
1.714
-15.714
1252.571
Basis for Tableau4: [x3, x1, x2, ]. Value of Objective Function = 1240.