The Steps of The Simplex Algorithm PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

THESTEPSOFTHESIMPLEXALGORITHM

Contents
1. Introduction.............................................................................................................................2
2. Slackandsurplusvariables......................................................................................................2
3. Basicandnonbasicvariables...................................................................................................2
4. Admissiblesolutions................................................................................................................3
5. Solutionofalinearprogram(LP)............................................................................................3
6. Lecritredarrt..............................................................................Erreur!Signetnondfini.


1. Introduction

A linear program (LP) that appears in a particular form where all constraints are
equationsandallvariablesarenonnegativeissaidtobeinstandardform.

2. Slack and surplus variables

Before the simplex algorithm can be used to solve a linear program, the problem
mustbewritteninstandardform.

a. Constraints of type ( ): for each constraint of this type, we add a slack


variable ,suchthat isnonnegative.

Example:3 2 2translatesinto3 2 2, 0

b. Constraintsoftype( ):foreachconstraint ofthistype,weaddasurplus


variable ,suchthat isnonnegative.

Example:3 2 2translatesinto3 2 2, 0

Alinearprogramthatcontains(technological)constraintsofthetype isabbreviated
as (LP). A linear program that contains mixed (technological) constraints , , ) is
abbreviated as (GP). A linear program (LP) resp. (GP)converted into standard form is
abbreviatedas(PL=)resp.(PG=).

3. Basic and nonbasic variables

Considerasystemofequationswith variablesand equationswhere .Abasic


solutionforthissystemisobtainedinthefollowingway:

a) Set variablesequaltozero.Thesevariablesarecallednonbasicvariables
(N.B.V).
b) Solvethesystemforthe remainingvariables.Thesevariablesarecalledbasic
variables(B.V.)
c) The vector of variables obtained is called the basic solution (it contains both
basicandnonbasicvariables).

Abasicsolutionisadmissibleifallvariablesofthebasicsolutionarenonnegative.

Itiscrucialtohavethesamenumberofvariablesasequations.

Page2of8

4. Admissible solutions

Each basic solution of (LP=) for which all variables are nonnegative, is called an
admissible basic solution. This admissible basic solution corresponds to an extreme
point(cornersolution).

5. Solution of a linear program (LP)

(LP) (LP)

Ex: 1000 1200 Ex: 1000 1200


. . 10 5 200 . . 10 5 200
2 3 60 2 3 60
34 34
14 14
, 0 , , , , , 0

6and 4

6 4 2variables 0

Nonbasicvariables Basicvariables:

x1 x2 0 then 200
60
34
14

Page3of8

StepA:initialtable

Coef.inZ 1000 1200 0 0 0 0


Base X1 X2 E1 E2 E3 E4 bi
Coef.Z BasicVar.
0 E1 10 5 1 0 0 0 200
0 E2 2 3 0 1 0 0 60
0 E3 1 0 0 0 1 0 34
0 E4 0 1 0 0 0 1 14
zj 0 0 0 0 0 0 0
Cjzj 1000 1200 0 0 0 0

Theinitialtableiswritteninthefollowingway:

Thebleuframecorrespondstotheconstraintsof(LP=).

Thegreenframecorrespondsto :thecoefficientsin .

Exampleforthecolumnof called( ):

0 10 0 2 0 1 0 0 0

The pink frames correspond to the coefficients ( ) of the variables in the


objectivefunction( ).

Thegreyframecorrespondstothevalueofthebasicvariables.

Theorangeframecorrespondstothevalueof ,i.e.thevalueoftheobjective
function,calculatedasfollows:

0 200 0 60 0 34 0 14 0

StepB:selectionoftheenteringvariable(tothesetofbasicvariables)

Maximumofthe formaximumproblems.

Minimumofthe fortheminimumproblems.

In our example: has the greatest ; hence it enters in the set of basic
variables.

Page4of8

StepC:selectionoftheleavingvariable

InaproblemofeitherminORmax,theleavingvariableistheminimumof

Inourexample,weneedtoevaluate:

Enteringvariable

Coef.inZ 1000 1200 0 0 0 0


Base X1 X2 E1 E2 E3 E4 bi
Coef.Z Basic
Var.
0 E1 10 5 1 0 0 0 200
0 E2 2 3 0 1 0 0 60
0 E3 1 0 0 0 1 0 34
0 E4 0 1 0 0 0 1 14
zj 0 0 0 0 0 0 0
Cjzj 1000 1200 0 0 0 0

200/5=40

60/3=20

14/1=14istheminimum,hence isthevariablethatleavesthesetofbasic
variables.

StepD:pivot

Coef.inZ 1000 1200 0 0 0 0


Base X1 X2 E1 E2 E3 E4 bi
Coef.Z Basic
var.
0 E1 10 5 1 0 0 0 200
0 E2 2 3 0 1 0 0 60
0 E3 1 0 0 0 1 0 34
0 E4 0 1 0 0 0 1 14
zj 0 0 0 0 0 0 0
Cjzj 1000 1200 0 0 0 0

Page5of8

Thebluecelliscalledthepivot.Togotothenexttable(andhencetocarryoutthe
firstiteration),itisessentialtousethepivot.

Pivotinggoeslikethis:

Onestartsbydividingthelineofthepivotbythepivot.

Inourexample,wedivideby1.

Coef.inZ 1000 1200 0 0 0 0


Base X1 X2 E1 E2 E3 E4 bi
Coef.Z Basic
var.
0 E1
0 E2
0 E3
1200 X2 0 1 0 0 0 1 14
zj 0 0 0 0 0 0 0
Cjzj 1000 1200 0 0 0 0

Wecontinuetoconstructtheidentitymatrixforthebasicvariables.Wewriteonethe
intersectionofthesevariablesandzeroelsewhere.

Coef.inZ 1000 1200 0 0 0 0


Base X1 X2 E1 E2 E3 E4 bi
Coef.Z Basic
var.
0 E1 0 1 0 0
0 E2 0 0 1 0
0 E3 0 0 0 1
1200 X2 0 1 0 0 0 1 14
zj 0 0 0 0 0 0 0
Cjzj 1000 1200 0 0 0 0

Weneedtocalculatethevaluesfortheremainingcellsfromtheprevioustable(orthe
initialtableforthefirstiteration).

Page6of8

Coef.inZ 1000 1200 0 0 0 0


Base X1 X2 E1 E2 E3 E4 bi
Coef.Z Basic
var.
0 E1 0 1 0 0
0 E2 0 0 1 0
0 E3 0 0 0 1
1200 X2 0 1 0 0 0 1 14
zj 0 0 0 0 0 0 0
Cjzj 1000 1200 0 0 0 0

Initialtable:

Coef.inZ 1000 1200 0 0 0 0


Base X1 X2 E1 E2 E3 E4 bi
Coef.Z Basic
var.
0 E1 10 5 1 0 0 0 200
0 E2 2 3 0 1 0 0 60
0 E3 1 0 0 0 1 0 34
0 E4 0 1 0 0 0 1 14
zj 0 0 0 0 0 0 0
Cjzj 1000 1200 0 0 0 0

Inourexample,the10intheredframedcelliscalculatedwiththefollowingformula


10

05
Hence, 10 10.
1

Letuscalculatethegreenframedcell.Weobtain3inthefollowingway:

31
0 3
1

Page7of8

Coef.inZ 1000 1200 0 0 0 0


Base X1 X2 E1 E2 E3 E4 bi
Coef.Z Basic
var.
0 E1 10 0 1 0 0 5
0 E2 2 0 0 1 0 3
0 E3 1 0 0 0 1 0
1200 X2 0 1 0 0 0 1 14
zj 0 0 0 0 0 0 0
Cjzj 1000 1200 0 0 0 0

Theremainingcellsarecalculatedinthesameway.Whenthetableisfull(suchasthe
one below), one can continue to the second iteration, that will be carried out in the
sameway.

6. Stopping criterion

Westopwhenwereachtheoptimalitycriterion.Thesimplexalgorithmstopswhen:

0foramaximumproblem
0foraminimumproblem

Page8of8

You might also like