0% found this document useful (0 votes)
872 views42 pages

01 Simplex Method

The document describes the simplex method for solving linear programming problems (LPPs). It discusses converting general linear programming problems (GLPPs) to the standard form required for the simplex method through 4 steps: 1) writing the objective as maximization, 2) converting inequalities to equations using slack/surplus variables, 3) making right sides non-negative, and 4) restricting variables to be non-negative. It then outlines the basic steps of the simplex method which involves creating a initial tableau, finding a pivot element to create new basic feasible solutions, and iterating until an optimal solution is identified.
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)
872 views42 pages

01 Simplex Method

The document describes the simplex method for solving linear programming problems (LPPs). It discusses converting general linear programming problems (GLPPs) to the standard form required for the simplex method through 4 steps: 1) writing the objective as maximization, 2) converting inequalities to equations using slack/surplus variables, 3) making right sides non-negative, and 4) restricting variables to be non-negative. It then outlines the basic steps of the simplex method which involves creating a initial tableau, finding a pivot element to create new basic feasible solutions, and iterating until an optimal solution is identified.
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/ 42

DECISION-MAKING METHODS

IN TRANSPORTATION
THE SIMPLEX METHOD

Dr. Tibor SIPOS Ph.D.


Anteneh AFEWORK
Zsombor SZABÓ
2019

BME FACULTY OF TRANSPORTATION ENGINEERING AND VEHICLE ENGINEERING


32708-2/2017/INTFIN COURSE MATERIAL SUPPORTED BY EMMI
Introduction of Simplex method
Dr. Árpád Török, Gábor Pauer

Developed by G. Danztig (1947)


The Simplex method :
•is based on the fundamental theorem of linear
programming
•is an iterative procedure for solving linear programming
problems (LPPs)
•is a technique for solving linear programs by hand

Linear program: a method of achieving the best outcome given


a maximum or minimum equation with linear constraints

2
Introduction of Simplex method
Dr. Árpád Török, Gábor Pauer
Steps of solving a linear programming model using the Simplex
method:
a. Standard form
b. Introducing slack variables/surplus variables
c. Creating the table (+check optimality)
d. Pivot variables
e. Creating a new table
f. Checking for optimality
g. Identify optimal values
Advantages of the method:
•Simple to solve problems
•The solution of LPP of more than two variables can be
easily obtained
3
Linear Programming Problems (LPPs)
Dr. Árpád Török, Gábor Pauer

Two forms:
Ad1, General Linear Programming Problems (GLPPs)

conversion (4 steps)

Ad2, Standard Linear Programming Problems (SLPPs)


SLPP can be solved with the use of Simplex method

4
Ad1, General Linear Programming Problem -GLPP
Dr. Árpád Török, Gábor Pauer

Maximize / Minimize:
Z = c1x1 + c2x2 + c3x3 +……..+ cnxn

Subject to constraints:
a11x1 + a12x2 + …..........+a1nxn (≤ or ≥) b1
a21x1 + a22x2 + ………..+a2nxn (≤ or ≥) b2
….

am1x1 + am2x2 + ……….+amnxn (≤ or ≥) bm


and
x1 ≥ 0, x2 ≥ 0,…, xn ≥ 0

5
Conversion of GLPP to standard form (SLPP)- 4 steps
Dr. Árpád Török, Gábor Pauer

Step 1 – Write the objective function in the maximization form.


If the given objective function is of minimization form then
multiply throughout by -1 and write Max z = Min (-z)

Step 2 – Convert all inequalities as equations.


If an equality of ‘≤’ appears then by adding a variable called
Slack variable, we can convert it to an equation.
For example x1 +2x2 ≤ 12, we can write as x1 +2x2 + s1 = 12.
If the constraint is of ‘≥’ type, we subtract a variable called
Surplus variable and convert it an equation.
For example 2x1 +x2 ≥ 15 can be transformed to 2x1 +x2 – s2 = 15.

6
Conversion of GLPP to standard form (SLPP)- 4 steps
Dr. Árpád Török, Gábor Pauer

Step 3 – The right side element of each constraint should be made


non-negative.
For example: 2x1 +x2 – s2 = -15, must be transformed to
-2x1 - x2 + s2 = 15 (That is multiplying throughout by -1).

Step 4 – All variables must have non-negative values.


For example:
x1 +x2 ≤ 3 and x1 > 0; x2 is unrestricted in sign
Then x2 is written as x2 = x2’– x2’’ where x2’, x2’’ ≥ 0
Therefore the inequality takes the form of equation as
x1 + (x2’ – x2’’) + s1 = 3

7
Conversion of GLPP to standard form (SLPP)- Examples
Dr. Árpád Török, Gábor Pauer
Step 1- Objective function should be in maximization form
Step 2- Convert all inequalities as equations
Step 3- The right side of constraints should be non-negative
Step 4- All variables should be non-negative

EXAMPLE 1: SOLUTION OF EXAMPLE 1:

GLPP: SLPP:
Minimize Z = 3x1 + x2 Maximize -Z = -3x1 - x2
Subject to Subject to
2x1 + x2 ≤ 2 2x1 + x2 + s1 = 2
3x1 + 4x2 ≥ 12 3x1 + 4x2 –s2 = 12
and x1 ≥ 0, x2 ≥ 0 and x1 ≥ 0, x2 ≥ 0, s1 ≥ 0, s2 ≥ 0

8
Conversion of GLPP to standard form (SLPP)- Examples
Dr. Árpád Török, Gábor Pauer
Step 1- Objective function should be in maximization form
Step 2- Convert all inequalities as equations
Step 3- The right side of constraints should be non-negative
Step 4- All variables should be non-negative
EXAMPLE 2: PART-SOLUTION
SOLUTION OF EXAMPLE OF EXAMPLE 2: 2:
GLPP: (after
SLPP: Step 3)
Minimize Z = x1 + 2x2 + 3x3 SLPP:
Maximize -Z = – x1 – 2x2 – 3(x3’-x3’’)
Subject to Maximize
Subject to-Z = – x1 – 2x2 – 3x3
2x1 + 3x2 + 3x3 ≥ – 4 Subject to
–2x1 – 3x2 – 3(x3’-x3’’) + s1= 4
3x1 + 5x2 + 2x3 ≤ 7 –2x1 – 3x2 – 3x3 + s1= 4
3x1 + 5x2 + 2(x3’-x3’’) + s2 = 7
and x1, x2 ≥ 0, and 3x1 + 5x2 + 2x3 + s2 = 7
and x1 ≥ 0, x2 ≥ 0, x’3 ≥ 0,
x3 is unrestricted in sign and
x’’3 x≥10,
≥ 0,
s1 x≥20,≥ s0,2 ≥s10≥ 0, s2 ≥ 0,
x3 is unrestricted in sign
9
Conversion of GLPP to standard form (SLPP)- Examples
Dr. Árpád Török, Gábor Pauer
Step 1- Objective function should be in maximization form
Step 2- Convert all inequalities as equations
Step 3- The right side of constraints should be non-negative
Step 4- All variables should be non-negative

Convert the following GLPPs to standard form!


EXAMPLE 3: EXAMPLE 4:
Maximize Z = 4x1 + x2 Minimize Z = 3x1 + 2x2 - x3
Subject to Subject to
3x1 + x2 ≤ -3 -x1 + 3x2 + 3x3 ≥ – 6
x1 - x2 ≤ 20 3x1 - x2 + 2x3 ≥ 5
-x1 + 2x2 ≥ -11 and x1, x2 ≥ 0, and
and x1 ≥ 0, x2 ≥ 0 x3 is unrestricted in sign

10
Conversion of GLPP to standard form (SLPP)- Examples
Dr. Árpád Török, Gábor Pauer

SOLUTION OF EXAMPLE 3: SOLUTION OF EXAMPLE 4:


SLPP: SLPP:
Maximize Z = 4x1 + x2 Maximize -Z = – 3x1 – 2x2 + (x3’-x3’’)
Subject to Subject to
-3x1 - x2 - s1 = 3 x1 – 3x2 – 3(x3’-x3’’) + s1= 6
x1 - x2 + s2 = 20 3x1 - x2 + 2(x3’-x3’’) - s2 = 5
x1 - 2x2 + s3 = 11 x1 ≥ 0, x2 ≥ 0, x’3 ≥ 0, x’’3 ≥ 0,
x1 ≥ 0, x2 ≥ 0, s1 ≥ 0, s1 ≥ 0, s2 ≥ 0
s2 ≥ 0, s3 ≥ 0

11
Basic definitions
Solution of LPP Dr. Árpád Török, Gábor Pauer
Any set of variable (x1, x2… xn), which satisfies the given constraint is called solution of LPP.
Basic solution
Is a solution obtained by setting any ‘n’ variable equal to zero and solving remaining ‘m’
variables. Such ‘m’ variables are called Basic variables and ‘n’ variables are called Non-basic
variables.
Basic feasible solution
A basic solution that is feasible (all basic variables are nonnegative) is called basic feasible
solution. There are two types of basic feasible solution.
•Degenerate basic feasible solution: If any of the basic variable of a basic feasible
solution is zero than it is said to be degenerate basic feasible solution.
•Non-degenerate basic feasible solution: It is a basic feasible solution which has exactly
‘m’ positive xi, where i=1, 2,…m. In other words all ‘m’ basic variables are positive and
remaining ‘n’ variables are zero.
Optimum basic feasible solution
A basic feasible solution is said to be optimum if it optimizes (max / min) the objective
function.

12
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
a. Standard form
Minimize -z = -8x1 - 10x2 -7x3 b. Introducing
slack/surplus variables
Subject to c. Creating the table
(+check optimality)
x1 + 3x2 + 2x3 ≤ 10 d. Pivot variables
e. Creating a new table
-x1 - 5x2 - x3 ≥ -8 f. Checking for optimality
g. Identify optimal values

and x1, x2 , x3 ≥ 0

13
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
a. Standard form
Step a,b – Standard form+Introducing b. Introducing
slack/surplus variables slack/surplus variables
c. Creating the table
= the 4 steps of converting the GLPP to SLPP! (+check optimality)
d. Pivot variables
e. Creating a new table
f. Checking for optimality
g. Identify optimal values

Minimize -z = -8x1 - 10x2 -7x3 Maximize z = 8x1 + 10x2 +7x3


Subject to Subject to
x1 + 3x2 + 2x3 ≤ 10 x1 + 3x2 + 2x3 + s1 = 10
-x1 - 5x2 - x3 ≥ -8 x1 + 5x2 + x3 + s2 = 8
and x1, x2 , x3 ≥ 0 and x1, x2 , x3 , s1 s2 ≥ 0

14
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
Step c – Creating the table a. Standard form
•coefficients corresponding to the linear constraint b. Introducing
variables slack/surplus variables
•coefficients of the objective function (multiplied by c. Creating the table
(-1); in the column of ‘z’: we use 1 in case of max(z), (+check optimality)
and use -1 in case of max(-z)!) d. Pivot variables
e. Creating a new table
Maximize f. Checking for optimality
z = 8x1 + 10x2 +7x3 g. Identify optimal values
Subject to
x1 + 3x2 + 2x3 + s1 = 10
x1 + 5x2 + x3 + s2 = 8
and x1, x2 , x3,
s 1, s 2 ≥ 0

15
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
Step c – (+check optimality) a. Standard form
•Optimal solution: the values assigned to the b. Introducing
variables in the objective function to give the slack/surplus variables
c. Creating the table
largest zeta value (+check optimality)
•Check optimality using the table: all values d. Pivot variables
e. Creating a new table
in the last row must contain values greater f. Checking for optimality
than or equal to zero g. Identify optimal values

Not optimal yet


16
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
Step d – Pivot variables a. Standard form
•Pivot variable is used to identify, which variable will b. Introducing
become the unit value (key factor in conversion) slack/surplus variables
c. Creating the table
•Identifying pivot variable using the table: in the
(+check optimality)
column of the smallest negative value in bottom d. Pivot variables
row; in the row of the smallest non-negative e. Creating a new table
indicator (indicator: divide the beta values of the f. Checking for optimality
linear constraints by their corresponding values g. Identify optimal values
from the column containing the possible pivot
variable)

Smallest
Smallest neg.
non-negative 17
value
indicator
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
Step e – Creating the new table a. Standard form
I. To optimize the pivot variable, it will need to be b. Introducing
transformed into a unit value (value of 1) slack/surplus variables
c. Creating the table
II. The other values in the column containing the
(+check optimality)
unit value have to become zero d. Pivot variables
III. During this, the table have to be kept e. Creating a new table
equivalent f. Checking for optimality
g. Identify optimal values

New tableau value = (Negative value in old tableau pivot column) x


(value in new tableau pivot row) + (Old tableau value)

 The new table will be used to identify a new possible


optimal solution

18
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
Step e – Creating the new table
I. To optimize the pivot variable, it will need to be transformed into a unit value (value of 1)
II. The other values in the column containing the unit value have to become zero
III. During this, the table have to be kept equivalent

New tableau value = (Negative value in old tableau pivot column) x (value in new
tableau pivot row) + (Old tableau value)

The initial table:

The new table:

19
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
Step e – Creating the new table
New tableau value = (Negative value in old tableau pivot column) x (value in new
tableau pivot row) + (Old tableau value)

2/5= (-3) * (1/5) + 1

The initial table:

The new table:

20
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
Step e – Creating the new table
New tableau value = (Negative value in old tableau pivot column) x (value in new
tableau pivot row) + (Old tableau value)

2= (+10) * (1/5) + 0

The initial table:

The new table:

21
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
Step f – Checking for optimality a. Standard form
•Check optimality using the table: all values b. Introducing
in the last row must contain values greater slack/surplus variables
c. Creating the table
than or equal to zero (+check optimality)
d. Pivot variables
e. Creating a new table
f. Checking for optimality
g. Identify optimal values

Not optimal yet


22
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
Step d (again) – Pivot variables a. Standard form
•Identifying pivot variable using the table: in the b. Introducing
column of the smallest negative value in bottom row; in slack/surplus variables
the row of the smallest non-negative indicator c. Creating the table
(indicator: divide the beta values of the linear (+check optimality)
constraints by their corresponding values from the d. Pivot variables
column containing the possible pivot variable) e. Creating a new table
f. Checking for optimality
g. Identify optimal values

Smallest
non-negative
Smallest neg.
indicator
value
23
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
Step e (again) – Creating the new table
I. To optimize the pivot variable, it will need to be transformed into a unit value (value of 1)
II. The other values in the column containing the unit value have to become zero
III. During this, the table have to be kept equivalent

New tableau value = (Negative value in old tableau pivot column) x (value in new
tableau pivot row) + (Old tableau value)

The old table:

Old pivot column

The new table: New


pivot row
24
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
Step f (again) – Checking for optimality a. Standard form
•Check optimality using the table: all values b. Introducing
in the last row must contain values greater slack/surplus variables
c. Creating the table
than or equal to zero (+check optimality)
d. Pivot variables
e. Creating a new table
f. Checking for optimality
g. Identify optimal values

OPTIMALITY REACHED

25
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
Step g – Identifying optimal values a. Standard form
•Basic variable: have a single 1 value in its b. Introducing
column and the rest are zeros; the row that slack/surplus variables
c. Creating the table
contains the 1 value will correspond to the (+check optimality)
beta value. The beta value will represent the d. Pivot variables
optimal solution for the given variable e. Creating a new table
f. Checking for optimality
•Non-basic variable: the remaining variables; g. Identify optimal values
the optimal solution of the non-basic
variables is zero

26
Solving a linear programming model using the Simplex
method
Dr. Árpád Török, Gábor Pauer
Step g – Identifying optimal values a. Standard form
•Basic variables b. Introducing
•Non-basic variables slack/surplus variables
c. Creating the table
(+check optimality)
d. Pivot variables
e. Creating a new table
f. Checking for optimality
g. Identify optimal values
Original task: Solution:
Maximize z = 8x1 + 10x2 +7x3 Max(z) = 64
Subject to Subject to
x1 + 3x2 + 2x3 + s1 = 10 x1 = 8 s1= 2
x1 + 5x2 + x3 + s2 = 8 x2 = 0 s2= 0
and x1, x2 , x3, s1, s2 ≥ 0 x3 = 0

27
Example 2- Solving a linear programming model
using the Simplex method
Dr. Árpád Török, Gábor Pauer
a. Standard form
Maximize Z = 3x1 + 2x2 b. Introducing
slack/surplus variables
Subject to c. Creating the table
(+check optimality)
x1 + x 2 ≤ 4 d. Pivot variables
e. Creating a new table
x1 - x2 ≤ 2 f. Checking for optimality
g. Identify optimal values

and x1, x2 ≥ 0

28
Example 2- Solving a linear programming model
using the Simplex method
Dr. Árpád Török, Gábor Pauer
a. Standard form
Step a,b – Standard form+Introducing b. Introducing
slack/surplus variables slack/surplus variables
c. Creating the table
(+check optimality)
d. Pivot variables
e. Creating a new table
f. Checking for optimality
g. Identify optimal values
Maximize Z = 3x1 + 2x2 Maximize Z = 3x1 + 2x2
Subject to Subject to
x1 + x 2 ≤ 4 x1 + x 2 + s 1 = 4
x1 - x2 ≤ 2 x1 - x2 + s2= 2
and x1, x2 ≥ 0 and x1, x2, s1, s2 ≥ 0
29
Example 2- Solving a linear programming model using the
Simplex method
Dr. Árpád Török, Gábor Pauer
Step c – Creating the table (+check optimality) a. Standard form
b. Introducing
slack/surplus variables
Maximize Z = 3x1 + 2x2 c. Creating the table
Subject to (+check optimality)
d. Pivot variables
x1 + x2 + s1 = 4 e. Creating a new table
f. Checking for optimality
x1 - x2 + s2= 2 g. Identify optimal values
and
x1, x2, s1, s2 ≥ 0 x1 x2 s1 s2 Z b
1 1 1 0 0 4
1 -1 0 1 0 2
-3 -2 0 0 1 0
Not optimal yet
30
Example 2- Solving a linear programming model
using the Simplex method
Dr. Árpád Török, Gábor Pauer
Step d – Pivot variables a. Standard form
Identifying pivot variable using the table: in the column b. Introducing
slack/surplus variables
of the smallest negative value in bottom row; in the row
c. Creating the table
of the smallest non-negative indicator (indicator: divide (+check optimality)
the beta values of the linear constraints by their d. Pivot variables
corresponding values from the column containing the e. Creating a new table
possible pivot variable) f. Checking for optimality
g. Identify optimal values
x1 x2 s1 s2 Z b Indicator
1 1 1 0 0 4 4/1=4
1 -1 0 1 0 2 2/1=2 Smallest non-negat. indicator

-3 -2 0 0 1 0
Smallest
neg.
value
31
Example 2- Solving a linear programming model using the
Simplex method
Dr. Árpád Török, Gábor Pauer
Step e – Creating the new table
I. To optimize the pivot variable, it will need to be transformed into a unit value (value of 1)
II. The other values in the column containing the unit value have to become zero
III. During this, the table have to be kept equivalent

New tableau value = (Negative value in old tableau pivot column) x (value in new
tableau pivot row) + (Old tableau value)
x1 x2 s1 s2 Z b
1 1 1 0 0 4
The old table:
1 -1 0 1 0 2
-3 -2 0 0 1 0
Old pivot column
x1 x2 s1 s2 Z b
The new 0 2 1 -1 0 2
table: New
1 -1 0 1 0 2
pivot row
32
0 -5 0 3 1 6
Example 2- Solving a linear programming model using the
Simplex method
Dr. Tobor Sipos, Anteneh Afework
Step f – Checking for optimality a. Standard form
•Check optimality using the table: all values b. Introducing
in the last row must contain values greater slack/surplus variables
c. Creating the table
than or equal to zero (+check optimality)
d. Pivot variables
e. Creating a new table
f. Checking for optimality
g. Identify optimal values

x1 x2 s1 s2 Z b
0 2 1 -1 0 2
1 -1 0 1 0 2
0 -5 0 3 1 6

Not optimal yet


33
Example 2- Solving a linear programming model
using the Simplex method
Dr. Árpád Török, Gábor Pauer
Step d (again) – Pivot variables a. Standard form
Identifying pivot variable using the table: in the column b. Introducing
slack/surplus variables
of the smallest negative value in bottom row; in the row
c. Creating the table
of the smallest non-negative indicator (indicator: divide (+check optimality)
the beta values of the linear constraints by their d. Pivot variables
corresponding values from the column containing the e. Creating a new table
possible pivot variable) f. Checking for optimality
g. Identify optimal values

x1 x2 s1 s2 Z b Indicator
0 2 1 -1 0 2 2/2=1Smallest non-negat.
indicator
1 -1 0 1 0 2 2/(-1)= -2 (neglect if negative!!)
0 -5 0 3 1 6
Smallest
neg.
value 34
Example 2- Solving a linear programming model using the
Simplex method
Dr. Árpád Török, Gábor Pauer
Step e (again) – Creating the new table + Step f (again) – Checking for optimality
I. To optimize the pivot variable, it will need to be transformed into a unit value (value of 1)
II. The other values in the column containing the unit value have to become zero
III. During this, the table have to be kept equivalent
New tableau value = (Negative value in old tableau pivot column) x (value in new
tableau pivot row) + (Old tableau value)
x1 x2 s1 s2 Z b
0 2 1 -1 0 2
The old table:
1 -1 0 1 0 2
0 -5 0 3 1 6

Old pivot column


x1 x2 s1 s2 Z b
The new New
0 1 ½ -½ 0 1 pivot row
table:
1 0 ½ ½ 0 3
0 0 5/2 ½ 1 11
35
OPTIMALITY REACHED
Example 2- Solving a linear programming model
using the Simplex method
Dr. Árpád Török, Gábor Pauer
Step g – Identifying optimal values a. Standard form
•Basic variables b. Introducing
•Non-basic variables slack/surplus variables
c. Creating the table
x1 x2 s1 s2 Z b (+check optimality)
0 1 ½ -½ 0 1 d. Pivot variables
e. Creating a new table
1 0 ½ ½ 0 3
f. Checking for optimality
0 0 5/2 ½ 1 11 g. Identify optimal values

Original task: Solution:


Maximize Z = 3x1 + 2x2 Max(z) = 11
Subject to Subject to
x1 + x2 + s1 = 4 x1 = 3 s1= 0
x1 - x2 + s2= 2 x2 = 1 s2= 0
and
x1, x2, s1, s2 ≥ 0 36
Example 2- Solving a linear programming model
using the Excel software
Dr. Árpád Török, Gábor Pauer
Maximize Z = 3x1 + 2x2
Subject to
x1 + x2 ≤ 4
x1 - x2 ≤ 2
and x1, x2 ≥ 0

37
Example 2- Solving a linear programming model
using the MATLAB software
Dr. Árpád Török, Gábor Pauer
Tutorial:
https://www.mathworks.com/help/optim/
ug/linprog.html?requestedDomain=www.
mathworks.com#zmw57dd0e65600

Syntax:
x= linprog(f,A,b,Aeq,beq,lb,ub)
Finds the minimum of a problem, taking the
constraints and bounds into account.

Where:
f: coefficient vector, represents the objective function;
A, b: linear inequality constraints (encodes A*x <= b); Set A=[] and b=[] if no inequ. exists.
Aeq, beq: linear equality constraints (encodes Aeq*x=beq); Aeq=[] and beq=[] if no equ. exists
lb: lower bounds of x (encodes x(i) >= lb(i) for all i);
38
ub: upper bounds of x (encodes x(i) =< ub(i) for all i).
Example 2- Solving a linear programming model
using the MATLAB software
Dr. Árpád Török, Gábor Pauer
In MATLAB, we need the problem in minimization form, and the
constraining inequalities in ≤ form!

Maximize Z = 3x1 + 2x2

Min -Z= -3x1 – 2x2


Subject to
x1 + x 2 ≤ 4
x1 - x2 ≤ 2
and x1, x2 ≥ 0

39
Example 3- Solve the following LPP!
Dr. Árpád Török, Gábor Pauer

Solve the following LPP by hand, a. Standard form


b. Introducing
by Excel and by MATLAB! slack/surplus variables
c. Creating the table
(+check optimality)
Maximize Z = 5x1 + 7x2 d. Pivot variables
e. Creating a new table
Subject to f. Checking for optimality
g. Identify optimal values
x1 + x 2 ≤ 4
-3x1 + 8x2 ≥ -24
10x1 + 7x2 ≤ 35
and x1, x2 ≥ 0
40
Example 3- Solution
Dr. Árpád Török, Gábor Pauer

Solution:
Pivot variable: 1st row 2nd column (value 1)
Basic variables: x2, s2, s3, Z
Non-basic variables: x1, s1
Final solution: x1=0; x2=4; Z=28

41
BUDAPEST UNIVERSITY OF
TECHNOLOGY AND ECONOMICS
Dr. Tibor SIPOS Ph.D.
Anteneh Afework
Zsombor SZABÓ
2019
email: [email protected]

BME FACULTY OF TRANSPORTATION ENGINEERING AND VEHICLE ENGINEERING


32708-2/2017/INTFIN COURSE MATERIAL SUPPORTED BY EMMI

You might also like