simplex

Simplex Algorithm for solving linear programming problems.
Example 1:
Consider the following LP problem:
Maximise Z = 10x + 12y subject to the constraints:
x + y ≤ 40
(i)
x + 2y ≤ 75
(ii)
x ≥ 0, y ≥ 0.
Step 1: Introduce slack variables to convert the non-trivial inequalities into
equalities:
Equation (i): x + y + s = 40
s≥0
Equation (ii): x + 2y + t = 75
t≥0
s, t are slack variables.
Step 2: Rewrite the objective function so that the RHS is a number:
Z = 10x + 12y → Z – 10x – 12y = 0.
Step 3: Write the objective function and the slack variables as initial basic variables
and construct the Initial tableau in the following format:
Basic
Variable
Z
s
t
Z
x
y
s
t
l
Equation
1
0
0
-10
1
1
-12
1
2
0
1
0
0
0
1
0
40
75
(1)
(2)
(3)
The aim is to solve the equations by combining rows together. The solution is
reached when all entries in the first row (except possibly the value in the last
column) are non-negative.
We begin by identifying the most negative entry in the objective function row,
here -12 in the y column.
We highlight the pivotal column. We then divide every entry in the ɭ column by the
corresponding value in the highlighted column. Pick the least positive of these. This
is the pivotal row.
BV
Z x
y
s
t
l
Equation
Ratio
Z
1
-10
-12
0
0
0
(1)
0/-12=0
s
y
0
0
1
1
1
1
0
0
1
40
75
(2)
(3)
40/1=40
75/2=37.5
2
Divide the pivotal row by the pivot value (to get Eqn.6).
The aim is to now get 0 entries elsewhere in the pivotal column.
We now repeat the process, first selecting the new pivotal column, i.e. the one with
the most negative value in the objective function row.
BV
Z
s
y
Z
1
0
0
x
-4
y
0
0
1
½
½
s
0
0
0
t
6
-½
½
l
450
2.5
37.5
Equation
(4)=(1)+12×(6)
(5) = (2) – (6)
(6) = (3)/2
Ratio
450/-4=-112.5
2.5/0.5 = 5
37.5/0.5 = 75
Having identified the pivotal row and the pivot value, we now divide every entry in
the pivotal row by the pivot value.
BV
Z
x
y
Z
1
0
0
x
0
1
0
y
0
0
1
s
8
2
-1
t
2
-1
1
l
470
5
35
Equation
(7)=(4)+4(8)
(8) = (5) ÷ ½
(9) = (6) – ½(8)
The process is now finished as every entry on the objective function row is nonnegative.
The values of x, y and Z can be read from the Table:
x = 5, y = 35, Z = 470.
This is the optimal solution.
Example 2:
Consider the following linear programming problem:
MAX
s.t.
Z = 10x + 30y
4x + 6y ≤ 12
8x + 4y ≤ 16
x ≥ 0, y ≥ 0.
Create the initial tableau and perform 1 pivot.
Answer: Standard form of LP is
Max. Z = 10x + 30y → Z – 10x – 30y = 0.
s.t.
4x +6 y + s = 12
8 x + 4y + t = 16
s ≥ 0, t ≥ 0
s, t are slack variables.
Initial tableau:
Basic
Variable
Z
x
y
s
t
l
Equation
Z
s
t
1
0
0
-10
4
8
-30
6
4
0
1
0
0
0
1
0
12
16
(1)
(2)
(3)
Pivot 1 or First Iteration:
Basic
Variable
Z
x
y
s
t
Z
y
t
1
0
0
10
4/6
16/3
0
1
0
5
1/6
-2/3
0
0
1
l
Equation
60 (4)=(1)+30(5)
2
(5)=(2)/6
8
(6)=(3)-4(5)
Example 3:
The owner of a shop producing automobile trailers wishes to determine the
best mix for his three products: Flat-bed trailers, Economy trailers, and
Luxury trailers. His shop is limited to working 24 days per month on
metalworking and 60 days per month on woodworking for these products.
The following table indicates the production data for the trailers.
Flat-bed
Metalworking (days)
Woodworking (days)
Unit Profit ($)
0.5
1
6
Economy
2
2
14
Luxury
1
4
13
Resource
Available
24
60
Let the decision variables of the problem be:
x1 = Number of at-bed trailers produced per month
x2 = Number of economy trailers produced per month
x3 = Number of luxury trailers produced per month
The model is
max Z=6x1 + 14x2 + 13x3
s.t.
0.5x1 + 2x2 + x3≤ 24
x1 + 2x2 + 4x3 ≤ 60
x1,x2 ≥ 0
Let x4 and x5 be slack variables corresponding to unused hours of
metalworking and woodworking capacity. Then the problem above is
equivalent to the following standard
form problem.
max Z-6x1 - 14x2 - 13x3+ 0x4+ 0x5 =0
s.t.
0.5x1 + 2x2 + x3 + x4 = 24
x1 + 2x2 + 4x3 + x5 = 60
x1,x2 ≥ 0
The pivot row and column are indicated in green; the pivot element is red.
We pick the variable with the most negative coefficient to enter the basis.
Tableau I
BASIS
Z
x4
x5
Z
1
0
0
x1
-6
0.5
1
x2
-14
2
2
x3
-13
1
4
x4
0
1
0
x5
0
0
1
RHS
0
24
60
Ratio
0
12
30
Eqn.
(1)
(2)
(3)
Tableau II
BASIS
Z
x2
x5
Z
1
0
0
x1
-2.5
0.25
0.5
x2
0
1
0
x3
-6
0.5
3
x4
7
0.5
-1
x5
0
0
1
RHS
168
12
36
Ratio
-28
24
12
Eqn.
(4)=(1)+14(5)
(5)=(2)/2
(6)=(3)-2(5)
Tableau III
BASIS
Z
x2
x3
Z
1
0
0
x1
-1.5
1/6
1/6
x2
0
1
0
x3
0
0
1
x4
5
2/3
-1/3
x5
2
-1/6
1/3
RHS
240
6
12
Ratio
-160
36.0
72
Eqn.
(7)=(4)+6(9)
(8)=(5)-(9)/2
(9)=(6)/3
Tableau IV
BASIS
Z
x1
x3
Z
1
0
0
x1
0
1
0
x2
9
6
-1
x3
0
0
1
x4
11
4
-1
x5
0.5
-1
0.5
RHS
294
36
6
Eqn.
(10)=(7)+1.5(11)
(11)=6(8)
(12)=(9)-(11)/6
Thus, the optimal value of to the z = 294. The optimal solution is x = (36; 0; 6; 0; 0).