Linear Programming
(LP)
The Simplex Method
Overall Idea of Simplex Method
Simplex Method translates the geometric
definition of the extreme point into an algebraic definition
Initial Step: all the constraints are put in a
standard form
In standard form: all the constraints are
expressed as equations by augmenting
Overall Idea
The conversion of inequality to equation
normally results in a set of simultaneous
equations in which the number of variables exceeds the number of equations
The Equation might yield an infinite
number of solution points
Overall Idea
Linear Algebra Theory:
A basic solution is obtained
by setting to zero as many variable as difference
between the total number of variables and the total number of equation
solving for the remaining variable
Standard LP Form
To develop a general solution method, LP
Development of the Simplex
Method
Two types of Simplex Method
Primal Simplex Method
Dual Simplex Method
Basically, the difference between the two
Standard LP Form
The Properties of Standard LP Form
All constraints are equations (Primal Simplex Method requires a non-negative right-hand side)
All the variables are non-negative
The Objective Function may be maximization
Standard LP Form:
Constraints
A constraint of type () is converted to
equation by adding a slack variable to the
left side of the constraint
For example:
x1 + 2x2 6
Standard LP Form:
Constraints
A constraint of type () is converted to
equation by subtracting a surplus variable form the left side of the constraint
For example:
3x1 + 2x2 – 3x3 5
Standard LP Form
Constraints
The right side of an equation can always
be made non-negative by multiplying both sides by –1
For example:
2x1 + 3x2 – 7x3 = –5
Standard LP Form
Constraints
The direction of an inequality is reversed
when both sides are multiplied by –1
For example:
Standard LP Form
Variables
Unrestricted variable xi can be expressed
in terms of two non-negative variables
xi = xi’ – xi”, where xi’, xi” 0 xi’ > 0, xi” = 0, and vice versa
Standard LP Form
Objective Function
Maximization or Minimization
Maximization = Minimization of the
negative of the function
For example:
Standard LP Form
Example
Write the following LP Model in standard
form:
Minimize z = 2x1 + 3X2
Subject to (with constraints):
x1 + x2 = 10
Basic Solution
For m: number of equations
And n: number of unknowns (variables) Basic solution is determined
by setting n – m (number of) variables equal to zero
The n – m variables are called the non-basic variables
solving the m remaining variables
The m remaining variables are called the basic variable
Basic Solution
Example
2x1 + x2 + 4x3 + x4 = 2 x1 + 2x2 + 2x3 + x4 = 3
m = 4
n = 2
Basic solution is associated with m – n (= 4 – 2 = 2) zero variables
Basic Solution
Example
2x1 + x2 + 4x3 + x4 = 2 x1 + 2x2 + 2x3 + x4 = 3
Set x2 = 0 and x4 = 0
2x1 + 4x3 = 2
Basic Solution
Example
2x1 + x2 + 4x3 + x4 = 2 x1 + 2x2 + 2x3 + x4 = 3
Set x3 = 0 and x4 = 0 (non-basic variables) x1 and x2 are basic variables
2x1 + x2 = 2 x1 + 2x2 = 3 x1 = 1/3
x2 = 4/3
Basic feasible solution:
Basic Solution
Example
2x1 + x2 + 4x3 + x4 = 2
x1 + 2x2 + 2x3 + x4 = 3
Set x1 = 0 and x2 = 0
x3 and x4
4x3 + x4 = 2
2x3 + x4 = 3
x3 = – 1/2
Basic Feasible Solution
A basic solution is said to be feasible if all
its solution values are non-negative
Primal and Dual Simplex
All iterations in Primal Simplex Method
are always associated to feasible basic
solutions only
Primal Simplex Method deals with feasible
Primal and Dual Simplex
Iterations in Dual Simplex Method end
only if the last iteration is infeasible
Both methods yield feasible basic solution
Primal Simplex Method
The Reddy Mikks Company
XE: tons produced daily of exterior paint
XI: tons produced daily of interior paint
Objective Function to be satisfy:
Maximize z = 3XE + 2XI
Subject to these constraints:
XE + 2XI 6
2XE + XI 8
– XE + XI 1
XI 2
Primal Simplex Method
The Reddy Mikks Company
Set the constraints to equations
xE + 2xI 6 xE + 2xI + sI = 6 2xE + xI 8 2xE + xI + s2 = 8 – xE + xI 1 – xE + xI + s3 = 1 xI 2 xI + s4= 2
xI, xE, sI, s2, s3, s4 0
m = 4
Primal Simplex Method
The Reddy Mikks Company
Basic Solution
m = 4
n = 2 (xE and xI)
If xE and xI = 0 then
xE + 2xI + sI = 6 sI = 6
2xE + xI + s2 = 8 s2 = 8
– xE + xI + s3 = 1 s3 = 1
xI + s4= 2 s4= 2
Primal Simplex Method
The Reddy Mikks Company
Convert the Objective Function
Maximize z = 3xE + 2xI
z – 3xE – 2xI = 0
Include the slack variables
Maximize
Primal Simplex Method
The Reddy Mikks Company
Maximize
z – 3xE – 2xI + 0sI + 0s2 + 0s3 + 0s4 = 0
Later (in the next sub-chapters), the slack and the substitute variables are written as common variables
Maximize
Primal Simplex Method
The Reddy Mikks Company
Incorporate the objective function with the
basic feasible solution
xE and xI : entering variables
sI, s2, s3 ,and s4 : leaving variables
Start the iterations with the values of sI, s2,
s3 ,and s4 = zero
Final Result of the iterations the values of
Primal Simplex Method
Easiness (a commentary)
Each equation has a slack variable
The right hand of all constraints are
Entering Variables in
Maximization and Minimization
Optimality Condition
The entering variable in Maximization is
the non-basic variable with the most
negative coefficient in the z-equation
The optimum of Maximization is reached
when all the non-basic coefficients are
non-negative (or zero)
Entering Variables in
Maximization and Minimization
Optimality Condition
The entering variable in Minimization is the
non-basic variable with the most positive
coefficient in the z-equation
The optimum of Minimization is reached
when all the non-basic coefficients are
non-positive (Zero)
Leaving Variables in
Maximization and Minimization
Feasibility Condition
For both Maximization and Minimization,
the leaving variable is the current basic
variable having the smallest intercept
(minimum ratio with strictly positive
denominator) in the direction of the entering variable
Primal Simplex Method:
The Formal Iterative Steps
Step 0: Using the standard form with all
non-negative right hand sides, determine a starting feasible solution
Step 1: Select an entering variable from
Primal Simplex Method:
The Formal Iterative Steps
Step 2: Select the leaving variable from
the current basic variables using the feasibility condition
Step 3: Determine the value of the new
basic variables by making the entering and the leaving variable non basic
Stop if the optimum solution is achieved;
Primal Simplex Method
The Reddy Mikks Company
Incorporate the objective function with the
basic feasible solution
xE and xI : entering variables
sI, s2, s3 ,and s4 : leaving variables
Start the iterations with the values of sI, s2,
s3 ,and s4 = zero
Final Result of the iterations the values of
Primal Simplex Method
The Reddy Mikks Company
Maximize
z – 3XE – 2XI + 0sI + 0s2 + 0s3 + 0s4 = 0
xE + 2xI + sI = 6 Raw Material A
2xE + xI + s2 = 8 Raw Material B
– xE + xI + s3 = 1 Demand x1 #1
xI + s4= 2 Demand x1 #2
Put all the equation in the Table (Tableau)
Primal Simplex Method:
The Tableau
2 1 0 0 0 1 0 0 s4 1 0 1 0 0 1 -1 0 s3 8 0 0 1 0 1 2 0 s2 6 0 0 0 1 2 1 0 s1 0 0 0 0 0 -2 -3 1 z Inter-cept solution s4 s3 s2 s1 xI xE z BasicGauss – Jordan
1. Pivot Equation
New Pivot Equation (NPE)= Old Pivot Equation : Pivot Element
2. All other equations, including z
New Equation = (Old Equation) – (its
s4 s3
4 0
0 1/2
0 1/2
1 xE
s1 z
solution s4
s3 s2
s1 xI
xE Basic
Pivot Element = 2
4 0 0 1/2 0 1/2 1 NPE 0 0 0 0 0 -2 -3 Z (OLD)
Coefficient xE for z = -3
-12 0 0 -3/2 0 -3/2 -3 -3NPE
-12 0 0 -3/2 0 -3/2 -3 3NPE
s4 s3
4 0
0 1/2
0 1/2
1 xE
s1
12 0
0 3/2
0 -1/2
0 z
solution s4
s3 s2
s1 xI
4 0 0 1/2 0 1/2 1 NPE
Coefficient xE for s1 = 1
4 0 0 1/2 0 1/2 1 1NPE
s1 6 0 0 0 1 2 1 s1 (OLD)
4 0 0 1/2 0 1/2 1 1NPE
4 0 0 1/2 0 1/2 1 NPE
Coefficient xE for S3 = -1
-4 0 0 -1/2 0 -1/2 -1 -1NPE
s3 5 0 1 1/2 0 3/2 0 s3 (NEW) 1 0 1 0 0 1 -1 s3(OLD)
4 0 0 1/2 0 1/2 1 NPE
Coefficient xE for S4 = 0
0 0 0 0 0 0 0 0NPE
2 5 4 2 12 solution 0 1 0 0 1 0 s4 0 1 1/2 0 3/2 0 s3 0 0 1/2 0 1/2 1 xE 0 0 -1/2 1 3/2 0 s1 0 0 3/2 0 -1/2 0 z s4 s3 s2 s1 xI xE Basic
s4 s3 xE
4/3 0
0 -1/3
2/3 1
0 xi
z
solution s4
s3 s2
s1 xI
xE Basic
Pivot Element = 3/2
4/3 0 0 -1/3 2/3 1 0 NPE 12 0 0 3/2 0 -1/2 0 Z (OLD)
Coefficient xI for z = -1/2
-2/3 0 0 1/6 -1/3 -1/2 0 -1/2NPE
s4 s3 xE
4/3 0
0 -1/3
2/3 1
0 xi
12 2/ 3 0
0 4/3
1/3 0
0 z
solution s4
s3 s2
s1 xI
4/3 0 0 -1/3 2/3 1 0 NPE 4 0 0 1/2 0 1/2 1 xE (OLD)
Coefficient xi for x3 = 1/2
-2/3 0 0 -1/6 1/3 1/2 0 1/2NPE
4/3 0 0 -1/3 2/3 1 0 NPE 5 0 1 1/2 0 3/2 0 s3 (OLD)
Coefficient xi for s3 = 3/2
2 0 0 -1/2 1 3/2 0 3/2NPE
s4 3 0 1 1 -1 0 0 s3 10/3 0 0 2/3 -1/3 0 1 xE 4/3 0 0 -1/3 2/3 1 0 xi
4/3 0 0 -1/3 2/3 1 0 NPE 2 0 1 0 0 1 0 s4 (OLD)
Coefficient xi for s4 = 1
4/3 0 0 -1/3 2/3 1 0 1NPE
2/3 0 1 1/3 -2/3 0 0 s4 3 0 1 1 -1 0 0 s3 10/3 0 0 2/3 -1/3 0 1 xE 4/3 0 0 -1/3 2/3 1 0 xi
12 2/ 3 0 0 4/3 1/3 0 0 z solution s4 s3 s2 s1 xI xE Basic
Interpretation of the Simplex
Tableau
Information from the tableau
Optimum Solution
Status of Resources
Dual Prices (Unit worth of resources) and Reduced Cost
Sensitivity of the optimum solution to the changes of in
availability of resources
Interpretation of the Simplex
Tableau: Optimum Solution
2/3 0 1 1/3 -2/3 0 0 s4 3 0 1 1 -1 0 0 s3 10/3 0 0 2/3 -1/3 0 1 xE 4/3 0 0 -1/3 2/3 1 0 xi
Interpretation of the Simplex
Tableau: Optimum Solution
The Reddy Mikks Company
Optimum Solution
x1 = 4/3
x2 = 10/3
Objective Function:
Maximize z = 3XE + 2XI
Interpretation of the Simplex
Tableau: Status of Resources
abundant s > 0
scarce s = 0
Interpretation of the Simplex
Tableau: Status of Resources
2/3 0 1 1/3 -2/3 0 0 s4 3 0 1 1 -1 0 0 s3 10/3 0 0 2/3 -1/3 0 1 xE 4/3 0 0 -1/3 2/3 1 0 xi
Interpretation of the Simplex
Tableau: Status of Resources
abundant Limit of demand for
interior paint s4 = 2/3
scarce Raw material B
s2 = 0
scarce Raw material A
s1 = 0
s3 = 3 Slack Variable
abundant Limit of excess of
interior over exterior paint
Interpretation of the Simplex
Tableau: Status of Resources
Which of the scarce resources should be
given priority in the allocation of additional funds to improve profit most
advantageously?
Compare the dual price of the scarce
Interpretation of the Simplex
Tableau: Dual Price
2/3 0 1 1/3 -2/3 0 0 s4 3 0 1 1 -1 0 0 s3 10/3 0 0 2/3 -1/3 0 1 xE 4/3 0 0 -1/3 2/3 1 0 xi
y4 = 0 Limit of demand
for interior paint s4 = 0
y2 =4/3 thousand dollars per ton of material B
Raw material B s2 = 4/3
y1 = 1/3 thousand dollars per ton of material A
Raw material A s1 = 1/3
s3 = 0 Slack Variable
y3 = 0 Limit of excess of
interior over exterior paint
Dual Price function (y)
Interpretation of the Simplex
Tableau: Maximum Change in
Resource Availability
Maximum Change in Resource Availability
of Resource i = Di
Two Cases:
Di > 0
4/3 2
6 xi
12 2/ 3 12
0 z
2
(Optimum) 1
0
10/3 4
8 xE
Right-Side Element (Solution) in Iteration
Equation
2/3 2
2 s4
3 5
4/3 2
6 xi (raw material A)
12 2/ 3 12
0 z
2
(Optimum) 1
0
10/3 4
8 xE (raw material B)
Right-Side Element (Solution) in Iteration Equation
2/3 2
2 s4 (Demand xI #2)
3 5
4/3 + ? 2 + D1
6 + D1 1 (raw material A)
12 2/
3 + ? 12
0 z
2
(Optimum) 1
0
10/3 + ? 4
8 2 (raw material B)
Right-Side Element (Solution) in Iteration Equation
2/3 + ? 2
2 4 (Demand xI #2)
3 + ? 5
2/3 0 1 1/3 -2/3 0 0 s4 3 0 1 1 -1 0 0 s3 10/3 0 0 2/3 -1/3 0 1 xE 4/3 0 0 -1/3 2/3 1 0 xi
12 2/ 3 0 0 4/3 1/3 0 0 z solution s4 s3 s2 s1 xI xE Basic
Right-Side Element (Solution) in Iteration
Equation
4/3 + 2/3 D1 2/3
1 (raw material A)
12 2/
3 + 1/3 D1 1/3
z
2
(Optimum) s1
10/3 – 1/3 D1 -1/3
2 (raw material B)
2/3 – 2/3D1 -2/3
4 (Demand xI #2)
3 - 1D1 -1
D1 -2 D1 1
Overall
Satisfied D1 1
2/3 – 2/3D1 0
Case
D1 < 0 D1 > 0
D1 3 D1 10 Satisfied
-2 D1 1 3 - 1D1 0
10/3 – 1/3 D1 0 4/3 + 2/3 D1 0
Satisfied Satisfied
-2 D1 1
Any change outside this range (i.e.
decreasing raw material A by more than 2 tons or increasing raw material A by more
Maximum Change in Resource
Availability
-2 D1 1 feasible solution
Any change outside this range (i.e. decreasing raw material A by more than 2 tons or increasing raw material A by more than 1 ton) will lead to
infeasibility and a new set of basic variables (See Chapter of Sensitivity Analysis)
Interpretation of the Simplex
Tableau: Maximum Change in
Marginal Profit/Cost
Changing the coefficients in z-row
Case 1: in accordance with basic variables Case 2: in accordance with non-basic
variables
Maximum change in marginal profit/cost =
di
For example
Interpretation of the Simplex
Tableau: Maximum Change in
Marginal Profit/Cost
2/3 0 1 1/3 -2/3 0 0 s4 3 0 1 1 -1 0 0 s3 10/3 0 0 2/3 -1/3 0 1 xE 4/3 0 0 -1/3 2/3 1 0 xi2/3 0 1 1/3 -2/3 0 0 s4 3 0 1 1 -1 0 0 s3 10/3 0 0 2/3 -1/3 0 1 xE 4/3 0 0 -1/3 2/3 1 0 xi
12 2/
3+10/3 d1 0
0 4/3+2/3 d1
1/3 - 1/3d1 0 0 z solution s4 s3 s2 s1 xI xE Basic
Case 1 : Basic Variables
Objective Function: z = 3xE – 2xI Coefficient xE = cE =3
1/3 – 1/3 d1 0 d1 1
4/3 + 2/3 d1 0 d1 –2
1 cE 4
Current optimum remains unchanged for the range of cE [1. 4]
The value of z will change according to the expression: 12 2/
Case 2: Non - Basic Variables
Changes in their original objective
coefficients can only affect only their z-equation coefficient and nothing else
Corresponding column is not pivoted
In general, the change di of the original
objective of a non-basic variable always results in decreasing the objective
Maximize z = 5xE + 2xI
Objective Function
Maximize z = 5xE + 2xI
cI = 2 cI = 2 + d2
Coefficient xI
1/2 – d2 0 d2 1/2
cI 2 + 1/2
2 1 0 0 0 1 0 s4 5 0 1 1/2 0 3/2 0 s3 4 0 0 1/2 0 1/2 1 xE 2 0 0 -1/2 1 3/2 0 s1 20 0 0 5/2 0 1/2 0 z solution s4 s3 s2 s1 xI xE Basic
Maximize z = 5xE + 2xI Optimum
Solution Reduced
Interpretation of the Simplex
Tableau: Reduced Cost
Reduced Cost = the optimum objective
coefficients of the non-basic variables
Reduced Cost = net rate of decrease in
the optimum objective value resulting from increasing of the associated non-basic
Interpretation of the Simplex
Tableau: Reduced Cost
Reduced Cost = cost of resources to
produce per unit (xi) input – its revenue
per unit output
Reduced Cost > 0 cost > revenue
No economic advantage in producing the output
Reduced cost < 0 cost < revenue
Interpretation of the Simplex
Tableau: Reduced Cost
2 1 0 0 0 1 0 s4 5 0 1 1/2 0 3/2 0 s3 4 0 0 1/2 0 1/2 1 xE 2 0 0 -1/2 1 3/2 0 s1 20 0 0 5/2 0 1/2 0 z solution s4 s3 s2 s1 xI xE Basic
Maximize z = 5xE + 2xI
Optimum Solution Reduced
Interpretation of the Simplex
Tableau: Reduced Cost
Optimum objective function
Interpretation of the Simplex
Tableau: Reduced Cost
Reduced Cost = the optimum objective
coefficients of the non-basic variables
Reduced Cost = net rate of decrease in
the optimum objective value resulting from increasing of the associated non-basic
Interpretation of the Simplex
Tableau: Reduced Cost
Reduced Cost = cost of resources to
produce per unit (xi) input – its revenue
per unit output
Reduced Cost > 0 cost > revenue
No economic advantage in producing the output
Reduced cost < 0 cost < revenue
Interpretation of the Simplex
Tableau: Reduced Cost
2 1 0 0 0 1 0 s4 5 0 1 1/2 0 3/2 0 s3 4 0 0 1/2 0 1/2 1 xE 2 0 0 -1/2 1 3/2 0 s1 20 0 0 5/2 0 1/2 0 z solution s4 s3 s2 s1 xI xE Basic
Maximize z = 5xE + 2xI
Optimum Solution Reduced
Interpretation of the Simplex
Tableau: Reduced Cost
Optimum objective function
Interpretation of the Simplex
Tableau: Reduced Cost
Unused economic activity = non-basic variable can become economically viable in two ways: (Logically)
#1 by decreasing its per unit use of the resource #2 by increasing its per unit revenue (through
price increase)
Combination of the two ways
#1 is more viable than #2 since #1 is in accordance with efficiency