0% found this document useful (0 votes)
37 views32 pages

OR - 3rd Meeting For Upload

The document provides an introduction to the simplex method for solving linear programming problems. It describes how the simplex method uses a geometric viewpoint to iteratively move between corner point feasible solutions of the problem's feasible region to find an optimal solution. It explains the key concepts behind the simplex method, including focusing on corner point solutions, performing iterations of moving to an adjacent better solution or determining optimality, and translating the geometric procedure into an algebraic procedure using slack variables.

Uploaded by

kurniashk13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views32 pages

OR - 3rd Meeting For Upload

The document provides an introduction to the simplex method for solving linear programming problems. It describes how the simplex method uses a geometric viewpoint to iteratively move between corner point feasible solutions of the problem's feasible region to find an optimal solution. It explains the key concepts behind the simplex method, including focusing on corner point solutions, performing iterations of moving to an adjacent better solution or determining optimality, and translating the geometric procedure into an algebraic procedure using slack variables.

Uploaded by

kurniashk13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Operations Research 1:

Introduction to the Simplex Method

M. Mujiya Ulkhaq, Ph.D.


Department of Industrial Engineering
Diponegoro University, Semarang, Indonesia For undergraduate (bachelor) level,
E-mail: [email protected] Department of Industrial Engineering,
Homepage: https://sites.google.com/view/mujiyaulkhaq/ Diponegoro University, Indonesia
Introduction
• The simplex method is a general procedure for solving the linear
programming problems.
• Developed by George Dantzig in 1947, it has proved to be a
remarkably efficient method that is used routinely to solve huge
problems on today’s computers.
• Except for its use on tiny problems, this method is always executed
on a computer, and software packages are widely available.
• Extensions and variations of the simplex method also are used to
perform post-optimality analysis (including sensitivity analysis) on
the model.
• The simplex method is an algebraic procedure. However, its George Bernard Dantzig1 (1914-2005)
underlying concepts are geometric. Understanding these geometric
concepts provides a strong intuitive feeling for how the simplex
method operates and what makes it so efficient.

1
George Dantzig is commonly referred to as the father of linear programming because of the development of the simplex method and many key subsequent contributions.
Dr. Dantzig remained professionally active right up until he passed away in 2005 at the age of 90.

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 2


The Geometric Viewpoint
• To illustrate the general geometric concepts, we shall use the
previous Wyndor Glass Co. example.
o Consider five constraint boundaries (which is lines) and their
points of intersection (called corner-point solutions).
o The five that lie on the corners of the feasible region, i.e., (0, 0),
(0, 6), (2, 6), (4, 3), and (4, 0), are the corner-point feasible
solutions (CPF solutions).
o The other three, i.e., (0, 9), (4, 6), and (6, 0), are called corner-
point infeasible solutions.
• Generally, for a linear programming problem with n decision
variables, each of its corner-point solutions lies at the
intersection of n constraint boundaries.
o In this example, each corner-point solution lies at the intersection
of two constraint boundaries.

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 3


The Geometric Viewpoint (2)
• For any linear programming problem with n decision variables,
two CPF solutions are adjacent to each other if they share n – 1
constraint boundaries. The two adjacent CPF solutions are
connected by a line segment that lies on these same shared
constraint boundaries. Such a line segment is referred to as an
edge of the feasible region.
o Since n = 2 in this example, two of its CPF solutions are adjacent
if they share one constraint boundary; for example, (0,0) and (0,6)
are adjacent because they share the x1 = 0 constraint boundary.
o Thus, each CPF solution has two adjacent CPF solutions (each
lying at the other end of one of the two edges)

CPF Solution Its Adjacent CPF Solution


(0, 0) (0, 6) and (4, 0)
(0, 6) (2, 6) and (0, 0)
(2, 6) (4, 3) and (0, 6)
(4, 3) (4, 0) and (2, 6)
(4, 0) (0, 0) and (4, 3)

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 4


The Geometric Viewpoint (3)
Optimality test:
Consider any linear programming problem that possesses at
least one optimal solution. If a CPF solution has no adjacent CPF
solutions that are better (as measured by Z), then it must be an
optimal solution.
o Thus, for the example, (2, 6) must be optimal simply because its
Z = 36 is larger than Z = 30 for (0, 6) and Z = 27 for (4, 3).
o This optimality test is the one used by the simplex method for
determining when an optimal solution has been reached.

CPF Solution Z
(0, 0) 0
(0, 6) 30
(2, 6) 36
(4, 3) 27
(4, 0) 12

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 5


Solving the Example Geometrically
• Initialization: Choose (0, 0) as the initial CPF solution to
examine. (This is a convenient choice because no calculations
are required to identify this CPF solution.)
• Optimality test: (0, 0) is not an optimal solution. Adjacent
CPF solutions: (0, 6) and (4, 0) are better.
• Iteration 1: Move to a better adjacent CPF solution: (0, 6), by
performing the following three steps.
1. Considering the two edges of the feasible region that emanate
from (0, 0), choose to move along the edge that leads up the x2
axis. With an objective function of Z = 3x1 + 5x2, moving up the
x2 axis increases Z at a faster rate than moving along the x1 axis.
2. Stop at the first new constraint boundary: 2x2 = 12. Moving
farther in the direction selected in Step 1 leaves the feasible
region; e.g., moving to the second new constraint boundary hit
when moving in that direction gives (0, 9), which is a corner-
point infeasible solution.
3. Solve for the intersection of the new set of constraint boundaries:
(0, 6).

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 6


Solving the Example Geometrically (2)
• Optimality test: (0, 6) is not an optimal solution. An adjacent
CPF solution: (2, 6) is better.
• Iteration 2: Move to a better adjacent CPF solution: (2,6), by
performing the following three steps.
1. Considering the two edges of the feasible region that emanate
from (0, 6), choose to move along the edge that leads to the right.
(Moving along this edge increases Z, whereas backtracking to
move back down the x2 axis decreases Z.)
2. Stop at the first new constraint boundary encountered when
moving in that direction: 3x1 + 2x2 = 12. (Moving farther in the
direction selected in Step 1 leaves the feasible region.)
3. Solve for the intersection of the new set of constraint boundaries:
(2, 6).
• Optimality test: (2, 6) is an optimal solution, so stop. None of
the adjacent CPF solutions are better.

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 7


The Key Solution Concepts
• Solution concept 1: The simplex method focuses solely on CPF solutions. For any problem with at least one
optimal solution, finding one requires only finding a best CPF solution.
• Solution concept 2: The simplex method is an
iterative algorithm with the following structure:

• Solution concept 3: Whenever possible, the initialization of the simplex method chooses the origin (all decision
variables equal to zero) to be the initial CPF solution.
• Solution concept 4: Given a CPF solution, it is much quicker computationally to gather information about its
adjacent CPF solutions than about other CPF solutions.
• Solution concept 5: After the current CPF solution is identified, the simplex method examines each of the edges
of the feasible region that emanate from this CPF solution. Among the edges with a positive rate of improvement
in Z, it then chooses to move along the one with the largest rate of improvement in Z.
• Solution concept 6: The optimality test consists simply of checking whether any of the edges give a positive rate
of improvement in Z. If none do, then the current CPF solution is optimal.

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 8


The Algebra of the Simplex Method
Since the Simplex method normally is run on a computer, which can follow only algebraic instructions, it is
necessary to translate the conceptually geometric procedure into a usable algebraic procedure.
The first step in setting up the simplex method is to convert the functional inequality constraints to
equivalent equality constraints. (The nonnegativity constraints are left as inequalities because they are treated
separately.) This conversion is accomplished by introducing slack variables.
o Consider the first functional constraint in the Wyndor Glass Co. example:
x1 ≤ 4 ➔ x1 + s1 = 4, where s1 is the slack variable for the first constraint
Given this equation, x1 ≤ 4 if and only if 4 – x1 = s1 ≥ 0. Therefore, x1 ≤ 4 is equivalent to: x1 + s1 = 4 and s1 ≥ 0.
Upon the introduction of slack variables for the other functional constraints, the original linear programming model for
the example can now be replaced by the equivalent model (called the augmented form of the model).
Maximize Z = 3x1 + 5x2 Maximize Z = 3x1 + 5x2 + 0s1 + 0s2 + 0s3
Original LP model

Augmented form
subject to subject to
(1) x1 ≤4 (1) x1 + s1 =4
(2) 2x2 ≤ 12 (2) 2x2 + s2 = 12
(3) 3x1 + 2x2 ≤ 18 (3) 3x1 + 2x2 + s3 = 18
and x1, x2 ≥ 0 and x1, x2, s1, s2, s3 ≥ 0

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 9


The Algebra of the Simplex Method (2)
• Initialization: Choose x1 and x2 to be the non-basic variables for the initial basic feasible (BF) solution
(see Solution concept 3). The other variables, i.e., the basic variables would be s1, s2, and s3.
The non-basic variable is the variable that is set equal to zero.
How many non-basic variables would be? It is equal to the number of degree of freedom.
The number of degree of freedom is Number of variables – Number of equations
In the previous example, the degree of freedom = 5 – 3 = 2.
It means that any two variables can be chosen to be set equal to any arbitrary value in order to
solve the three equations in terms of the remaining three variables.2

For the Wyndor Glass Co. example, if x1 and x2 = 0, so:


(1) x1 + s1 =4 (1) s1 = 4
(2) 2x2 + s2 = 12 (2) s2 = 12
(3) 3x1 + 2x2 + s3 = 18 (3) s3 = 18

The initial BF solution is: (x1, x2, s1, s2, s3) = (0, 0, 4, 12, 18) with Z = 0.

2Thismethod of determining the number of degrees of freedom for a system of equations is valid as long as the system does not include any redundant equations.
This condition always holds for the system of equations formed from the functional constraints in the augmented form of a linear programming model.

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 10


The Algebra of the Simplex Method (3)
• Optimality test:
The augmented objective function is: Z = 3x1 + 5x2 + 0s1 + 0s2 + 0s3.
For the initial BF solution, Z = 0.
Because none of the basic variables (s1, s2, and s3) have a non-zero coefficient in this objective function, the coefficient of
each non-basic variable (x1, x2) gives the rate of improvement (x1 = 3, x2 = 5) in Z if that variable were to be increased from
zero. These rates of improvement (3 and 5) are positive. Therefore, based on Solution concept 6, we conclude that (0, 0, 4, 12,
18) is not optimal.
• Iteration 1: Determining the direction of movement
The purpose of this step is to choose one non-basic variable to increase the value of Z.
In the example, it is to choose x1 or x2 so that the value of Z will increase to 0.
So, where is the direction of movement?

Z = 3x1 + 5x2 + 0s1 + 0s2 + 0s3


Increase x1 by one will increase Z by 3 Since 5 > 3, so choose x2 as the entering basic variable
Increase x2 by one will increase Z by 5

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 11


The Algebra of the Simplex Method (4)
• Iteration 1: Determining where to stop
The purpose of this step is to addresses the question of how far to increase the entering basic variable x2 before
stopping. Increasing x2 increases Z, so we want to go as far as possible without leaving the feasible region.
(a) The requirement to satisfy the functional constraints in augmented form means that increasing x2 (while keeping the non-
basic variable x1 = 0) changes the values of some of the basic variables.
(b) The other requirement for feasibility is that all the variables be non-negative. The non-basic variables (including the
entering basic variable) are nonnegative, but we need to check how far x2 can be increased without violating the
nonnegativity constraints for the basic variables.

(1) x1 + s1 =4 (a) (1) s1 = 4 Step (b) is called the minimum ratio test.
The objective is to determine which basic variable
(2) 2x2 + s2 = 12 (2) s2 = 12 – 2x2 drops to zero first as the entering basic variable
(3) 3x1 + 2x2 + s3 = 18 (3) s3 = 18 – 2x2 is increased.
s2 is then the leaving basic variable.

(b)
(1) s1 = 4 ≥ 0 ⇒ no upper bound on x2
(2) s2 = 12 – 2x2 ≥ 0 ⇒ x2 ≤ (12/2) = 6 ← minimum
(3) s3 = 18 – 2x2 ≥ 0 ⇒ x2 ≤ (18/2) = 9

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 12


The Algebra of the Simplex Method (5)
• Iteration 1: Solving for the new basic feasible solution
The purpose of this step is to convert the system of equations to a more convenient form (of Gaussian
elimination) for conducting the optimality test and (if needed) the next iteration with this new BF solution.
The previous steps yield: (x1, s2) as the non-basic variable; (x2, s1, s3) as the basic variable.
↓ ↓
x1 = s2 = 0 x2 = 6; s1 = ?; s3 = ?

(0) Z – 3x1 – 5x2 – 0s1 – 0s2 – 0s3 = 0 r*(2) = r(2)/2 (0) Z – 3x1 + 5/2 s2 – 0s3 = 30
(1) x1 + s1 =4 (1) x1 + s1 =4
(2) 2x2 + s2 = 12 r*(0) = r(0) + 5r*(2) (2) x2 + ½ s2 =6
(3) 3x1 + 2x2 + s3 = 18 r*(3) = r(3) – 2r*(2) (3) 3x1 – s2 + s3 = 6

(1) s1 = 4 – x1 ⇔ s1 = 4
Solving with Gaussian elimination
(3) s3 = 6 – 3x1 – s2 ⇔ s3 = 6

The new BF solution is: (x1, x2, s1, s2, s3) = (0, 6, 4, 0, 6) with Z = 30.

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 13


The Algebra of the Simplex Method (6)
• Optimality test:
The augmented objective function is now: Z = 30 + 3x1– 5/2 s2.
One non-basic variable (x1) has a non-zero coefficient in this objective function (the other is negative, i.e., s2).
The coefficient of this variable gives the positive rate of improvement (i.e., 3) in Z if this variable were to be increased from
zero. Therefore, based on Solution concept 6, we conclude that (0, 6, 4, 0, 6) is not optimal.
• Iteration 2:
Determining the direction of movement
Among non-basic variables, only x1 gives the positive rate of improvement, so x1 is the entering basic variable.
Determining where to stop
The minimum-test ratio:
(1) x1 + s1 =4 (1) s1 = 4 – x1 ≥ 0 ⇒ x1 ≤ (4/1) = 4
(2) x2 + ½ s2 =6 (2) s2 = 12 – 2x2 ≥ 0 ⇒ no upper bound on x1
(3) 3x1 – s2 + s3 =6 (3) s3 = 6 – 3x1 + s2 ≥ 0 ⇒ x1 ≤ (6/3) = 2 ← minimum
s3 is then the leaving basic variable

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 14


The Algebra of the Simplex Method (7)
• Iteration 2: Solving for the new basic feasible solution
The previous steps yield: (s3, s2) as the non-basic variable; (x2, s1, x1) as the basic variable.
↓ ↓
s3 = s2 = 0 x2 = ?; s1 = ?; x1 = 2

(0) Z – 3x1 + 5/2 s2 – 0s3 = 30 r*(3) = r(3)/3 (0) Z + 3/2 s2 + s3 = 36


(1) x1 + s1 =4 (1) s1 + 1/3 s2 – 1/3 s3 = 2
(2) x2 + ½ s2 =6 r*(1) = r(1) – r*(3) (2) x2 + ½ s2 =6
(3) 3x1 – s2 + s3 =6 r*(0) = r(0) + 3r*(3) (3) x1 – 1/3 s2 + 1/3 s3 = 2

(1) s1 = 2 – 1/3 s2 + 1/3 s3 ⇔ s1 = 2


Solving with Gaussian elimination
(2) x2 = 6 – ½ s2 ⇔ x2 = 6

The new BF solution is: (x1, x2, s1, s2, s3) = (2, 6, 2, 0, 0) with Z = 36.

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 15


The Algebra of the Simplex Method (8)
• Optimality test:
The augmented objective function is now: Z = 36 – 3/2 s2 – s3.
All non-basic variable (s2 and s3) have non-positive coefficient in this objective function.
Increasing either s2 or s3 would decrease (or give the negative rate of improvement) Z, therefore, based on
Solution concept 6, the current BF solution must be optimal.
In terms of the original form of the problem (no slack variables), the optimal solution is: x1 = 2, x2 = 6,
which yields Z = 3x1 + 5x2 = 36.

A basic solution has the following properties:


§ Each variable is designated as either a non-basic variable or a basic variable.
§ The number of basic variables equals the number of functional constraints (or just equations).
§ The number of non-basic variables equals the total number of variables minus the number of
functional constraints (or the degree of freedom).
§ The non-basic variables are set equal to zero.
§ The values of the basic variables are obtained as the simultaneous solution of the system of
equations (functional constraints in augmented form). (The set of basic variables is often
referred to as the basis.)
§ If the basic variables satisfy the nonnegativity constraints, the basic solution is a BF solution.

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 16


Geometric and Algebraic Interpretation
Geometric and algebraic interpretations
of how the simplex method solves the
Wyndor Glass Co. problem

(s1, s2, or s3) (s2)


s2

(x2, s1, or s3) (s3)


s3

(s2 or s3)

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 17


The Simplex Method in Tabular Form
• The tabular form of the simplex method records only the essential information:
• the coefficients of the variables,
• the constants on the right-hand sides of the equations, and The tabular form of the
simplex method uses a
• the basic variable appearing in each equation. simplex tableau

• Initial system of equations for the Wyndor Glass Co. problem:


• All variables not listed in the
basic variable column
automatically are non-basic
variables
s1 s2 s3
• After we set x1 = 0, x2 = 0,
the right-side column gives the
s1 s1 resulting solution for the basic
s2 s2 variables, so that the initial BF
s3 s3 solution is (x1, x2, s1, s2, s3) =
(0, 0, 4, 12, 18) which yields
Z = 0.
The simplex tableau

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 18


The Simplex Method in Tabular Form (2)
• Initialization:
Select the decision variables to be the initial non-basic variables (set equal to zero) and the slack variables to be
the initial basic variables.
• Optimality test:
The current BF solution is optimal if and only if every coefficient in row 0 (Eq. (0)) is nonnegative (≥ 0).
If it is, stop; otherwise, go to an iteration to obtain the next BF solution, which involves changing one non-basic
variable to a basic variable (Step 1) and vice versa (Step 2) and then solving for the new solution (Step 3).
negative, so it is not optimal
Maximize Z – 3x1 – 5x2 – 0s1 – 0s2 – 0s3 = 0
subject to s1 s2 s3
(1) x1 + s1 =4
(2) 2x2 + s2 = 12 s1
(3) 3x1 + 2x2 + s3 = 18 s2
and x1, x2, s1, s2, s3 ≥ 0 s3

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 19


The Simplex Method in Tabular Form (3)
• Iteration 1:
Step 1: Determine the entering basic variable by selecting the non-basic variable with the negative coefficient
having the largest absolute value (i.e., the “most negative” coefficient) in Eq. (0).
Put a box around the column below this coefficient, and call this the pivot column.
Step 2: Determine the leaving basic variable by applying the minimum ratio test. Minimum Ratio Test
Put a box around this row and call it the pivot row. 1. Pick out each coefficient in the
pivot column that is strictly
Also call the number that is in both boxes the pivot number. positive (> 0).
2. Divide each of these coeffi-
cients into the right-side entry
for the same row.
s1 s2 s3
3. Identify the row that has the
smallest of these ratios.
s1 4. The basic variable for that row
is the leaving basic variable,
s2 so replace that variable by the
entering basic variable in the
s3 basic variable column of the
next simplex tableau.
leaving basic variable entering basic variable
M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 20
The Simplex Method in Tabular Form (4)
• Iteration 1:
Step 3: Solve for the new BF solution by using elementary row operations to construct a new simplex tableau
in proper form from Gaussian elimination below the current one.
• Divide the pivot row by the pivot
number.
s1 s2 s3 • For each other row (including Eq.
0) that has a negative coefficient
in the pivot column, add to this
s1 row the product of the absolute
s2 value of this coefficient and the
s3 new pivot row.
• For each other row that has a
positive coefficient in the pivot
s1 column, subtract from this row
the product of this coefficient and
the new pivot row.
s3

Eq. (2) in Iteration 0 (or pivot row) is divided by the pivot number (= 2)
Eq. (0) in Iteration 0 + (5 × the new pivot row), to make the new pivot column equals zero
Do for other rows!

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 21


The Simplex Method in Tabular Form (5)
• Optimality test:
The current BF solution is optimal if and only if every coefficient in Eq. (0) is nonnegative (≥ 0).
• Iteration 2:
Step 1: Determine the entering basic variable by selecting the non-basic variable with the most negative coefficient.
Step 2: Determine the leaving basic variable by applying the minimum ratio test.
negative, so it not optimal
• x1 is the entering basic variable
as it has the most negative
s1 s2 s3 coefficient in Eq. (0)
• s3 is the leaving basic variable
as it has the smallest ratio in the
s1 minimum ratio test

s3

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 22


The Simplex Method in Tabular Form (6)
• Iteration 2:
Step 3: Solve for the new BF solution s1 s2 s3
by using elementary row operations
to construct a new simplex tableau in
s1
proper form from Gaussian s2
elimination below the current one. s3

• Optimality test:
The current BF solution is optimal, s1
with the value of each basic variable:
s1 = 2, x2 = 6, x1 = 2; and Z = 36. s3

s1

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 23


The Simplex Method in Matrix Form
• The BOLDFACE CAPITAL is used to represent matrix, e.g., A, M;
• The boldface lowercase letter is used to represent vector, e.g., x, c;
• The italicized letter is used to represent scalar, e.g., Z, k;
• A boldface zero (0) is used to denote a null vector (a vector whose elements all are zero).

Using matrices, the “standard form” for the general linear programming model becomes
Maximize Z = cx c is the row vector: c = [c1, c2, …, cn]
x, b, and 0 are the column vectors, and A is the matrix:
Subject to Ax ≤ b
and x≥0 x1 b1 0 a11 a12 ⋯ a1n
x2 b2 0 a a ⋯ a2n
x= ⋮ ; b= ⋮ ; 0= ⋮ ; A = 21 22
⋮ ⋮ ⋱ ⋮
xn bm 0 am1 am2 ⋯ amn

s1
To obtain the augmented form,
s2 The constrains become: [A, I] x = b; and x ≥0
the column vector of slack s s
s= ⋮
variables is introduced:
sn I is the identity matrix

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 24


The Simplex Method in Matrix Form (2)
Consider again the Wyndor Glass Co. problem

Maximize Z = 3x1 + 5x2 + 0s1 + 0s2 + 0s3 x


Maximize Z=c
Augmented form

Matrix form
subject to
(1) x1 + s1 =4 x
subject to [A, I] =b
s
(2) 2x2 + s2 = 12
(3) 3x1 + 2x2 + s3 = 18 x
and ≥0
and x1, x2, s1, s2, s3 ≥ 0 s

c = [3, 5]
1 0 1 0 0
[A, I] = 0 2 0 1 0
3 2 0 0 1

4 x1 s1
b = 12 x = x2 s= s2
18 s3

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 25


The Simplex Method in Matrix Form (3)
• Initialization (Iteration 0):
Introduce the initial basic variables, etc. this yields the initial:
s1 0 x1
xB (the basic variables): xB = s2 = 0 xNB (the non-basic variables): xNB = x2
s3 0
cB (contributions of basic variables to Z): cB = [0, 0, 0]

B is the basis matrix, obtaining by eliminating the columns corresponding to coefficients of non-basic variables from [A, I].
The simplex method introduces only basic variables such that B is non-singular, so that B−1 always will exist.
1 0 0 1 0 0 4 4
B = B-1 = 0 1 0 Since B B-1 = I, the solution for the basic variables is xB = B-1b = 0 1 0 12 = 12
0 0 1 0 0 1 18 18

4
The value of the objective function for this basic solution is then: Z = cBxB = cB B-1b = [0, 0, 0] 12 = 0
18

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 26


The Simplex Method in Matrix Form (4)
• Optimality test
The coefficients of the non-basic variables (x1 and x2) are: cBB−1A − c.
The current BF solution is optimal if and only if all of these coefficients are non-negative.
If it is optimal, stop. Otherwise, go to an iteration to obtain the next BF solution.
1 0 0 1 0 x1 x2
In Iteration 0, the coefficients are: cBB−1A − c = [0, 0, 0] 0 1 0 0 2 − [3, 5] = [−3, −5] not optimal
0 0 1 3 2

• Iteration 1
Step 1: Determine the entering basic variable
Select the variable with the negative coefficient having the largest absolute value as the entering basic variable.
The coefficients of non-basic variables: cBB−1A − c = [−3, −5]
Since −5 is larger in absolute value than −3, the entering basic variable is x2.

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 27


The Simplex Method in Matrix Form (5)
• Iteration 1
Step 2: Determine the leaving basic variable.
x1 x2
1 0 0 1 0 − 0
Use the matrix expressions: B−1A = 0 1 0 0 2 = − 2
0 0 1 3 2 − 2
only consider the relevant variable (i.e., basic variable)

4
Apply the minimum test ratio from xB = B-1b: 12/2 = 6 minimum, so the leaving basic variable is s2
18/2 = 9

4
12
18

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 28


The Simplex Method in Matrix Form (5)
• Iteration 1
Step 3: Determine the new BF solution
Update the basis matrix B by replacing the column for the leaving basic variable by the corresponding column in
[A, I] for the entering basic variable; then derive B−1
s1 x2 s3
1 0 0 1 0 0 1 0 0 4 4 4
B= 0 2 0 ; B−1 = 0 ½ 0 xB = B−1b = 0 ½ 0 12 = 6 Z = cBxB = cBB-1b = [0, 5, 0] 6 = 30
0 2 1 0 −1 1 0 −1 1 18 6 6

• Optimality test
1 0 0 1 0 1 0
for x1: cBB−1A − c = [0, 5, 0] 0 ½ 0 0 2 − [3, 5] = [0, 5, 0] 0 1 − [3, 5] = [−3, ]
0 −1 1 3 2 3 0
1 0 0
for s2: cBB−1 = [0, 5, 0] 0 ½ 0 = [ , 5/2, ]
0 −1 1 not optimal

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 29


The Simplex Method in Matrix Form (6)
• Iteration 2
Step 1: Determine the entering basic variable
The coefficients of non-basic variables: cBB−1A − c = [−3, 0]
Since −3 (or x1) is the one non-basic variable with a negative coefficient, so it is now the entering basic variable.

Step 2: Determine the leaving basic variable


1 0 0 1 0 1 −
Use the matrix expressions: B−1A = 0 ½ 0 0 2 = 0 −
0 −1 1 3 2 3 −

4/1 = 4
Apply the minimum test ratio from xB = B-1b: 6
6/3 = 2 minimum, so the leaving basic variable is s3

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 30


The Simplex Method in Matrix Form (7)
• Iteration 2
Step 3: Determine the new BF solution
s1 x2 x1
1 0 1 1 1/3 −1/3
B= 0 2 0 ; B−1 = 0 ½ 0
0 2 3 0 −1/3 1/3

1 1/3 −1/3 4 2 2
Calculate xB = B−1b = 0 ½ 0 12 = 6 Z = cBxB = cBB-1b = [0, 5, 3] 6 = 36
0 −1/3 1/3 18 2 2

• Optimality test
1 1/3 −1/3
for s2 and s3: cBB−1 = [0, 5, 3] 0 ½ 0 =[ , 3/2, 1] optimal
0 −1/3 1/3

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 31


Simplex Tableau in Matrix Form
The initial and later iteration in simplex tableau as in matrix form:

M. Mujiya Ulkhaq, Ph.D. Introduction to the simplex method 32

You might also like