0% found this document useful (0 votes)
2 views

Chapter08 BigM and TwoPhases Methods

Uploaded by

hamidmaraf2005
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)
2 views

Chapter08 BigM and TwoPhases Methods

Uploaded by

hamidmaraf2005
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/ 39

Chapiter 7: Linear programming resolution:

Two-phase method and penalty method (Big M


method)

Prepared by : Mr. Abdelhamid LEBAL

[email protected]

January 11, 2025

Pres: Abdelhamid LEBAL Linear programming Month-Year 1 / 39


Outline

1 Introduction

2 The Grand M (or penalty) method

3 The two-phases method

Pres: Abdelhamid LEBAL Linear programming Month-Year 2 / 39


Introduction

All linear programs that were previously discussed are of the type:
Maximize a linear function under constraints of type lower or
equal (and with a second member positive).
In many real problems, we can find constraints textbftype superior or
equal and/or of equal type, as well as problems where we have to
textbf minimize instead of maximize.
In this chapter, we will consider the changes to be made to the
simplex method so that it can solve all these types of programmes.

Pres: Abdelhamid LEBAL Linear programming Month-Year 3 / 39


Artificial variables

Consider the following PL:


Max Z = x1 + 2x2
x1 + 3x2 ≤ 21

S.C: −x1 + 3x2 ≤ 18

x1 − x2 ≤ 5

x1 ≥ 0; x2 ≥ 0

To reach the standard form we add slack variables Non-negative


Max Z = x1 + 2x2 + 0.e1 + 0.e2 + 0.e3
x1 + 3x2 + e1 = 21

S.C: −x1 + 3x2 + e2 = 18

x1 − x2 + e3 = 5

x1 ≥ 0; x2 ≥ 0;e1 ≥ 0; e2 ≥ 0;e3 ≥ 0

Pres: Abdelhamid LEBAL Linear programming Month-Year 4 / 39


Artificial variables

1 In order to generate an initial workable basic solution for the simplex


method, the decision variables textcolorbluex1 and textcolorbluex2
were cancelled.
2 This allows us to start from the source (0, 0). However, it is well
verified that the origin is a feasible solution, because if we put
(x1 , x2 ) = (0, 0) then we get (e1 , e2 , e3 ) = (21, 18, 5). And this
verifies the non-negativity constraint, e1 ≥ 0; e2 ≥ 0; e3 ≥ 0.

Pres: Abdelhamid LEBAL Linear programming Month-Year 5 / 39


Artificial variables
Consider the following LP:
Max Z = 5x1 + 6x2
−x1 + x2 ≤ 4

S.C: 5x1 + 3x2 = 60

x2 ≥ 5

x1 ≥ 0; x2 ≥ 0

To achieve the standard form, non-negative slack variable is


added in the first constraint +S1 ; and a surplus variable is
added for the third constraint −S2 :
Max Z = 5x1 + 6x2 + 0.S1 + 0.S2
−x1 + x2 + S1 = 4

S.C: 5x1 + 3x2 = 60

x2 − S2 = 5

x1 ≥ 0; x2 ≥ 0;S1 ≥ 0; S2 ≥ 0
Pres: Abdelhamid LEBAL Linear programming Month-Year 6 / 39
Artificial variables

1 In order to generate an initial basic workable solution for the simplex


method, the decision variables x1 and x2 were cancelled.
2 This allows us to start from the source (0, 0). However, it is well
verified that the origin is not a feasible solution, because in the 3rd
constraint we will have: −S2 = 5 So S2 = −5 So: contradiction with
the non-negativity constraint of: S2
3 The question is: How are we going to rewrite the program so
that we can build the original simplex array?

Pres: Abdelhamid LEBAL Linear programming Month-Year 7 / 39


Artificial variables

1 To achieve this, we must find a mathematical method which is


reduced to the introduction of new variables, called:
artificial variables A1 et A2.
2 These variables have no interpretation, as their name suggests, they
are artificially designed to help us use the simplex procedure and
formulate the initial table from the origin.

Pres: Abdelhamid LEBAL Linear programming Month-Year 8 / 39


artificial variables

If these two artificial variables A1 and A2 are added to the


2nd and 3rd constraints respectively, the program becomes as
follows:
Max Z = 5x1 + 6x2
−x1 + x2 + S1 = 4

S.C: 5x1 + 3x2 + A1 = 60

x2 − S2 + A2 = 5

x1 ≥ 0; x2 ≥ 0;S1 ≥ 0; S2 ≥ 0;A1 ≥ 0; A2 ≥ 0.

Pres: Abdelhamid LEBAL Linear programming Month-Year 9 / 39


artificial variables

Now we can get an initial basic solution of the system of equations, if we


pose x1 = x2 = 0.
The initial solution is:
x1 = 0
x2 = 0
S1 = 4
S2 = 0
A1 = 60
A2 = 5

Pres: Abdelhamid LEBAL Linear programming Month-Year 10 / 39


Artificial variables

This solution is not feasible since x2 does not exceed 5.


To solve this type of LP problem, there are two methods:
1 The Grand M (or penalties) method.
2 The method of resolution in two phases.

Pres: Abdelhamid LEBAL Linear programming Month-Year 11 / 39


1 A way to ensure that these artificial variables are removed from the
base before reaching the optimal solution is to associate them with a
large cost M in the objective function.
2 Thus, if these variables remain in the base they will cause a
significant decrease in the value of the objective function. Which
forces us to get them out of the base as soon as possible.
The objective function is therefore written:
Max Z = 5x1 + 6x2 − MA1 − MA2
With M a very great number.

Pres: Abdelhamid LEBAL Linear programming Month-Year 12 / 39


The Grand M (or penalty) method

Notes
1 Rewrite the objective function in its standard form by adding, to the
terms associated with the decision, slack variables and surplus
variables. artificial variables by imposing a penalty either:
(-M), in the case of a maximisation.
(+M), in the case of a miniimisation.

Pres: Abdelhamid LEBAL Linear programming Month-Year 13 / 39


Example:

The following linear programme:

Max
 Z = 4x1 + 5x2
2x1 + 2x2 ≥ 8

S.C: x2 = 3

9x1 + 3x2 ≤ 27

x1 ≥ 0; x2 ≥ 0.

Pres: Abdelhamid LEBAL Linear programming Month-Year 14 / 39


The Grand M (or penalty) method
Write down the model in its standard form: we must add a slack
variable in the constraints of type ≤ and subtract a surplus variable in
the constraints of type ≥. and add the artificial variables in the
constraints of type ≥ or =.

Standard form
Max Z = 4x1 + 5x2 + 0s1 + 0.s2 − M.A1 − MA2
2x1 + 2x2 − s1 + A1 = 8

S.C: x2 + A2 = 3

9x1 + 3x2 + s2 = 27

x1 ≥ 0; x2 ≥ 0;s1 ≥ 0; s2 ≥ 0;A1 ≥ 0; A2 ≥ 0.

Where:
s2 is a slack variable.
s1 is a surplus variable.
A1 et A2 sont des artificial variables.
Pres: Abdelhamid LEBAL Linear programming Month-Year 15 / 39
initial table

Applying these modifications, the initial simplex table of the linear


program below is as follows:

In the same way as before; try to find the incoming variable and the
outgoing variable

Pres: Abdelhamid LEBAL Linear programming Month-Year 16 / 39


Iteration 1

In the same way as before we try to find the incoming variable and
the outgoing variable
The incoming variable is: x2 ((5 + 3M) > (4 + 2M) with M big
enough) and the output variable is: A2 .

Pres: Abdelhamid LEBAL Linear programming Month-Year 17 / 39


Iteration 2

In the same way as before we try to find the incoming variable and
the outgoing variable
The simplex array after the second iteration indicates that the output
variable is: A1 .

Pres: Abdelhamid LEBAL Linear programming Month-Year 18 / 39


Iteration 3

The first two iterations are made to remove the artificial variables
from the base A1 and A2 . So we can remove the column related to
A1 and A2 .

In the same way as before we try to find the incoming variable and
the outgoing variable

Pres: Abdelhamid LEBAL Linear programming Month-Year 19 / 39


Iteration 4

We notice that the table is optimal: (∀i, bi − Zi ≤ 0) and all artificial


variables are out of the base, so the solution in this table is the
optimal solution of the original linear program. This optimal
solution is unique because (∀i, bi − Zi ≤ 0).
The optimal solution is: (x1 , x2 ) = (2, 3), s1 = 2 and s2 = 0 with Z = 23.

Pres: Abdelhamid LEBAL Linear programming Month-Year 20 / 39


Big M method

Example 2:
Consider the following LP:
Min: (Z = x + 3y
x + 2y ≥ 30
S.C:
x + 4y ≥ 40
x ≥ 0; y ≥ 0

Pres: Abdelhamid LEBAL Linear programming Month-Year 21 / 39


Big M method

Example 2:
Write down the model in its standard form:
Min: (Z = x + 3y + 0.e1 + 0.e2 + M.t1 + M.t2
x + 2y − e1 + t1 = 30
S.C:
x + 4y − e2 + t2 = 40
x ≥ 0; y ≥ 0;e1 ≥ 0; e2 ≥ 0;t1 ≥ 0; t2 ≥ 0

Pres: Abdelhamid LEBAL Linear programming Month-Year 22 / 39


Initial Table

Pres: Abdelhamid LEBAL Linear programming Month-Year 23 / 39


Iteration 1

Pres: Abdelhamid LEBAL Linear programming Month-Year 24 / 39


Iteration 2

Pres: Abdelhamid LEBAL Linear programming Month-Year 25 / 39


Iteration 3

We notice that the table is optimal (∀i, bi − Zi ≥ 0) and all artificial


variables are out of the base, so the solution in this table is the
optimal solution of the original linear program. This optimal
solution is unique because (∀i, bi − Zi ≥ 0).
The optimal solution is: (x, y ) = (20, 5), e1 = 0 et e2 = 0 with Z = 35.

Pres: Abdelhamid LEBAL Linear programming Month-Year 26 / 39


Notes:

1 If (the optimality criterion is met) and (∃ there are artificial variables


in the base > 0) Then STOP The linear program does not admit of
feasible solutions.
2 If (the optimality criterion is met) et (all artificial variables are null)
Then The linear program admits an optimal finite solution (unique or
multiple).
3 If (∃ incoming variable) et (∄ outgoing variable) and (all artificial
variables are null) Then The linear program does not admit a finite
optimal solution.
4 Si (∃ incoming variable) and (∄ outgoing variable) and (∃ artificial
variables in the base > 0) Then The linear program does not admit
of feasible solutions.

Pres: Abdelhamid LEBAL Linear programming Month-Year 27 / 39


The two-phases method

1 In the two-phase method, we add the artificial variables, then solve


the phase 1 to find a basic feasible solution to the original problem.
2 En phase I, The objective function is to minimize the sum of all
artificial variables (or maximize this sum multiply by -1).
3 At the end of the phase I, the objective function of the original
problem is re-introduced and the optimal solution is then determined.

Pres: Abdelhamid LEBAL Linear programming Month-Year 28 / 39


Phase I

Consider the following LP:


Max:Z = x1 + 2x2
x1 + x2 ≤ 5

S.C: x1 + 2x2 ≥ 2

x1 ≥ 1

x1 ≥ 0; x2 ≥ 0

Ignoring for the moment the objective function Z of the original


problem and instead trying to solve a problem whose objective
function is: Min Z’= (sum of all artificial variables)
This is called the phase I.
The resolution of phase I will cause the cancellation of artificial
variables.
Pres: Abdelhamid LEBAL Linear programming Month-Year 29 / 39
Phase I

Write down the model in its standard form:


Max:Z = x1 + 2x2 + 0.e1 + 0.e2 + 0.e3 + t1 + t2
x1 + x2 + e1 = 5

S.C: x1 + 2x2 − e2 + t1 = 2

x1 − e3 + t2 = 1

x1 ≥ 0; x2 ≥ 0;e1 ≥ 0; e2 ≥ 0;t1 ≥ 0; t2 ≥ 0.

Ou:
x1 , x2 : are the decision variables,
e1 : is the slack variable,
e2 , e3 : are the surplus variables,
t1 , t2 : are the artificial variables.

Pres: Abdelhamid LEBAL Linear programming Month-Year 30 / 39


Phase I

The objective function to minimize is the sum of the artificial variables and
that is:

Min: W = t1 + t2

The initial table for Phase I is as follows:

Pres: Abdelhamid LEBAL Linear programming Month-Year 31 / 39


Phase I

The optimization steps are carried out:

Pres: Abdelhamid LEBAL Linear programming Month-Year 32 / 39


Phase I

Pres: Abdelhamid LEBAL Linear programming Month-Year 33 / 39


Phase I

In this last table, the optimal value of W is equal to zero and no


artificial variable is in the optimal base of Phase I.
In this case, all the artificial variable columns are removed from the
optimal table of phase I.
We now combine the original objective function Z with the
constraints of the optimal table of phase I. This leads to phase II.
The optimal solution of phase II is the optimal solution for the
original linear program.
Pres: Abdelhamid LEBAL Linear programming Month-Year 34 / 39
Phase II

Let’s start phase II by optimizing the objective function of the original


model and eliminating from the last table Phase I, the two columns
associated with artificial variables t1 and t2 .
When the artificial variables are removed and the original objective
function is taken over Z:
Max: Z = x1 + 2x2 + 0.e1 + 0.e2 + 0.e3
The final table of phase I will be:

Pres: Abdelhamid LEBAL Linear programming Month-Year 35 / 39


Phase II:

The optimality criterion is met (∀i, bi − Zi ≤ 0), therefore the basic


solution obtained from textbfphase II is the optimal solution of the original
linear program. This optimal solution is unique which is:

(x1 , x2 ) = (1, 4), (e1 , e2 , e3 ) = (0, 7, 0) and Z = 9.

Pres: Abdelhamid LEBAL Linear programming Month-Year 36 / 39


Notes:

1 The objective function of phase I: Max : W = sum of all artificial


variables is the same for maximization and minimization problems.
2 In the case of the second member is negative:
The problem that can arise is that one of the second member is
negative. For example, suppose that a constraint of this type is found
in the formulation:
x1 − x2 ≥ −4
The condition to be checked before starting to rewrite this constraint,
in order to build the standard program, is the no-negativity of the
second member.
Thus, the constraint must be modified before starting the
standardization and rewritten as follows:
−x1 + x2 ≤ 4

Pres: Abdelhamid LEBAL Linear programming Month-Year 37 / 39


The problems of minimization

1 In a maximization problem the incoming variable is the one that has


the greatest net positive effect not zero.
2 This is because our goal is to choose the variable that entering the
base will generate an additional profit and thus increase the value of
the objective function.
3 For a minimization problem, we will use the inverse rule.
4 That is to say the incoming variable is the one to which the smallest
negative value of the net effect is associated. bi − Zi .
5 This will also lead us to change our stop rule of the simplex procedure
and define the optimal table, such as one where all net effects bi − Zi
are positive or zero.

Pres: Abdelhamid LEBAL Linear programming Month-Year 38 / 39


Thank you!

Pres: Abdelhamid LEBAL Linear programming Month-Year 39 / 39

You might also like