0% found this document useful (0 votes)
20 views27 pages

Simplex Method

Simplex Method

Uploaded by

chamarasupun998
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)
20 views27 pages

Simplex Method

Simplex Method

Uploaded by

chamarasupun998
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

EE8212 Optimization Techniques for Engineers

Linear Programming

Simplex Method
Introduction
• Simplex method is an algebraic procedure.
However, its underlying principles are
geometric. To understand the basic principles
of the procedure we will be using the problem
we solved for Maharage and Co. , in the
previous section.

2
Basic features of the Simplex Method
The model and the graph we developed earlier are repeated
here (see figure 1) to demonstrate the basic features of the
Simplex Method.

Maximize, Z = 3x1 + 5x2


Subject to,
x1 <= 4
2x2 <= 12
3x1 + 2x2 <= 18
x1 >= 0
x2 >= 0

Figure 1: Graphical solution for Maharage and Co. 3


In this example, each corner point solution lies at the intersection of two
constraint boundaries. Two of its CPF (Corner Point Feasible) solutions are
adjacent if they share the same constraint boundary. Table 1 shows the adjacent
CPF solutions for each CPF solution.

CPF Solution Adjacent CPF Solutions


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

Table 1: Adjacent CPF solutions for each CPF solution

Optimality test: If a CPF solution has no adjacent CPF solutions that


are better, then it must be an optimal solution.

As such in this example (2,6) must be an optimal solution because Z=36 is larger
than Z=30 for (0,6) and Z=27 for (4,3).
Now let us go through the step by step procedure of arriving at the optimal
solution.
4
Geometric Solution Procedure
Initialisation : Choose (0,0) as the initial CPF solution.
Optimality test : Conclude that (0,0) is not an optimal solution. The adjacent CPF are better.

Iteration 1 : Move to a better adjacent CPF solution (0,6), by performing the following 3
steps.
1. Consider the two edges that starts at (0,0). With objective function Z=3x1+5x2 , moving
up the x2 axis increase Z at a faster rate than moving along the x1 axis.
2. Stop at the first constraint boundary 2x2=12.
3. Solve for the intersection of new constraint boundaries (0,6).

Optimality test: Conclude that (0,6) is not an optimal solution. An adjacent CPF solution is
better.

Iteration 2 : Move to a better adjacent CPF solution (2,6), by performing the following 3
steps.
1. Consider the two edges that starts at (0,6). With objective function Z=3x1+5x2 , moving
to the right increases Z, where as moving down will reduce Z.
2. Stop at the first constraint boundary 3x1+2x2=18.
3. Solve for the intersection of new constraint boundaries (2,6).

Optimality test: Conclude that (2,6) is an optimal solution. So stop 5


Setting up the Algebraic Procedure

Previous method explained the geometric principles underlying the Simplex


Method. However, large linear programming problems are solved using computers.
As such this geometric procedure needs to be translated to a algebraic procedure.

The algebraic procedure is involved in solving a system of equations. As such the


first step in setting up the algebraic procedure is to convert the functional
inequality constraints to equality constraints. This is achieved by using slack
variables. Consider the following functional constraint.

x1 <= 4

The slack variable for this constraint is defined to be,

x3= 4-x1

Thus, x1 + x3 = 4 where x3 >= 0


6
By introducing the concept of slack variables the original linear programming
problem can be reduced to the following, called the Augmented form of the
model.

Maximise, Z= 3x1 + 5x2

Subject to,
(1) x1 + x3 = 4
(2) 2x2 + x4 = 12
(3) 3x1 + 2x2 + x5 = 18
and x1 >=0 , x2 >=0 , x3 >=0 , x4 >=0 , x5 >=0

If a slack variable is equal to,

0 - Then this solution lies on the constraint boundary of the corresponding


functional constraint.
> 0 – The solution is within the feasible region
< 0 – The solution is outside the feasible region

7
A Basic Feasible (BF) Solution is an augmented corner point
solution. Thus the CPF solution (0,6) in this example is
equivalent to the BF Solution (0,6,4,0,6). The difference
between the CPF and BF solution is that in the latter slack
variables are included.

Basic Solution and Basic Feasible (BF) Solution are two terms
that are very important in solving linear programming
problems. As such it is necessary to have a clear
understanding of their algebraic properties.

8
A basic solution has the following properties:
• Each variable is designated as a basic or nonbasic variable.
• The number of basic variables equals the number of functional
constraints. Hence the number of nonbasic variables equals the
total number of variables minus the number of functional
constraints.
• The nonbasic variables are set to zero.
• The values of the basic variables are obtained as the simultaneous
solution of the system of equations.

If the basic variables satisfy the non negativity condition,


the basic solution is a BF solution.

9
To illustrate the above properties, let us consider the BF solution
(0,6,4,0,6) obtained earlier. Another way to arrive at this solution is
to choose x1 and x4 as nonbasic variables. The three equations then
yield x3=4 , x2=6 and x5=6 as shown below.

(1) x1 + x 3 = 4 x3=4
(2) 2x2 + x4 = 12 x2=6
(3) 3x1+ 2x2 + x5 = 18 x5=6

Because all three basic variables are positive, this is a BF


solution.

10
Note: Two BF solutions are adjacent if atleast one of their non basic
variables are the same. This implies that atleast one of their basic
variables are the same, perhaps with different numerical values.

Consequently moving from one BF solution to an adjacent one


involves switching one variable from basic to nonbasic and vice versa.

To illustrate adjacent BF solutions, consider one pair of adjacent CPF


solutions in figure 1. (0,0) and (0,6). Their augmented solutions
(0,0,4,12,18) and (0,6,4,0,6) are adjacent BF solutions. Their nonbasic
variable has one in common. Consequently moving from
(0,0,4,12,18) to (0,6,4,0,6) involves switching x2 from nonbasic to
basic and vice versa for x4.

11
When we deal with the problem in augmented form it is
convenient to consider the objective function too in the form of an
equation. So our linear programming problem can be re written as
follows,

Maximise Z,

Subject to,

(0) Z - 3x1 - 5x2 =0


(1) x1 + x 3 = 4
(2) 2x2 + x4 = 12
(3) 3x1+ 2x2 + x5 = 18

and x1 >=0 , x2 >=0 , x3 >=0 , x4 >=0 , x5 >=0

12
Algebra of the Simplex Method

We start with the initial BF solution (0,0,4,12,18)

Optimality test : The objective function is Z = 3x1 + 5x2 . So Z=0 for the BF solution. The
rates of increase for unit increase of x1 and x2 are positive. Hence this is not the optimal
solution.

Determining the direction of movement (step 1 of an iteration)

Increasing one nonbasic variable from zero corresponds to moving along one edge
emanating from the current CPF solution. The decision as to which nonbasic variable to
increase is made as follows.

Z = 3x1 + 5x2

Increase x1 ? Rate of improvement in Z = 3


Increase x2 ? Rate of improvement in Z = 5
5>3 so increase x2 .

At any iteration, purpose of step 1 is to choose one nonbasic variable to increase from
zero. Increasing this nonbasic variable from zero will convert it to a basic variable for the
next BF solution. Therefore this is called the entering variable for the current iteration.
13
Determining where to stop (step 2 of an iteration)

Step 2 decides how far to increase x2 . We should increase x2 as much as possible


while being inside the feasible region. Increasing x2 changes the values of some of
the basic variables as shown below.
x1 = 0, so
(1) x1 + x3 = 4 x3= 4
(2) 2x2 + x4 = 12 x4= 12 - 2x2
(3) 3x1+ 2x2 + x5 = 18 x5= 18 - 2x2

The basic variables are nonnegative. We need to find out how far x2 can be
increased without violating the nonnegative constraint of the basic variables.

x4= 12 - 2x2 >= 0  x2 <= 12/2 =6 (minimum)


x5= 18 - 2x2 >=0  x2 <= 18/2 =9

So x2 can be increased to 6, at which point x4 reduces to 0.

Decreasing this basic variable x4 to zero will convert it to a nonbasic variable for the
next BF solution. Therefore this variable is called leaving basic variable for the
current iteration. 14
Solving for the new BF solution (step 3 of an iteration)

Increasing x2 from 0 to 6 moves us from the initial BF to the new BF solution as shown
below.

Initial BF Solution New BF solution


Nonbasic variables: x1= 0 , x2=0 x1= 0 , x4=0
Basic variables: x3= 4 , x4=12, x5=18 x3= ? , x2=6, x5=?

Purpose of this step is to convert the system of equations to a more convenient form for
conducting optimality test and next iteration. This form also will identify the values of x3
and x5 for the new solution. Here is the complete set of original equations.

(0) Z - 3x1 - 5x2 =0


(1) x1 + x 3 =4
(2) 2x2 + x4 = 12
(3) 3x1+ 2x2 + x5 = 18

15
x2 has replaced x4 as the basic variable in eq (2). To solve this system of equations for Z, x2,
x3, and x5 we need to perform some basic algebraic operations to reproduce the current
patterns of coefficients of x4 (0,0,1,0 ) as the new coefficients of x2.

Note that the coefficients of x2 in the above set of equations are (-5,0,2,2), where as we
want them to be (0,0,1,0). To turn the coefficient of x2 in eq (2) to 1, divide this equation by
2.

(2) x2 + ½ x4 = 6

To turn the coefficients -5 and 2 to zero, we add 5 times this new equation (2) to equation
(0), and subtract 2 times the new eq(2) from eq(3). This results in,

(0) Z - 3x1 + 5/2x4 = 30


(1) x1 + x3 =4
(2) x2 + ½ x 4 =6
(3) 3x1 - x4 + x5 =6

Since x1 = 0 and x4 = 0, this yields the new BF solution (x1, x2, x3, x4, x5) = (0, 6, 4, 0, 6) which
gives Z=30.

16
Optimality test

The current eq(0) gives the objective function in terms of the new
nonbasic variables as,

Z = 30 + 3x1 - 5/2x4

Since x1 has a positive coefficient, increasing x1 would lead to a new


BF solution, better than the current one. So the current solution is
not optimal.

17
Iteration 2 and the resulting optimal solution

Since Z can be increased by increasing x1, choose x1 to be the entering basic


variable.

For the next step the current set of equations yield about how far x1 can be
increased.

X3 = 4 – x1 >=0  x1 <= 4
X2 – no upper bound on x1
X5 = 6 – 3x1 >=0  x1 <= 2 (minimum)

So x5 is the leaving basic variable.

For the final step with x1 replacing x5 as the basic variable, perform the
elementary algebraic operations as we did earlier, to reproduce the current
pattern coefficients of x5 (0,0,0,1) as the new coefficients of x1. This results in
the following set of equations.

18
(0) Z  23 x4  x5  36
(1) x3  13 x4  13 x5  2
(2) x2  12 x4  6
(3) x1  13 x4  13 x5  2

So the next BF solution is (x1, x2, x3, x4, x5) = (2, 6, 2, 0, 0) which gives Z=36.

Current eq(0) can be written as

Z  36  23 x4  x5
Increasing either x4 or x5 will reduce Z.

So optimal solution is x1=2 , x2=6 which yields Z=36


19
SIMPLEX METHOD IN TABULAR FORM

If you want to solve a linear programming problem by hand,


tabular form of simplex method is the most convenient method.
The tabular form records only the essential information. Namely,

• The coefficients of the variables


• The constants on the right hand side of the equations
• The basic variables appearing in each equation

This permits highlighting the numbers involved in arithmetic


calculations and recording the computations compactly.

20
21
22
23
Step 3: Solve for the new BF by using elementary row operations to construct a
new simplex tableau below the current and return to the optimality test.

Divide the pivot row by pivot number. Use this new pivot row in steps 2 and 3

For each other row that has a negative coefficient in the pivot column, add to this
row the product of the absolute value of this coefficient and the new pivot row

For each other row that has a positive coefficient in the pivot column, subtract
from this row the product of this coefficient and the new pivot row.

24
25
26
27

You might also like