Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
145 views

(1d) Linear Programming - Simplex Method

The document provides an overview of the simplex method for solving linear programming problems. It explains that the simplex method algebraically determines the corner points of the feasible region and moves the solution from one corner point to an adjacent better point until no further improvements can be made. The steps of the simplex method are outlined, including determining an initial basic feasible solution, selecting entering and leaving variables, and performing Gauss-Jordan computations to determine new basic solutions. An example problem is presented to demonstrate how the simplex method is applied in practice through iterations.

Uploaded by

Dennis Nava
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views

(1d) Linear Programming - Simplex Method

The document provides an overview of the simplex method for solving linear programming problems. It explains that the simplex method algebraically determines the corner points of the feasible region and moves the solution from one corner point to an adjacent better point until no further improvements can be made. The steps of the simplex method are outlined, including determining an initial basic feasible solution, selecting entering and leaving variables, and performing Gauss-Jordan computations to determine new basic solutions. An example problem is presented to demonstrate how the simplex method is applied in practice through iterations.

Uploaded by

Dennis Nava
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

LINEAR

PROGRAMMING:
Simplex Method

ENGR. YOSHIKI B. KURATA, CIE, AAE, MSc.IE


Course Instructor

Reference:

Introduction to Operations Research (7th Edition)


By F. Hillier & H. Lieberman
McGraw Hill Higher Education
Introduction
◼ The graphical method shows that the optimal solution of an LP is
always associated with a corner point of the feasible region. This
result is a key to the development of the simplex method.

◼ In simplex method, the corner points of the feasible region are


determined algebraically.

◼ The procedure moves the solution from one corner point to a


better adjacent corner point. When no further improvements can
be realized, the process stops.

◼ The simplex method is the most widely used algorithm in solving


linear programming problems.
Sample Simplex Tableau
Basic Variables (excluding z) Right Hand Side

Non Basic Variables Slack Variables


LP in Standard Form
Simplex algorithm requires that the following conditions must be
satisfied:

1. All functional constraints are equations each having non-


negative right hand side.

2. All basic variables are non-negative.


LP in Standard Form
◼ Case 1
– In ≤ constraints, the right hand side (RHS) can be interpreted
as representing the limit on the availability of a resource, in
which cases, the left hand side (LHS) would represent the
usage of this limited resource by the activities of the model.
The difference between the RHS and the LHS thus yields the
slack of the resource.

Consider the constraint for a resource,


6X1 + 4X2 ≤ 24
Define S1 as the slack for the resource.
The constraint is transformed to the following equation:
6X1 + 4X2 + S1 = 24
LP in Standard Form
◼ Case 2
– A ≥ constraint usually sets a lower limit on the activities of the
LP model. As such, an amount by which the LHS exceeds the
minimum limit represents a surplus.

Consider the constraint,


X1 + X2 ≥ 800
Define S1 as the surplus variable.
The constraint is transformed to the following equation:
X1 + X2 – S1 = 800
LP in Standard Form
◼ Case 3
– Constraints with negative RHS can be transformed into a
standard form by multiplying the entire constraint to (-1).

Example:
-X1 + X2 ≤ -3
X1 - X2 ≥ 3
X1 - X2 – S1 = 3

Standard Simplex Form Constraint

Original Constraint Transformed Constraint


Simplex Method
STEPS IN THE SIMPLEX METHOD:

1. Determine a starting basic feasible solution.

2. Select an entering variable using the optimality condition.


Stop if there is no entering variable. The last solution
reached is optimal.

3. Select a leaving variable using the feasibility condition.

4. Determine the new basic solution by using the appropriate


Gauss Jordan computations.
Simplex Method
Example:

Solve the following LP using the simplex method:

Maximize Z = 5X1 + 4X2

Subject to: 6X1 + 4X2 ≤ 24


X1 + 2X2 ≤ 6
-X1 + X2 ≤ 1
X2 ≤ 2
X1, X2 ≥ 0
Simplex Method
Example:

Writing the LP in standard form, we get:

Maximize Z = 5X1 + 4X2 + 0S1 + 0S2 + 0S3 + 0S4

Subject to: 6X1 + 4X2 + S1 = 24


X1 + 2X2 + S2 =6
-X1 + X2 + S3 =1
X2 + S4 =2
X1, X2, S1, S2, S3, S4 ≥ 0
Simplex Method
Example:

Writing the LP simplex in standard form, we get:

Z - 5X1 - 4X2 + 0S1 + 0S2 + 0S3 + 0S4 = 0

Subject to: 6X1 + 4X2 + S1 = 24


X1 + 2X2 + S2 =6
-X1 + X2 + S3 =1
X2 + S4 =2
X1, X2, S1, S2, S3, S4 ≥ 0
Simplex Method
◼ Initial Tableau
– Based from the LP Simplex Model

Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 -5 -4 0 0 0 0 0
S1 0 6 4 1 0 0 0 24
S2 0 1 2 0 1 0 0 6
S3 0 -1 1 0 0 1 0 1
S4 0 0 1 0 0 0 1 2
Optimality Condition
◼ The entering variable defines the optimality condition of the
simplex tableau. Hence, it is the column of the most negative
(maximization problem) and most positive (minimization problem)
of the non basic variables (x1, x2, … , xn; excluding z)

◼ The entering variable in a maximization (minimization) problem is


the non-basic variable having a most negative (most positive)
coefficient in the z-row.

◼ The optimum is reached at the iteration where all the z-row


coefficients of the non basic variables are non-negative (non-
positive).
Simplex Method
Entering Variable/s

Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 -5 -4 0 0 0 0 0
S1 0 6 4 1 0 0 0 24
S2 0 1 2 0 1 0 0 6
S3 0 -1 1 0 0 1 0 1
S4 0 0 1 0 0 0 1 2
Feasibility Condition
◼ The leaving variable defines the feasibility condition of the simplex
tableau. Hence, it is the row of the smallest non-negative ratio of
the basic variables (s1, s2, … , sn; excluding z)

𝑹𝑯𝑺
𝑹𝒂𝒕𝒊𝒐 =
𝑬𝒏𝒕𝒆𝒓𝒊𝒏𝒈 𝑽𝒂𝒓𝒊𝒂𝒃𝒍𝒆

◼ For both the maximization and minimization problems, the leaving


variable is the basic variable associated with the smallest
non-negative ratio with strictly positive denominator. Ties (if
ever) are broken arbitrarily.
Simplex Model

Basic Z X1 X2 S1 S2 S3 S4 RHS Ratio


Z 1 -5 -4 0 0 0 0 0 0
S1 0 6 4 1 0 0 0 24 24/6 = 4
S2 0 1 2 0 1 0 0 6 6/1 = 6
S3 0 -1 1 0 0 1 0 1 --
S4 0 0 1 0 0 0 1 2 --

Leaving Variable/s
Simplex Method
◼ Iteration 0 (Initial Tableau)

Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 -5 -4 0 0 0 0 0
S1 0 6 4 1 0 0 0 24
S2 0 1 2 0 1 0 0 6
S3 0 -1 1 0 0 1 0 1
S4 0 0 1 0 0 0 1 2
Simplex Method
◼ Divide the entire S1 row by the coefficient of X1.
Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 -5 -4 0 0 0 0 0
S1 0 6 4 1 0 0 0 24
S2 0 1 2 0 1 0 0 6
S3 0 -1 1 0 0 1 0 1
S4 0 0 1 0 0 0 1 2

Basic Z X1 X2 S1 S2 S3 S4 RHS
X1 0 1 2/3 1/6 0 0 0 4
Simplex Method
◼ Perform Gauss-Jordan operations to eliminate X1 from all other
rows.

Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 -5 -4 0 0 0 0 0
X1 0 1 2/3 1/6 0 0 0 4
S2 0 1 2 0 1 0 0 6
S3 0 -1 1 0 0 1 0 1
S4 0 0 1 0 0 0 1 2

New z-row = Current row – (Entering variable) x New pivot row


Simplex Method
◼ Iteration 1
Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 0 -2/3 5/6 0 0 0 20
X1 0 1 2/3 1/6 0 0 0 4
S2 0 1 2 0 1 0 0 6
S3 0 -1 1 0 0 1 0 1
S4 0 0 1 0 0 0 1 2

New S2-row = Current row – (Entering variable) x New pivot row


Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 0 -2/3 5/6 0 0 0 20
X1 0 1 2/3 1/6 0 0 0 4
S2 0 0 4/3 -1/6 1 0 0 2
S3 0 -1 1 0 0 1 0 1
S4 0 0 1 0 0 0 1 2
Simplex Method
◼ Iteration 1
Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 0 -2/3 5/6 0 0 0 20
X1 0 1 2/3 1/6 0 0 0 4
S2 0 0 4/3 -1/6 1 0 0 2
S3 0 0 5/3 1/6 0 1 0 5
S4 0 0 1 0 0 0 1 2

Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 0 -2/3 5/6 0 0 0 20
X1 0 1 2/3 1/6 0 0 0 4
S2 0 0 4/3 -1/6 1 0 0 2
S3 0 0 5/3 1/6 0 1 0 5
S4 0 0 1 0 0 0 1 2
Simplex Method
◼ Final Iteration 1

Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 0 -2/3 5/6 0 0 0 20
X1 0 1 2/3 1/6 0 0 0 4
S2 0 0 4/3 -1/6 1 0 0 2
S3 0 0 5/3 1/6 0 1 0 5
S4 0 0 1 0 0 0 1 2
Simplex Method
◼ Iteration 2
New Entering Variable/s

Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 0 -2/3 5/6 0 0 0 20
X1 0 1 2/3 1/6 0 0 0 4
S2 0 0 4/3 -1/6 1 0 0 2
S3 0 0 5/3 1/6 0 1 0 5
S4 0 0 1 0 0 0 1 2
Simplex Method
◼ Iteration 2
New Entering Variable/s

Basic Z X1 X2 S1 S2 S3 S4 RHS Ratio


Z 1 0 -2/3 5/6 0 0 0 20 0
X1 0 1 2/3 1/6 0 0 0 4 4/(2/3) = 6
X2 0 0 4/3 -1/6 1 0 0 2 2/(4/3) = 1.5
S3 0 0 5/3 1/6 0 1 0 5 5/(5/3) = 3
S4 0 0 1 0 0 0 1 2 2/1 = 2

New Leaving Variable/s


Simplex Method
◼ Final Iteration 2

Basic Z X1 X2 S1 S2 S3 S4 RHS
Z 1 0 0 3/4 1/2 0 0 21
X1 0 1 0 1/4 -1/2 0 0 3
X2 0 0 1 -1/8 3/4 0 0 3/2
S3 0 0 0 3/8 -5/4 1 0 5/2
S4 0 0 0 1/8 -3/4 0 1 1/2

No entering variable.
Solution is considered optimal.
Simplex Method
◼ The optimal solution is given by:

𝑿𝟏 = 𝟑
𝟑
𝑿𝟐 =
𝟐
𝑺𝟏 = 𝟎
𝑺𝟐 = 𝟎
𝟓
𝑺𝟑 =
𝟐
𝟏
𝑺𝟒 =
𝟐

𝑴𝒂𝒙𝒊𝒎𝒖𝒎 𝒁 = 𝟐𝟏
Basic Concepts
◼ If the value of a variable is positive in the basic solution, then that
variable is a basic variable. Otherwise, it is a non-basic variable.

◼ The simplex method increases the value of the entering variable


up to the minimum ratio. The value of the leaving basic variable
simultaneously decreases down to 0, where it becomes non-basic
at the next iteration.

◼ If the LP has m constraints and n variables, any solution to the LP


having m basic variables (therefore m-n non-basic variables) is
called basic solution. The basic solution may be feasible or
infeasible.
Basic Concepts
◼ The simplex method moves the solution from one feasible corner-
point to an adjacent feasible corner point that has a better
objective function value than the current.

◼ At every iteration, the simplex method solves a new set of


equations simultaneously. The number of equations corresponds
to the number of constraints. The number of unknown variables
must be equal to the number of equations. This is why at any
basic solution, the number of basic variables must be equal to
the number of constraints.

◼ The constraints whose LHS equals RHS at optimum are called


binding constraints. The constraint boundaries of binding
constraints intersects at the optimal corner point.
Exercise
◼ Use simplex method to identify the optimal solution(s) to the
following LP model:

Maximize Z = 2X1 + X2 - 3X3 + 5X4

Subject to: X1 + 2X2 - 2X3 + 4X4 ≤ 40


2X1 - X2 + X3 + 2X4 ≤ 8
4X1 - 2X2 + X3 - X4 ≤ 10
X1, X2 , X3, X4 ≥ 0
Exercise
◼ Iteration 0 (Initial Tableau)

Basic Z X1 X2 X3 X4 S1 S2 S3 RHS
Z 1 -2 -1 3 -5 0 0 0 0
S1 0 1 2 -2 4 1 0 0 40
S2 0 2 -1 1 2 0 1 0 8
S3 0 4 -2 1 -1 0 0 1 10
Exercise
◼ Iteration 1
Basic Z X1 X2 X3 X4 S1 S2 S3 RHS
Z 1 3 -7/12 11/2 0 0 5/2 0 20
S1 0 -3 4 -4 0 1 -2 0 24
X4 0 1 -1/2 1/2 1 0 1/2 0 4
S3 0 5 -5/12 3/2 0 0 1/2 1 14

◼ Iteration 2

Basic Z X1 X2 X3 X4 S1 S2 S3 RHS
Z 1 3/8 0 2 0 7/8 3/4 0 41
X2 0 -3/4 1 -1 0 1/4 -1/2 0 6
X4 0 5/8 0 0 1 1/8 1/4 0 7
S3 0 25/8 0 -1 0 5/8 -3/4 1 29
Exercise
◼ Final Optimal Iteration (Iteration 2)
Basic Z X1 X2 X3 X4 S1 S2 S3 RHS
Z 1 3/8 0 2 0 7/8 3/4 0 41
X2 0 -3/4 1 -1 0 1/4 -1/2 0 6
X4 0 5/8 0 0 1 1/8 1/4 0 7
S3 0 25/8 0 -1 0 5/8 -3/4 1 29

◼ Optimal Answers:

X1 = 0 S1 = 0
X2 = 6 S2 = 0
X3 = 0 S3 = 29
X4 = 7 S4 = 0
Z = 41

You might also like