You are on page 1of 44

Mathematical Economics

PART III: Linear Programming

Hà Văn Hiếu

University of Economics and Law

23rd March 2022

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 1 / 38


Linear Programming - Example
One of the main products of the P & T COMPANY is canned peas.
The peas are prepared at three canneries and then shipped by
truck to four distributing warehouses.
The number of truckloads, along with the shipping cost per
truckload for each cannery-warehouse combination, is given in the
following table.

The problem now is to determine which plan for assigning these


shipments to the various cannery-warehouse combinations would
minimize the total shipping cost.
Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 2 / 38
Linear Programming - Example P2
Let Z denote the total shipping cost, and let
xij (i = 1, 2, 3; j = 1, 2, 3, 4) be the number of truckloads to be shipped
from cannery i to warehouse j.

This is a Linear programming problem.


Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 3 / 38
Linear Programming Problem (LPP)

The Linear Programming Problems (LPP) is a problem that is


concerned with finding the optimal value (i.e. either maximum or
minimum value) of a given linear function, which is referred as an
objective function. The objective function can contain several
variables, which are subjected to linear constraints.
A standard form of the model:
Maximize Z = c1 x1 + c2 x2 + · · · + cn xn
subject to
a11 x1 + a12 x2 + · · · + a1n xn ≤ b1
a21 x1 + a22 x2 + · · · + a2n xn ≤ b2
···
am1 x1 + am2 x2 + · · · + amn xn ≤ bm
and
x1 , x2 , . . . , xn ≥ 0

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 4 / 38


LPP - History

The problem of solving a system of linear


inequalities dates back at least as far as
Fourier, who in 1827 published a method for
solving them.
In 1939 a linear programming formulation of
a problem was given by the Soviet
mathematician and economist Leonid
Kantorovich, who also proposed a method for
solving it.
About the same time as Kantorovich, the
Dutch-American economist T. C. Koopmans
formulated classical economic problems as
linear programs. Kantorovich and Koopmans
later shared the 1975 Nobel prize in
economics.
Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 5 / 38
LPP - History 2

In 1947, George B. Dantzig invented the


simplex method that for the first time
efficiently tackled the LPP in most cases.
Neumann immediately conjectured the
theory of duality by realizing that the
problem he had been working in game theory
was equivalent.
In 1979, the LPP was first shown to be
solvable in polynomial time by Leonid
Khachiyan.
In 1984, Narendra Karmarkar introduced a
new interior-point method for solving
linear-programming problems.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 6 / 38


LPP - Other forms

The Standard form: A standard form of the model:


Maximize Z = c1 x1 + c2 x2 + · · · + cn xn
subject to
a11 x1 + a12 x2 + · · · + a1n xn ≤ b1
a21 x1 + a22 x2 + · · · + a2n xn ≤ b2
···
am1 x1 + am2 x2 + · · · + amn xn ≤ bm
and
x1 , x2 , . . . , xn ≥ 0

The other forms:


Minimizing rather than miximizing.
ai1 x1 + ai2 x2 + · · · + ain xn ≥ bi
ai1 x1 + ai2 x2 + · · · + ain xn = bi
xi unrestricted in sign.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 7 / 38


LPP - Terminology

Objective function: Z = c1 x1 + c2 x2 + · · · cn xn
Constraints, functional constraints or structural constraints,
nonnegativity constraints or nonnegativity conditions.
A solution is an n-tuple (α1 , α2 , . . . , αn ) ∈ Rn .
A feasible solution is a solution for which all the constraints are
satisfied.
A solution which is not a feasible solution is called an infeasible
solution.
The feasible region is the collection of all feasible solutions.
An optimal solution is a feasible solution that the most favorable
value of the objective function, i.e. the largest value for max
problem and the smallest value for the min problem.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 8 / 38


LPP - Terminology - 2

It is possible for a problem to have no feasible solutions.


Most problems will have just one optimal solution. However, it is
possible to have more than one. If so, the problem will have
infinite number of optimal solutions.
Another possibility is that a problem has no optimal solutions.
This occurs only if (1) it has no feasible solutions or (2) the
constraints do not prevent improving the value of the objective
function Z indefinitely in the favorable direction (positive or
negative). The latter case is referred to as having an unbounded Z
or an unbounded objective.
A corner-point feasible (CPF) solution is a solution that lies at a
corner of the feasible region.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 9 / 38


LPP - Terminology - Example

Empty feasible region:

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 10 / 38


LPP - Terminology - Example

Infinite optimal solutions:

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 10 / 38


LPP - Terminology - Example

No optimal solution:

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 10 / 38


LPP - Terminology - Example

Five CPF points:

Relationship between optimal


solutions and CPF solutions:
the best CPF solution must be an
optimal solution. Thus, if a
problem has exactly one optimal
solution, it must be a CPF
solution. If the problem has
multiple optimal solutions, at least
two must be CPF solutions.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 10 / 38


Assumptions of LPP

Proportionality assumption: The contribution of each activity to


the value of the objective function is proportional to the level of the
activity xj , as represented by the cj xj term in the objective
function. Similarly, the contribution of each activity to the
left-hand side of each functional constraint is proportional to the
level of the activity xj , as represented by the aij xj term in the
constraint. In the other words, the marginal values of the objective
function w.r.t. the activities are all constant.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 11 / 38


Assumptions of LPP - 2

Additivity assumption: Every function in a linear programming


model (whether the objective function or the function on the
left-hand side of a functional constraint) is the sum of the
individual contributions of the respective activities.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 12 / 38


Assumptions of LPP - 3

Divisibility assumption: Decision variables in a linear programming


model are allowed to have any values, including noninteger values,
that satisfy the functional and nonnegativity constraints. Thus,
these variables are not restricted to just integer values. Since each
decision variable represents the level of some activity, it is being
assumed that the activities can be run at fractional levels.
Mathematical models with the restriction that some of or all the
decision variables must be integer values are called integer
programming models.
Certainty assumption: The value assigned to each parameter of a
linear programming model is assumed to be a known constant.
For this reason it is usually important to conduct sensitivity
analysis after a solution is found that is optimal under the
assumed parameter values.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 13 / 38


Graphical method

Minimize Z = 3x1 + 5x2


subject to
x1 ≤ 4
2x2 ≤ 12
3x1 + 2x2 ≤ 18
x1 , x2 ≥ 0

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 14 / 38


Graphical method - 2

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 15 / 38


Graphical method - 3

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 16 / 38


The simplex method

The simplex method is an algebraic procedure. However, its


underlying concepts are geometric.

Optimal 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.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 17 / 38


The Essence of the Simplex method - 1

1 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
2 Solution concept 2: The simplex method is an iterative
algorithm (a systematic solution procedure that keeps repeating a
fixed series of steps, called an iteration, until a desired result has
been obtained) with the following structure.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 18 / 38


The Essence of the Simplex method - 2

Solution concept 3: Whenever possible, the initialization of the


simplex method chooses the origin to be the initial CPF solution.
Solution concept 4: Given a CPF solution, the simplex method
always chooses a CPF solution that is adjacent to the current one.
No other CPF solutions are considered.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 19 / 38


The Essence of the Simplex method - 3

Solution concept 5: After the current CPF solution is identified,


the simplex method identifies the rate of improvement in Z that
would be obtained by moving along the edge. 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.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 20 / 38


Practice

Apply the simplex method for the following problem:

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 21 / 38


Augmented forms - 1

By adding slack variables, we may bring any form of an LPP to its


augmented form:

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 22 / 38


Augmented forms - 2

An augmented solution is a solution for the original variables (the


decision variables) that has been augmented by the corresponding
values of the slack variables.
A basic solution is an augmented corner-point solution.
A basic feasible (BF) solution is an augmented CPF solution.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 23 / 38


Augmented solutions - example - p100

(3, 2) is a solution of the


original form and (3, 2, 1, 8, 5)
is the corresponding
augmented solution.
(4, 6) is a corner-point
infeasible solution and
(4, 6, 0, 0, −6) is its
corresponding basis solution.
(0, 6) is a CPF solution and
(0, 6, 4, 0, 6) is its
corresponding BF solution.
Exercise: Determine all the basis solutions and BF solutions.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 24 / 38


Basis Solutions
The number of variables − the number of equations = 2 =
the number of variables which have zero-values in the BF solution.
Thus, in order to determine a BF solution, two of the variables (called
the nonbasic variables) will be set equal to zero, and the other three
variables (called the basic variables) will be determined by solving the
system of three equations.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 25 / 38


Properties of Basis Solutions

A basic solution has the following properties:


1 Each variable is designated as either a nonbasic variable or a basic
variable.
2 The number of basic variables equals the number of functional
constraints (now equations). Therefore, the number of nonbasic
variables equals the total number of variables minus the number of
functional constraints.
3 The nonbasic variables are set equal to zero.
4 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.)
5 If the basic variables satisfy the nonnegativity constraints, the
basic solution is a BF solution.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 26 / 38


Properties of BF solutions
1 Two BF solutions are adjacent if all but one of their nonbasic
variables are the same. This implies that all but one of their basic
variables also are the same, although perhaps with different
numerical values.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 27 / 38


The Geometric and Algebraic interpretation of Simplex
method

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 28 / 38


Optimal test

The initial CPF solution (0, 0) yields the initial BF solution


(0, 0, 4, 12, 18). Basic variables: x3 , x4 , x5 and nonbasic variables:
x1 , x2 .
The objective function is Z = 3x1 + 5x2 takes the value 0 at the
initial BF solution. The coefficient of each nonbasic variable x1 , x2
gives the rate of improvement in Z. These rates of improvement (3
and 5) are positive. Therefore, we conclude that (0, 0, 4, 12, 18) is
not optimal.
For each BF solution examined after subsequent iterations, at least
one basic variable has a nonzero coefficient in the objective
function → new equation on objective function (based on just new
nonbasic variables) → new coefficients (or rate of improvements).
We will stop when the latest coefficients are not positive.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 29 / 38


Determining the Direction of Movement and Where to
stop (Step 1 and 2)
Z = 3x1 + 5x2
Increase in x1 Rate of improvement in Z is 3
Increase in x2 Rate of improvement in Z is 5 Choose x2 to increase.
x2 is called the entering basis variable for iteration 1.
x2 is converted to a basis variable (while keeping the nonbasic variable
x1 = 0)
x1 =0
x1 + x3 = 4 ⇔ x3 =4
2x2 + x4 = 12 ⇔ x4 = 12 − 2x2
3x1 + 2x2 + x5 = 18 ⇔ x5 = 18 − 2x2

Thus, x2 can be increased just to 6. These calculations are referred to as


the minimum ratio test. The basic variable in the equation with the
minimum ratio is the one that drops to zero first as the entering basic
variable is increased.
In summary, x4 is the leaving basis variable for iteration 1.
Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 30 / 38
Solving for the New BF Solution (Step 3 of Iteration 1)

Increasing x2 = 0 to x2 = 6 moves us from the initial BF solution


on the left to the new BF solution on the right of the following
table.
Initial BF solution New BF solution
Nonbasic variables x1 = x2 = 0 x1 = x4 = 0
Basic variables x3 = 4, x4 = 12, x5 = 18 x3 =?, x2 = 6, x5 =?
Let Z = 3x1 + 5x2 then


Z − 3x1 − 5x2 =0


 x 1 +x 3 =4


 2x2 + x4 = 12

 3x1 + 2x2 + x5 = 18

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 31 / 38


Solving for the New BF Solution - Iteration 1
Initial BF solution: (0, 0, 4, 12, 18). Objective function
Z = 3x1 + 5x2 . Nonbasic variables: x1 , x2 .

Z
 − 3x1 − 5x2 =0


 x1 + x3 =4


 2x2 + x4 = 12

 3x 1+ 2x 2 + x = 18
5
 5
Z − 3x1 − x4 = 30
2



x1 + x3 =4

⇔ 1

 x2 + x4 =6

 2
− x4

3x1 + x5 = 6

New BF solution: (0, 6, 4, 0, 6). Objective function


5
Z = 30 + 3x1 − x4 . Nonbasic variables: x1 , x4
2
Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 32 / 38
New basis variable - Iteration 2

5
Z = 30 + 3x1 − x4
2
Increase in x1 Rate of improvement is 3
Increase in x4 Rate of improvement is −4 < 0 Choose x1 to increase
x1 is now entering basis variable (while x4 = 0):

x4 = 0
x1 + x3 = 4 ⇔ x3 = 4 − x1
2x2 + x4 = 12 ⇔ x2 = 6
3x1 + 2x2 + x5 = 18 ⇔ x5 = 6 − 3x1

minimum ratio test is equal to 2. x5 is the leaving basis variable for


iteration 2.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 33 / 38


Solving for the New BF Solution (iteration 2)
Previous BF solution: (0, 6, 4, 0, 6). Objective function
5
Z = 30 + 3x1 − x4 . Nonbasic variables: x1 , x4 .
2
5

Z
 − 3x1 − x4 = 30

 2
x1 + x3 =4

1

 x2 + x4 =6

 2
3x1 − x4 + x5 = 6

3


 Z + x4 + x5 = 36

 2

 1 1
x3 + x4 − x5 = 2


⇔ 3 3
1

 x 2 + x 4 =6
2


1 1


x1 − x4 + x5 = 2


3 3
3
New BF solution: (2, 6, 2, 0, 0). Objective function Z = 36 − x4 − x5 .
2
Nonbasic variables: x4 , x5 .
Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 34 / 38
The Simplex method in Tabular form

Algebraic form of the problem

Choose the column which is corresponding to the largest absolute


value on coefficients of objective function.

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 35 / 38


The Simplex method in Tabular form - 2

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 36 / 38


The Simplex method in Tabular form - 2

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 36 / 38


The Simplex method in Tabular form - 2

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 36 / 38


The Simplex method in Tabular form - 2

More exercises: p152 - F. S. Hillier - Introduction to OR


Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 36 / 38
Projects

Game theory and Linear programming problem (project).


Leontief Input-Output model as a LPP (project).
Regional Planning (p47) (teamwork).
Controlling Air Pollution (p51) (teamwork).
Reclaiming Solid Wastes (p53) (teamwork)
Personnel Scheduling (p57) (teamwork).
Distributing Goods through a Distribution Network (p60)
(teamwork).
Solver-Excel (p65) (teamwork).

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 37 / 38


Any question?

Thank you!

Hà Văn Hiếu (UEL) Mathematical Economics 23rd March 2022 38 / 38

You might also like