Lectures PDF
Lectures PDF
OPTIMIZATION
What is optimization?
Linear programming:
• Linear programming is the name of a branch of applied
mathematics that deals with solving optimization problems of
a particular form.
• Linear programming problems consist of a linear cost function
(consisting of a certain number of variables), which is to be
minimized or maximized subject to a certain number of
constraints.
History:
1 Kilo of the 1st nutrition cost 4 rubles & 1 kilo of the 2nd
nutrition costs 6. It is necessary to combine daily food
allowances having the smallest possible cost & satisfy
these nutritional requirements
Solution:
Let x & y be the quantities of feed I & II. The objective
function is to minimize the cost while satisfying the
nutritional requirements.
Therefore, Z (X)= 4x+ 6y min
• The main reason that we care about standard form is that this
form is the starting point for the simplex method, which is the
primary method for solving linear programs.
• In addition, it is good practice for students to think about
transformations, which is one of the key techniques used in
mathematical modeling.
Steps to follow to convert Linear-
programming problem to standard form:
Step 1:
Solution:
Let us transform the constraint system by Jordan-Gauss
Method & exclude pivot variables from the objective
function.
Note: Don’t choose the coefficient of the objective
function as pivot.
Geometric Method
MANY PRACTICAL PROBLEMS involve maximizing or minimizing
a function subject to certain constraints.
For example, we may wish to maximize a profit function subject
to certain limitations on the amount of material and labor
available. Maximization or minimization problems that can be
formulated in terms of a linear objective function and
constraints in the form of linear inequalities are called linear
programming problems. In this chapter, we look at linear
programming problems involving two variables. These problems
are amenable to geometric analysis, and the method of solution
introduced here will shed much light on the basic nature of a
linear programming problem
Problem with two Variables:
Steps for Solving a Linear Programming Problem
1. Translate the problem into mathematical terms
2. Graph the feasible set described by the constraint inequalities
and finds the coordinates of all the corner points. If the region is
unbounded, determine whether it’s possible for the objective
function to obtain the desired extreme value. If not, write “no
solution”. Otherwise go to step 3.
3. Evaluate the objective function at each of the corner points.
4. Find the corner point that makes the objective function a
maximum (minimum). If there’s only one such corner point then
the value of the objective function at that point is the maximum
(minimum). If there are two adjacent corner points that
maximize (minimize) the objective function then the maximum
(minimum) value of the objective function occurs at any point
on the line segment joining the two corner points.
Examples:
x + y ≤ 40
x + 2y ≤60
x≥0
y≥ 0
Figure illustrates the set of feasible points, which is bounded.
The corner points of the set of feasible points are
(0, 0) (0, 30)
(40, 0) (20, 20)
Table lists the corresponding values of the objective equation
Before the simplex algorithm can be applied, the linear program must be
converted into standard form where all the constraints are written as
equations (no inequalities) and all variables are nonnegative (no
unrestricted variables). This process of converting a linear program to its
standard form requires the addition of slack variable s which represents
i
the amount of the resource not used in the ith ≤constraint. Similarly,
≥constraints can be converted into standard form by subtracting excess
variable e .
i
The standard form of any linear program can then be represented by the
following linear system with n variables (including decision, slack and excess
variables) and m constraints.
Algorithm for the Simplex Method
The simplex algorithm, instead of evaluating all basic feasible solutions
(which can be prohibitive even for moderate-size problems), starts with a
basic feasible solution and moves through other basic feasible solutions
that successively improve the value of the objective function. The
algorithm terminates once the optimal value is reached. Below we
present a step-wise description of the simplex algorithm.
1. Convert the linear program into standard form.
2. Obtain a basic feasible solution from the standard form.
3. Determine if the basic feasible solution is optimal.
4. If the current basic feasible solution is not optimal, select a non-basic
variable that should become a basic variable and basic variable which
should become a non-basic variable to determine a new basic feasible
solution with an improved objective function value.
5. Use elementary row operations to solve for the new basic feasible
solution. Return to Step 3
Steps 1 and 2 of the algorithm have been previously discussed. Steps 3, 4
and 5 of the algorithm are best executed with the help of a tableau which
is simply a table with a particular format that shows a summary of the
key information regarding the linear program.
Basic and Non-basic Variables, and Basic Feasible
Solutions :
If we define,
Objective Function: =
P 70 x1 + 50 x2
4 x1 + 3 x2 ≤ 240
Carpentry Constraint:
2 x1 + 1x2 ≤ 100
Finishing Constraint:
x1 , x2 ≥ 0
Non-negativity conditions:
The first step of the simplex method, requires that each
inequality be converted into an equality.
4 x1 + 3x2 + s1 + 0s2 =
240
2 x1 + x2 + 0s1 + s2 =
100
P − 70 x1 − 50 x2 − 0s1 − 0s2 =
0
Notes: All the variables are nonnegative Such a solution is called feasible.
x1 x2 S1 S2 P RHS
4 3 1 0 0 240
2 1 0 1 0 100
-70 -50 0 0 1 0
=x1 0,=
x2 0,=s1 240,=
s2 100,=P 0
The slack variables S1 and S2 form the initial solution mix. The initial
solution assumes that all avaliable hours are unused. i.e. The slack
variables takes the largest possible values.
Select the pivot column (determine which variable to
enter into the solution mix). Choose the column with
the “most negative” element in the objective function
row.
x1 x2 S1 S2 P RHS
4 3 1 0 0 240
2 1 0 1 0 100
-70 -50 0 0 1 0
Select the pivot row (determine which variable to
replace in the solution mix). Divide the last element
in each row by the corresponding element in the
pivot column. The pivot row is the row with the
smallest non-negative result
x1 x2 S1 S2 P RHS
4 3 1 0 0 240 240 / 4 = 60
2 1 0 1 0 100 100 / 2 = 50
-70 -50 0 0 1 0
After Solving,
x1 x2 S1 S2 P RHS
4 3 1 0 0 240
R2
1 1/2 0 1/2 0 50
2
-70 -50 0 0 1 0
x1 x2 S1 S2 P RHS
0 1 1 -2 0 40 −4.R2 + R1
1 1/2 0 1/2 0 50 70.R2 + R3
0 -15 0 35 1 3500
Now repeat the steps, till we will have not
negative element in the last row.
x1 x2 S1 S2 P RHS
0 1 1 -2 0 40 40 /1 = 40
0 -15 0 35 1 3500
x1 x2 S1 S2 P RHS
1
0 1 1 -2 0 40 − .R1 + R2
2
1 0 -1/2 3/2 0 30 15.R1 + R3
0 0 15 5 1 4100
=x1 30,= =
x2 40, s1 0,=s2 0
Subject to: x1 ≤ 4
2x2 ≤ 12
3x1 + 2x2 ≤ 18
x1 ≥0, x2 ≥ 0
Notes:
1. When you solve a simplex problem & find that slack variable
takes on a positive value. Basically, it because of when one of
the slack variables takes on a positive value it means that in
maximizing our objective function we stayed ”below” one of our
constraints.
For example, if u is the slack variable corresponding to a
constraint on labor hours used and the value of u is 12 in our
optimal solution, it means we have 12 remaining labor hours
available.
Primal
problem
Dual
problem
𝑎11
𝑎12
𝑎13
𝑎11
𝑏11
𝑐11
T
A=
𝑏11
𝑏12
𝑏13
A =
𝑎12
𝑏12
𝑐12
𝑐11
𝑐12
𝑐13
𝑎13
𝑏13
𝑐13
Minimiza0on
Problems
In
Previous
Examples,
we
applied
the
simplex
method
only
to
linear
programming
problems
in
standard
form
where
the
objec/ve
func/on
was
to
be
maximized.
In
this
sec/on,
we
extend
this
procedure
to
linear
programming
problems
in
which
the
objec/ve
func/on
is
to
be
minimized.
A
minimiza/on
problem
is
in
standard
form
if
the
objec/ve
func/on
is:
Von
Neumann
Duality
Principle
“The
objec1ve
value
w
of
a
minimiza1on
problem
in
standard
form
has
a
minimum
value
if
and
only
if
the
objec1ve
value
z
of
the
dual
maximiza1on
problem
has
a
maximum
value.
Moreover,
the
minimum
value
of
w
is
equal
to
the
maximum
value
of
z.
“
Solving
a
Minimiza0on
Problem
solve
this
problem
we
use
the
following
steps
To
Step
1.
Use
the
coefficients
and
constants
in
the
problem
constraints
and
the
objec/ve
func/on
to
form
a
matrix
A
with
the
coefficients
of
the
objec-‐/ve
func/on
in
the
last
row.
Step
2.
Interchange
the
rows
and
columns
of
matrix
A
to
form
the
matrix
AT,
the
transpose
of
A.
Step
3.
Use
the
rows
of
AT
to
form
a
maximiza/on
problem
with
≤
problem
constraints.
Example:
1.
Minimize
C
=
16
x1
+
9x2
+
21x3
subject
to
x1
+
x2
+
3x3
≥
12
2x1
+
x2
+x3
≥
16
x1,
x2,
x3
≥
0
Solu0on:
subject
to
2x1
+
5x2
≥
50
subject
to
2y1
+
y2
≤
16
x1
+
3x2
≥
27
5y1
+
3y2
≤
45
x1,
x2
≥
0
y1,y2
≥
0
Corner
Point
Corner
Point
(x1,
x2)
C=
16x1+45
x2
(y1,
y2)
P=50y1+27
y2
(0,10)
450
(0,0)
0
(15,4)
420
(0,15)
405
(27,0)
432
(3,10)
420
(8,0)
400
Min
C=420
at
(15,4)
Max
P=420
at
(3,10)
For
reasons
that
will
become
clear
later,
we
will
use
the
variables
x1
and
x2
from
the
original
problem
as
the
slack
variables
in
the
dual
problem:
2y1
+y2
+
s1=16
(ini/al
system
for
the
dual
problem)
5y1
+3y2+
s2=45
-‐50y1-‐27y2+
P
=0
Since
all
numbers
in
the
bogom
row
are
nonnega/ve,
the
solu/on
to
the
dual
problem
is
y1
=
3,
y2
=
10,
s1
=
0,
s2
=
0,
P
=
420
Furthermore,
examining
the
bot-‐tom
row
of
the
final
simplex
tableau,
we
see
the
same
op/mal
solu/on
to
the
mini-‐miza/on
problem
that
we
obtained
directly
by
the
geometric
method:
Min
C
=
420
at
s1
=
15,
s2
=
4
This
is
not
achieved
with
mistake.
An
op0mal
solu0on
to
a
minimiza0on
problem
always
can
be
obtained
from
the
boPom
row
of
the
final
simplex
tableau
for
the
dual
problem.
Note:
In
dual
problem,
we
will
choose
slack
Variable
as
solu/on.
Example
2:
(For
Prac0ce)
Example
3:
A
small
petroleum
company
owns
two
refineries.
Refinery
1
costs
$20,000
per
day
to
operate,
and
it
can
produce
400
barrels
of
high-‐grade
oil,
300
barrels
of
medium-‐grade
oil,
and
200
barrels
of
low-‐grade
oil
each
day.
Refinery
2
is
newer
and
more
modern.
It
costs
$25,000
per
day
to
operate,
and
it
can
produce
300
barrels
of
high-‐grade
oil,
400
barrels
of
medium-‐grade
oil,
and
500
barrels
of
low-‐grade
oil
each
day.
The
company
has
orders
totaling
25,000
barrels
of
high-‐
grade
oil,
27,000
barrels
of
medium-‐grade
oil,
and
30,000
barrels
of
low-‐grade
oil.
How
many
days
should
it
run
each
refinery
to
minimize
its
costs
and
s/ll
refine
enough
oil
to
meet
its
orders?
Arti.icial
Variables
Techniques
In
order
to
use
the
simplex
method,
a
BFS
is
needed.
To
remedy
the
predicament,
ar/ficial
variables
are
created.
These
variables
are
fic//ous
and
cannot
have
any
physical
meaning.
The
ar/ficial
variable
technique
is
a
device
to
get
the
star/ng
basic
feasible
solu/on,
so
that
simplex
procedure
may
be
adopted
as
usual
un/l
the
op/mal
solu/on
is
obtained.
To
solve
such
LPP
there
are
two
methods.
• The
Big
M
Method
or
Method
of
Penal/es.
• The
Two-‐phase
Simplex
Method.
Big
M
Method
1.
Modify
the
constraints
so
that
the
RHS
of
each
constraint
is
nonnega/ve.
Iden/fy
each
constraint
that
is
now
an
=
or
≥
constraint.
2.
Convert
each
inequality
constraint
to
standard
form
(add
a
slack
variable
for
≤
constraints,
add
an
excess
variable
for
≥
constraints).
3.
For
each
≥
or
=
constraint,
add
ar/ficial
variables.
Add
sign
restric/on
a ≥
0.
i
a
very
large
posi/ve
number.
Add
(for
each
4.
Let
M
denote
ar/ficial
variable)
Ma to
min
problem
objec/ve
func/ons
or
-‐Ma to
max
problem
i
objec/ve
func/ons.
i
each
ar/ficial
variable
will
be
in
the
star/ng
basis,
all
5.
Since
ar/ficial
variables
must
be
eliminated
from
row
0
before
beginning
the
simplex.
Remembering
M
represents
a
very
large
number,
solve
the
transformed
problem
by
the
simplex.
NOTE:
If
all
ar/ficial
variables
in
the
op/mal
solu/on
equal
zero,
the
solu/on
is
op/mal.
If
any
ar/ficial
variables
are
posi/ve
in
the
op/mal
solu/on,
the
problem
is
infeasible.
NOTE
:
Why
we
have
to
subtract
or
add
M
from
Objec8ve
func8on?
To
prevent
an
ar/ficial
variable
from
becoming
part
of
an
op/mal
solu/on
to
the
original
problem,
a
very
large
"penalty"
is
introduced
into
the
objec/ve
func/on.
This
penalty
is
created
by
choosing
a
posi/ve
constant
M
so
large
that
the
ar/ficial
variable
is
forced
to
be
0
in
any
final
op/mal
solu/on
of
the
original
problem.
Example:
we
introduce
an
ar/ficial
variable
a into
the
equa/on
involving
the
surplus
variable
s :
1
2
For
a
system
tableau
to
be
considered
an
ini0al
simplex
tableau,
it
must
sa/sfy
the
following
two
requirements:
1.
The
requisite
number
of
basic
variables
must
be
selectable.
Each
basic
variable
must
correspond
to
a
column
in
the
tableau
with
exactly
one
nonzero
element.
Different
basic
variables
must
have
the
nonzero
entries
in
different
rows.
The
remaining
variables
are
then
selected
as
non-‐basic
variables.
2.
The
basic
solu/on
found
by
seong
the
non-‐basic
variables
equal
to
zero
is
feasible.
If
you
inspect
the
preliminary
tableau,
you
realize
that
the
problem
is
that
s has
a
nega/ve
coefficient
in
its
column.
We
need
to
replace
s as
a
basic
2
2
variable
by
something
else
with
a
posi/ve
coefficient.
We
choose
a .
1
Example:
Use
Big
M
method
to
solve
the
Turkey
Feed
Problem
as
given
in
Table:
Problem,
now,
has
eight
variables
and
three
constraints.
five
of
the
variables
have
to
be
zeroised
to
get
ini/al
basic
feasible
solu/on
to
the
'ar/ficial
system'.
Puong,
Since
all
z
coefficients
are
nega/ve
it
becomes
op/mal
solu/on
with
minimum
cost
31.20.
Hence,
the
minimum
cost
solu/on
is
to
purchase
8.4
pounds
of
brand
1
feed
and
4.8
pounds
of
brand
2
feed
per
turkey
per
month.
Examples
for
Prac0ce:
Two
Phase
Method
The
two-‐phase
method
is
another
method
to
handle
these
ar/ficial
variables.
Here
the
L.P.
problem
is
solved
in
two
phases.
PHASE I
In
this
phase
we
find
an
ini/al
basic
feasible
solu/on
to
the
original
problem.
For
this
all
ar/ficial
variables
are
to
be
driven
to
zero.
To
do
this
an
ar/ficial
(Auxiliary)
objec/ve
func/on
(r)
is
created
which
is
the
sum
of
all
the
ar/ficial
variables.
This
new
objec/ve
func/on
is
then
minimized,
subject
to
the
constraints
of
the
given
(original)
problem,
using
the
simplex
method.
At
the
end
of
phase
I,
two
cases
arise:
TWO
PHASE
METHOD
:
NO
FEASIBLE
SOLUTION
If
the
minimum
value
of
r
>
0,
and
at
least
one
ar/ficial
variable
appears
in
the
basis
at
a
posi/ve
level,
then
the
given
problem
has
no
feasible
solu/on
and
the
procedure
terminates.
!
!
Learning!objectives:!
!!
The$learning$objec/ves$of$this$chapter$are$
$
• $Introduc/on$to$Transporta/on$model$&$applica/ons.$
• $North$west$Corner$rule$to$solve$transporta/on$problem.$
• $Least$cost$Method$&$applica/on.$
• $Vogel's$approxima/on$method.$
Introduction:!
A$typical$transporta/on$problem$is$shown$in$Fig.$It$deals$
with$sources$where$a$supply$of$some$commodity$is$
available$and$des/na/ons$where$the$commodity$is$
demanded.$The$classic$statement$of$the$transporta/on$
problem$uses$a$matrix$with$the$rows$represen/ng$
sources$and$columns$represen/ng$des/na/ons.$The$
algorithms$for$solving$the$problem$are$based$on$this$
matrix$representa/on.$The$costs$of$shipping$from$
sources$to$des/na/ons$are$indicated$by$the$entries$in$
the$matrix.$If$shipment$is$impossible$between$a$given$
source$and$des/na/on,$a$large$cost$of$M$is$entered.$This$
discourages$the$solu/on$from$using$such$cells.$Supplies$
and$demands$are$shown$along$the$margins$of$the$
matrix.$$
As$in$the$example,$the$classic$transporta/on$
problem$has$total$supply$equal$to$total$
demand.$
Matrix$model$of$a$transporta/on$problem$
The$network$model$of$the$transporta/on$problem$is$
shown$in$Fig.$Sources$are$iden/fied$as$the$nodes$on$the$
leK$and$des/na/ons$on$the$right.$Allowable$shipping$
links$are$shown$as$arcs,$while$disallowed$links$are$not$
included.$
!
North!West!Corner!Rule!
$
The$North!West!corner!rule!is$a$method$for$
compu/ng$a$basic$feasible$solu/on$of$a$
transporta0on!problem,$where$the$basic$variables$
are$selected$from$the$North$–$West$corner$($i.e.,$
top$leK$corner$).$$
$
$
Steps!in!North!West!Corner!Rule!$
• Select$the$upper$leKPhand$corner$cell$of$the$transporta/on$
table$and$allocate$as$many$units$as$possible$equal$to$the$
minimum$between$available$supply$and$demand,$i.e.,$min(s1,$
d1).$$
• Adjust$the$supply$and$demand$numbers$in$the$respec/ve$
rows$and$columns.$$
• If$the$demand$for$the$first$cell$is$sa/sfied,$then$move$
horizontally$to$the$next$cell$in$the$second$column.$$
• If$the$supply$for$the$first$row$is$exhausted,$then$move$down$to$
the$first$cell$in$the$second$row.$$
• If$for$any$cell,$supply$equals$demand,$then$the$next$alloca/on$
can$be$made$in$cell$either$in$the$next$row$or$column.$$
• Con/nue$the$process$un/l$all$supply$and$demand$values$are$
exhausted.$$
Application:!
Find$the$ini/al$basic$feasible$solu/on$of$the$following$
transporta/on$problem$using$North$–$West$Corner$Method.$
Solu/on:$
$
$
Factory$ Warehouse$ Supply$
Solu/on:$1015$
Least!Cost!Method:!
This$method$usually$provides$a$be`er$ini/al$basic$
feasible$solu/on$than$the$NorthPWest$Corner$
method$since$it$takes$into$account$the$cost$
variables$in$the$problem.$
$
!
Steps!in!Least!Cost!Method!!
!Step1: Select the cell having lowest unit cost in the entire table
and allocate the minimum of supply or demand values in that
cell.
Step2: Then eliminate the row or column in which supply or
demand is exhausted. If both the supply and demand values
are same, either of the row or column can be eliminated.
In case, the smallest unit cost is not unique, then select the
cell where maximum allocation can be made.
Step3: Repeat the process with next lowest unit cost and
continue until the entire available supply at various sources
and demand at various destinations is satisfied.
Application:!
Find$the$ini/al$basic$feasible$solu/on$of$the$following$
transporta/on$problem$using$Least$Cost$Method$
Solu0on:!!
$
$
Factory$ Warehouse$ Supply$
F1$ 2$ 7$ 4$ 5$
F2$ *$ 3$ *$ 3$ 8$ 1$ 8/0$
F3$ 5$ 4$ 7$ 7$
F4$ 1$ 6$ 2$ 14$
F1$ *$ 2$ 7$ 4$ 5$
F2$ *$ 3$ *$ 3$ 8$ 1$ 8/0$
F3$ *$ 5$ 4$ 7$ 7$
F4$ 7$ 1$ 6$ 2$ 14/7$
F1$ *$ 2$ 7$ 4$ 5$
F2$ *$ 3$ *$ 3$ 8$ 1$ 8/0$
F3$ *$ 5$ 4$ 7$ 7$
F4$ 7$ 1$ *$ 6$ 7$ 2$ 14/7/0$
F1$ *$ 2$ 7$ 3$ 4$ 5/2$
F2$ *$ 3$ *$ 3$ 8$ 1$ 8/0$
F3$ *$ 5$ 4$ *$ 7$ 7$
F4$ 7$ 1$ *$ 6$ 7$ 2$ 14/7/0$
F1$ *$ 2$ 7$ 3$ 4$ 5/2$
F2$ *$ 3$ *$ 3$ 8$ 1$ 8/0$
F3$ *$ 5$ 7$ 4$ *$ 7$ 7/0$
F4$ 7$ 1$ *$ 6$ 7$ 2$ 14/7/0$
F1$ *$ 2$ 2$ 7$ 3$ 4$ 5/2/0$
F2$ *$ 3$ *$ 3$ 8$ 1$ 8/0$
F3$ *$ 5$ 7$ 4$ *$ 7$ 7/0$
F4$ 7$ 1$ *$ 6$ 7$ 2$ 14/7/0$
10$ 10$
$
$
10$ 50$
$
$
2.
All
alloca/ons
should
be
in
independent
posi/ons
i.e.
there
should
not
be
able
to
make
closed
loop
from
alloca/ons.
Which
one
Optimal
Solution?
In
last
lecture,
we
learn
about
Northeast
corner
method,
Least
cost
method
&
VAM
out
of
which
found
VAM
generate
more
op/mal
solu/on
but
it’s
not
always
beLer:
1. Stepping-‐stone method
It satisfied.