Linear Problem (LP)
Rajib Bhattacharjya
Department of Civil Engineering
IIT Guwahati
Linear programming
It is an optimization method applicable for the solution of optimization problem
where objective function and the constraints are linear
It was first applied in 1930 by economist, mainly in solving resource allocation
problem
During World War II, the US Air force sought more effective procedure for allocation
of resources
George B. Dantzig, a member of the US Air Force formulate general linear problem
for solving the resources allocation problem.
The devised method is known as Simplex method
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Linear programming
It is considered as a revolutionary development that helps in obtaining optimal
decision in complex situation
Some of the great contributions are
George B. Dantzig : Devised simplex method
Kuhn and Tucker : Duality theory in LP
Charnes and Cooper: Industrial application of LP
Karmarkar : Karmarkar’s method
Nobel prize awarded for contribution related to LP
Nobel prize in economics was awarded in 1975 jointly to L.V. Kantorovich of the
former Soviet Union and T.C. Koopmans of USA on the application of LP to the
economic problem of resource allocation.
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Linear programming
Standard form of Linear Problem (LP)
Minimize ݂ ݔଵ , ݔଶ , ݔଷ , … , ݔ = ܿଵ ݔଵ + ܿଶ ݔଶ + ܿଷ ݔଷ +… + ܿ ݔ
Subject to
ܽଵଵ ݔଵ + ܽଵଶ ݔଶ + ܽଵଷ ݔଷ + ⋯ + ܽଵ ݔ = ܾଵ
ܽଶଵ ݔଵ + ܽଶଶ ݔଶ + ܽଶଷ ݔଷ + ⋯ + ܽଶ ݔ = ܾଶ
ܽଷଵ ݔଵ + ܽଷଶ ݔଶ + ܽଷଷ ݔଷ + ⋯ + ܽଷ ݔ = ܾଷ
⋮ ⋮ ⋮
ܽଵ ݔଵ + ܽଶ ݔଶ + ܽଷ ݔଷ + ⋯ + ܽ ݔ = ܾ
ݔଵ , ݔଶ , ݔଷ , … , ݔ ≥ 0
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Linear programming
Standard form of Linear Problem (LP) in Matrix form
Minimize ݂ ܺ = ܿ ் ܺ
Subject to
ܽܺ = ܾ
ܺ≥0
Where
ݔଵ ܾଵ ܿଵ ܽଵଵ ܽଵଶ ⋯ ܽଵ
ݔଶ ܾ ܿଶ ܽଶଵ ܽଶଶ ⋯ ܽଶ
ܺ= ⋮ ܾ= ଶ ܿ= ⋮ ܽ= ⋮ ⋮ ⋱ ⋮
⋮
ݔ ܾ ܿ ܽଵ ܽଶ ⋯ ܽ
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Linear programming
Characteristic of linear problem are
1. The objective function is minimization type
2. All constraints are equality type
3. All the decision variables are non-negative
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Linear programming
Characteristic of linear problem are
1. The objective function is minimization type
For maximization problem
Maximize ݂ ݔଵ , ݔଶ , ݔଷ , … , ݔ = ܿଵ ݔଵ + ܿଶ ݔଶ + ܿଷ ݔଷ +… + ܿ ݔ
Equivalent to
Minimize = ܨ−݂ ݔଵ , ݔଶ , ݔଷ , … , ݔ = −ܿଵ ݔଵ − ܿଶ ݔଶ − ܿଷ ݔଷ −… − ܿ ݔ
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Linear programming
Characteristic of linear problem are
2. All constraints are equality type
ܽଵ ݔଵ + ܽଶ ݔଶ + ܽଷ ݔଷ + ⋯ + ܽ ݔ = ܾ
If it is less than type If it is greater than type
ܽଵ ݔଵ + ܽଶ ݔଶ + ܽଷ ݔଷ + ⋯ + ܽ ݔ ≤ ܾ ܽଵ ݔଵ + ܽଶ ݔଶ + ܽଷ ݔଷ + ⋯ + ܽ ݔ ≥ ܾ
It can be converted to It can be converted to
ܽଵ ݔଵ + ܽଶ ݔଶ + ܽଷ ݔଷ + ⋯ + ܽ ݔ + ݔାଵ = ܾ ܽଵ ݔଵ + ܽଶ ݔଶ + ܽଷ ݔଷ + ⋯ + ܽ ݔ − ݔାଵ = ܾ
Slack variable Surplus variable
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Linear programming
Characteristic of linear problem are
3. All the decision variables are non-negative
ݔଵ , ݔଶ , ݔଷ , … , ݔ ≥ 0
Is any variable ݔ is unrestricted in sign, it can be expressed as
ݔ = ݔᇱ − ݔᇱᇱ
Where, ݔᇱ , ݔᇱᇱ ≥ 0
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Linear programming
There are ݉ equations and ݊ decision variable
Now see the conditions
If ݉ > ݊, there will be ݉ − ݊ redundant equations which can be eliminated
If ݉ = ݊, there will be an unique solution or there may not be any solution
If ݉ < ݊, a case of undetermined set of linear equations, if they have any
solution, there may be innumerable solutions
The problem of linear programming is to find out the best solution that satisfy
all the constraints
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Maximize ܿ = ݖଵ ݔ+ ܿଶ ݕ
Subject to
Infeasible
region
Infeasible region
Infeasible
Feasible
region
= ݖସ
Infeasible region
= ݖଶ = ݖଷ
= ݖଵ
Increasing z direction Maximize ܿ = ݖଵ ݔ+ ܿଶ ݕ
Subject to
Infeasible
region
As such solution of
the problem will
Infeasible region be one of the
corners of the
Infeasible
Feasible
search space
region
Infeasible region
= ݖଵ = ݖଶ = ݖଷ
Maximize ܿ = ݖଵ ݔ+ ܿଶ ݕ
Subject to
Infeasible
region
This problem has
infinite number of
Infeasible region solutions
Infeasible
Feasible
region
Infeasible region
= ݖଷ
= ݖଵ = ݖଶ
Maximize ܿ = ݖଵ ݔ+ ܿଶ ݕ
Subject to
Feasible region
Infeasible This is a problem
region Infeasible region of unbounded
solution
Infeasible region
Search space
Convex Search space Non Convex Search space
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Some definitions
Point of ݊ -Dimensional space
A point ܺ in an ݊ -dimensional space is characterized by an ordered set of
݊ values or coordinates. The coordinate of ܺ are also called the
component of ܺ.
Line segment in ݊-Dimensions (L)
If coordinates of two pints ܺଵ and ܺ ଶ are given, the line segment (L)
joining these points is the collection of points ܺ ߣ whose coordinates are
given by
ܺ ߣ = ߣܺଵ + 1 − ߣ ܺ ଶ
ଶ
ଵ
Thus L = ܺ|ܺ = ߣܺ + 1 − ߣ ܺ ଶ ܺ ଵ
ܺ ߣ ܺ
Rajib Bhattacharjya, IITG 0≥ߣ≥1 CE 602: Optimization Method
Some definitions
Hyperplane
In ݊ -dimensional space, the set of points whose coordinate satisfy a linear
equation
ܽଵ ݔଵ + ܽଶ ݔଵ + ܽଷ ݔଵ + ⋯ + ܽ ݔ = ்ܽ ܺ = ܾ
is called a hyperplane
A hyperplane is represented by
ܽ ܪ, ܾ = ܺ|்ܽ ܺ = ܾ
A hyperplane has ݊ − 1 dimensions in an ݊-dimensional space
It is a plane in three dimensional space
It is a line in two dimensional space
Rajib Bhattacharjya, IITG CE 602: Optimization Method
ܪା
30
25
20
15
10
Plane
ିܪ
5
ܪା = ܺ|்ܽ ܺ ≥ ܾ
0
10
8
0
6 2
4
4
ܾ ≤ ܺ ்ܽ|ܺ = ି ܪ
6
2
8
0 10
10
ିܪ
9
Line
ܪା
5
1
1 2 3 4 5 6 7 8 9 10
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Convex Set
A convex set is a collection of points such that if ܺଵ and ܺ ଶ are any two
points in the collection, the line segment joining them is also in the
collection, which can be defined as follows
If ܺଵ , ܺ ଶ ∈ ܵ, then ܺ ∈ ܵ
Where ܺ ߣ = ߣܺଵ + 1 − ߣ ܺ ଶ 0≥ߣ≥1
Vertex or Extreme point
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Feasible solution
In a linear programming problem, any solution that satisfy the conditions
ܽܺ = ܾ
ܺ≥0
is called feasible solution
Basic solution
A basic solution is one in which ݊ − ݉ variable are set equal to zero and
solution can be obtained for the ݉ number variable
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Basis
The collection of variables not set equal to zero to obtain the basic solution
is called the basis.
Basic feasible solution
This is the basic solution that satisfies the non-negativity conditions
Nondegenerate basic feasible solution
This is a basic feasible solution that has got exactly ݉ positive ݔ
Optimal solution
A feasible solution that optimized the objective function is called an
optimal solution
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Solution of system of linear simultaneous equations
ܽଵଵ ݔଵ + ܽଵଶ ݔଶ + ܽଵଷ ݔଷ + ⋯ + ܽଵ ݔ = ܾଵ Eଵ
ܽଶଵ ݔଵ + ܽଶଶ ݔଶ + ܽଶଷ ݔଷ + ⋯ + ܽଶ ݔ = ܾଶ Eଶ
ܽଷଵ ݔଵ + ܽଷଶ ݔଶ + ܽଷଷ ݔଷ + ⋯ + ܽଷ ݔ = ܾଷ Eଷ
⋮ ⋮ ⋮
ܽଵ ݔଵ + ܽଶ ݔଶ + ܽଷ ݔଷ + ⋯ + ܽ ݔ = ܾ E
Elementary operation
1. Any equation ܧ can be replaced by ݇ܧ , where ݇ is a non zero constant
2. Any equation ܧ can be replaced by ܧ + ݇ܧ௦ , where ܧ௦ is any other
equation
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Using these elementary row operation, a particular variable can be
eliminated from all but one equation. This operation is known as Pivot
operation
Using pivot operation, we can transform the set of equation to the following
form
1ݔଵ + 0ݔଶ + 0ݔଷ + ⋯ + 0ݔ = ܾଵᇱ
0ݔଵ + 1ݔଶ + 0ݔଷ + ⋯ + 0ݔ = ܾଶᇱ
0ݔଵ + 0ݔଶ + 1ݔଷ + ⋯ + 0ݔ = ܾଷᇱ
⋮ ⋮ ⋮
0ݔଵ + 0ݔଶ + 0ݔଷ + ⋯ + 1ݔ = ܾᇱ
Now the solution are
ݔ = ܾᇱ ݅ = 1,2,3, … , ݊
Rajib Bhattacharjya, IITG CE 602: Optimization Method
General system of equations
ܽଵଵ ݔଵ + ܽଵଶ ݔଶ + ܽଵଷ ݔଷ + ⋯ + ܽଵ ݔ = ܾଵ
ܽଶଵ ݔଵ + ܽଶଶ ݔଶ + ܽଶଷ ݔଷ + ⋯ + ܽଶ ݔ = ܾଶ
ܽଷଵ ݔଵ + ܽଷଶ ݔଶ + ܽଷଷ ݔଷ + ⋯ + ܽଷ ݔ = ܾଷ Pivotal variables
⋮ ⋮ ⋮ Non pivotal variables
ܽଵ ݔଵ + ܽଶ ݔଵ + ܽଷ ݔଵ + ⋯ + ܽ ݔ = ܾ
Constants
And ݊ > ݉
ᇱ ᇱ
1ݔଵ + 0ݔଶ + ⋯ + 0ݔ + ܽଵାଵ ݔାଵ + ⋯ + ܽଵ ݔ = ܾଵᇱ
ᇱ ᇱ
0ݔଵ + 1ݔଶ + ⋯ + 0ݔ + ܽଶାଵ ݔାଵ + ⋯ + ܽଶ ݔ = ܾଶᇱ
ᇱ ᇱ
0ݔଵ + 0ݔଶ + ⋯ + 0ݔ + ܽଷାଵ ݔାଵ + ⋯ + ܽଷ ݔ = ܾଷᇱ
⋮ ⋮ ⋮
ᇱ ᇱ ᇱ
0ݔଵ + 0ݔଶ + ⋯ + 1ݔ + ܽାଵ ݔାଵ + ⋯ + ܽ ݔ = ܾ
Rajib Bhattacharjya, IITG CE 602: Optimization Method
ᇱ ᇱ
1ݔଵ + 0ݔଶ + ⋯ + 0ݔ + ܽଵାଵ ݔାଵ + ⋯ + ܽଵ ݔ = ܾଵᇱ
ᇱ ᇱ
0ݔଵ + 1ݔଶ + ⋯ + 0ݔ + ܽଶାଵ ݔାଵ + ⋯ + ܽଶ ݔ = ܾଶᇱ
ᇱ ᇱ
0ݔଵ + 0ݔଶ + ⋯ + 0ݔ + ܽଷାଵ ݔାଵ + ⋯ + ܽଷ ݔ = ܾଷᇱ
⋮ ⋮ ⋮
ᇱ ᇱ ᇱ
0ݔଵ + 0ݔଶ + ⋯ + 1ݔ + ܽାଵ ݔାଵ + ⋯ + ܽ ݔ = ܾ
One solution can be deduced from the system of equations are
ݔ = ܾᇱ For ݅ = 1,2,3, … , ݉
ݔ = 0 For ݅ = ݉ + 1, ݉ + 2, ݉ + 3, … , ݊
This solution is called basis solution
Basic variable ݔ ݅ = 1,2,3, … , ݉
Non basic variable ݔ ݅ = ݉ + 1, ݉ + 2, ݉ + 3, … , ݊
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Now let’s solve a problem
2ݔଵ + 3ݔଶ − 2ݔଷ − 7ݔସ = 1 ܴ
ݔଵ + ݔଶ + ݔଷ + 3ݔସ = 6 ܴଵ
ݔଵ − ݔଶ + ݔଷ + 5ݔସ = 4 ܴଶ
3 7 1 1
ݔଵ + ݔଶ − ݔଷ − ݔସ = ܴଵ = ܴ
2 2 2 2
1 13 11
0 − ݔଶ + 2ݔଷ + ݔସ = ܴଵଵ = ܴଵ − ܴଵ
2 2 2
5 17 7
0 − ݔଶ + 2ݔଷ + ݔସ = ܴଶଵ = ܴଶ − ܴଵ
2 2 2
Rajib Bhattacharjya, IITG CE 602: Optimization Method
3
ݔଵ + 0 + 5ݔଷ + 16ݔସ = 17 ܴଶ = ܴଵ − ܴଵଶ
2
0 + ݔଶ − 4ݔଷ − 13ݔସ = −11 ܴଵଶ = −2ܴଵଵ
5
0 + 0 − 8ݔଷ −24ݔସ = −24 ܴଶଶ = ܴଶଵ + ܴଵଶ
2
ݔଵ + 0 + 0 + ݔସ = 2 ܴଶ = ܴଶ − 5ܴଶଶ
0 + ݔଶ + 0 − ݔସ = 1 ܴଵଷ = ܴଵଶ +4ܴଶଷ
1
0 + 0 + ݔଷ + 3ݔସ = 3 ܴଶଷ = − ܴଶଶ
8
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Solution of the problem is
ݔଵ = 2 − ݔସ
ݔଶ = 1 + ݔସ
ݔଷ = 3 − 3ݔସ
The solution obtain by setting independent variable equal to zero is
called basic solution.
ݔଵ = 2 ݔଶ = 1 ݔଷ = 3
Rajib Bhattacharjya, IITG CE 602: Optimization Method
2ݔଵ + 3ݔଶ − 2ݔଷ − 7ݔସ = 1 2ݔଵ + 3ݔଶ − 2ݔଷ − 7ݔସ = 1
ݔଵ + ݔଶ + ݔଷ + 3ݔସ = 6 ݔଵ + ݔଶ + ݔଷ + 3ݔସ = 6
ݔଵ − ݔଶ + ݔଷ + 5ݔସ = 4 ݔଵ − ݔଶ + ݔଷ + 5ݔସ = 4
ݔଵ = 2, ݔଶ = 1, ݔଷ = 3, ݔସ = 0 ݔଵ = 1, ݔଶ = 2, ݔଷ = 0, ݔସ = 1
2ݔଵ + 3ݔଶ − 2ݔଷ − 7ݔସ = 1 2ݔଵ + 3ݔଶ − 2ݔଷ − 7ݔସ = 1
ݔଵ + ݔଶ + ݔଷ + 3ݔସ = 6 ݔଵ + ݔଶ + ݔଷ + 3ݔସ = 6
ݔଵ − ݔଶ + ݔଷ + 5ݔସ = 4 ݔଵ − ݔଶ + ݔଷ + 5ݔସ = 4
ݔଵ = 3, ݔଶ = 0, ݔଷ = 6, ݔସ = −1 ݔଵ = 0, ݔଶ = 3, ݔଷ = −3, ݔସ = 2
Rajib Bhattacharjya, IITG CE 602: Optimization Method
How many combinations?
݊ ݊!
=
݉ ݊ − ݉ ! ݉!
The problem we have just solved has 4 combinations
Now consider a problem of 10 variables and 8 equations, we will
have 45 different combinations
If a problem of 15 variables and 10 equations, we will have 3003
different combinations
As such, it is not possible to find solutions for all the combinations
Moreover, many combinations, we may get infeasible solutions
As such we need some set of rules to switch from one feasible
solution another feasible solution
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Now before discussing any method, let’s try to solve a problem
Minimize −ݔଵ − 2ݔଶ − ݔଷ
Subject to
2ݔଵ + ݔଶ − ݔଷ ≤ 2 2ݔଵ + ݔଶ − ݔଷ +ݔସ =2
2ݔଵ − ݔଶ + 5ݔଷ ≤ 6 2ݔଵ − ݔଶ + 5ݔଷ + ݔହ =6
4ݔଵ + ݔଶ + ݔଷ ≤ 6 4ݔଵ + ݔଶ + ݔଷ +ݔ =6
ݔ ≥ 0 ݅ = 1,2,3
−ݔଵ − 2ݔଶ − ݔଷ −݂ = 0
The initial basic solution is ݔସ = 2 ݔହ = 6 = ݔ6 Basic variable
ݔଵ = ݔଶ = ݔଷ = 0 Non basic variable
Rajib Bhattacharjya, IITG ݂=0 CE 602: Optimization Method
Now look at the objective function
−ݔଵ − 2ݔଶ − ݔଷ −݂ = 0
Is it an optimal solution?
Can we improve the objective function value by making one non basic
variable as basic?
For this problem, all the coefficients of the objective function is
negative, as such making one of them as basic variable, we can
improve (reduce) the objective value.
However, making ݔଶ as basic variable we will have maximum advantage
So, select the variable with minimum negative coefficient
Rajib Bhattacharjya, IITG CE 602: Optimization Method
In our problem, ݔଶ is the new entering variable (basic variable)
Now, next question is which one will be pivoting element
2ݔଵ + ݔଶ − ݔଷ +ݔସ = 2 2ݔଵ + ݔଶ − ݔଷ + ݔସ =2
2ݔଵ − ݔଶ + 5ݔଷ + ݔହ =6 4ݔଵ + 0ݔଶ + 4ݔଷ + ݔସ + ݔହ =8
4ݔଵ + ݔଶ + ݔଷ +ݔ = 6 2ݔଵ + 0ݔଶ + 2ݔଷ −ݔସ + ݔ =4
−ݔଵ − 2ݔଶ − ݔଷ −݂ = 0 3ݔଵ + 0ݔଶ − 3ݔଷ + ݔସ −݂ = 4
The initial basic solution is ݔଶ = 2 ݔହ = 8 = ݔ4 Basic variable
ݔଵ = ݔଷ = ݔସ = 0 Non basic variable
Rajib Bhattacharjya, IITG
݂ = −4 CE 602: Optimization Method
2ݔଵ + ݔଶ − ݔଷ +ݔସ = 2 4ݔଵ + 0ݔଶ + 4ݔଷ + ݔସ +ݔହ =8
2ݔଵ − ݔଶ + 5ݔଷ + ݔହ = 6 −2ݔଵ + ݔଶ − 5ݔଷ − ݔହ = −6
4ݔଵ + ݔଶ + ݔଷ +ݔ = 6 6ݔଵ + 0ݔଶ + 6ݔଷ +ݔହ + = ݔ12
−ݔଵ − 2ݔଶ − ݔଷ −݂ = 0 −5ݔଵ + 0ݔଶ − 11ݔଷ − 2ݔହ − ݂ = −12
The initial basic solution is ݔଶ = −6 ݔସ = 8 = ݔ12 Basic variable
ݔଵ = ݔଷ = ݔହ = 0 Non basic variable
Rajib Bhattacharjya, IITG
݂ = −12 CE 602: Optimization Method
2ݔଵ + ݔଶ − ݔଷ +ݔସ = 2 −2ݔଵ + 0ݔଶ − 2ݔଷ + ݔସ − = ݔ−4
2ݔଵ − ݔଶ + 5ݔଷ + ݔହ =6 6ݔଵ + 0ݔଶ + 6ݔଷ + ݔହ + = ݔ12
4ݔଵ + ݔଶ + ݔଷ +ݔ =6 4ݔଵ + ݔଶ + ݔଷ + = ݔ6
−ݔଵ − 2ݔଶ − ݔଷ −݂ = 0 7ݔଵ + 0ݔଶ + ݔଷ + 2 ݔ− ݂ = 12
The initial basic solution is ݔଶ = 6 ݔସ = −4 ݔହ = 12 Basic variable
ݔଵ = ݔଷ = = ݔ0 Non basic variable
Rajib Bhattacharjya, IITG
݂ = +12 CE 602: Optimization Method
2ݔଵ + ݔଶ − ݔଷ +ݔସ =2
2ݔଵ − ݔଶ + 5ݔଷ + ݔହ =6
4ݔଵ + ݔଶ + ݔଷ +ݔ =6
Infeasible Infeasible
−ݔଵ − 2ݔଶ − ݔଷ −݂ = 0 solution solution
ݔଶ = 2 ݔହ = 8 = ݔ4 ݔଶ = −6 ݔସ = 8 = ݔ12 ݔଶ = 6 ݔସ = −4 ݔହ = 12
ݔଵ = ݔଷ = ݔସ = 0 ݔଵ = ݔଷ = ݔହ = 0 ݔଵ = ݔଷ = = ݔ0
݂ = −4 ݂ = −12 ݂ = +12
Now what is the rule, how to select the pivoting element?
Rajib Bhattacharjya, IITG CE 602: Optimization Method
What is the maximum value of ݔଶ without making ݔଶ negative?
2ݔଵ + ݔଶ − ݔଷ +ݔସ =2 ݔଶ = 2/1
2ݔଵ − ݔଶ + 5ݔଷ + ݔହ =6
4ݔଵ + ݔଶ + ݔଷ +ݔ =6 ݔଶ = 6/1
Select the minimum one to avoid infeasible solution
Thus the general rule is
1. Calculate the ratio (For ܽ௦ ≥ 0)
ೞ
∗ ݉݅݊݅݉݉ݑ
2. Pivoting element is ݔ௦ =
ܽ௦ ≥ 0 ೞ
Rajib Bhattacharjya, IITG CE 602: Optimization Method
2ݔଵ + ݔଶ − ݔଷ +ݔସ =2
2ݔଵ − ݔଶ + 5ݔଷ + ݔହ =6
4ݔଵ + ݔଶ + ݔଷ +ݔ =6
−ݔଵ − 2ݔଶ − ݔଷ −݂ = 0
Basic Variable
f bi bi/aij
Variable x1 x2 x3 x4 x5 x6
x4 2 1 -1 1 0 0 0 2 2
x5 2 -1 5 0 1 0 0 6
x6 4 1 1 0 0 1 0 6 6
f -1 -2 -1 0 0 0 -1 0
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Basic Variable
f bi bi/aij
Variable x1 x2 x3 x4 x5 x6
x2 2 1 -1 1 0 0 0 2
x5 4 0 4 1 1 0 0 8 2
x6 2 0 2 -1 0 1 0 4 2
f 3 0 -3 2 0 0 -1 4
Basic Variable
f bi bi/aij
Variable x1 x2 x3 x4 x5 x6
x2 3 1 0 1.25 0.25 0 0 4
x3 1 0 1 0.25 0.25 0 0 2
x6 0 0 0 -1.5 -0.5 1 0 0
f 6 0 0 2.75 0.75 0 -1 10
All ܿ are positive, so no improvement is possible
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Basic Variable
f bi bi/aij
Variable x1 x2 x3 x4 x5 x6
x2 2 1 -1 1 0 0 0 2
x5 4 0 4 1 1 0 0 8 2
x6 2 0 2 -1 0 1 0 4 2
f 3 0 -3 2 0 0 -1 4
Basic Variable
f bi bi/aij
Variable x1 x2 x3 x4 x5 x6
x2 3 1 0 0.5 0 0.5 0 4
x5 0 0 0 3 1 -2 0 0
x3 1 0 1 -0.5 0 0.5 0 2
f 6 0 0 0.5 0 1.5 -1 10
Obtain the same solution
Rajib Bhattacharjya, IITG CE 602: Optimization Method
SIMPLEX METHOD
ᇱ ᇱ
1ݔଵ + 0ݔଶ + ⋯ + 0ݔ + ܽଵାଵ ݔାଵ + ⋯ + ܽଵ ݔ = ܾଵᇱ
ᇱ ᇱ
0ݔଵ + 1ݔଶ + ⋯ + 0ݔ + ܽଶାଵ ݔାଵ + ⋯ + ܽଶ ݔ = ܾଶᇱ
ᇱ ᇱ
0ݔଵ + 0ݔଶ + ⋯ + 0ݔ + ܽଷାଵ ݔାଵ + ⋯ + ܽଷ ݔ = ܾଷᇱ
⋮ ⋮ ᇱ
⋮ ᇱ ᇱ
0ݔଵ + 0ݔଶ + ⋯ + 1ݔ + ܽାଵ ݔାଵ + ⋯ + ܽ ݔ = ܾ
ᇱ
0ݔଵ + 0ݔଶ + ⋯ + 0ݔ − ݂ + ܿାଵ ݔାଵ + ⋯ + ܿᇱ ݔ = −݂ᇱ
ݔ = ܾᇱ For ݅ = 1,2,3, … , ݉
ݔ = 0 For ݅ = ݉ + 1, ݉ + 2, ݉ + 3, … , ݊
݂ = ݂ᇱ
If the basic solution is feasible , then ܾᇱ ≥ 0 for ݅ = 1,2,3, … , ݉
Rajib Bhattacharjya, IITG CE 602: Optimization Method
From the last row
ᇱ
0ݔଵ + 0ݔଶ + ⋯ + 0ݔ − ݂ + ܿାଵ ݔାଵ + ⋯ + ܿᇱ ݔ = −݂ᇱ
We can write that
݂ = ݂ᇱ + ܿᇱ ݔ
ୀାଵ
If all ܿᇱ are positive, it is not possible to improve (reduce) the objective
function value by making a non basic variable as basic variable
Maximum benefit can be obtained by making the non-basic variable with
minimum negative coefficient as basic variable
In case of a tie, any one can be selected arbitrarily
Rajib Bhattacharjya, IITG CE 602: Optimization Method
ݔଵ = ܾଵᇱ − ܽଵ௦
ᇱ
ݔ௦ ܾଵᇱ ≥ 0
ݔଶ = ܾଶᇱ − ܽଶ௦
ᇱ
ݔ௦ ܾଶᇱ ≥ 0
⋮ ⋮ ⋮
ᇱ ᇱ ᇱ
ݔ = ܾ − ܽ௦ ݔ௦ ܾ ≥0
ᇱ
If ܽ௦ is positive, the maximum possible value of ݔ௦ is ܾᇱ /ܽ௦
ᇱ
ᇱ
If ܽ௦ is negative, the maximum possible value of ݔ௦ is +∞
In this case, the problem has an unbounded solution
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Example 1 (Unbounded solution)
Minimize f = −3ݔଵ − 2ݔଶ
Subject to
ݔଵ − ݔଶ ≤ 1 ݔଵ − ݔଶ + ݔଷ =1
3ݔଵ − 2ݔଶ ≤ 6 3ݔଵ − 2ݔଶ + ݔସ = 6
ݔ ≥ 0 ݅ = 1,2,3 ݔ ≥ 0 ݅ = 1,2,3
Basic Variable
f bi bi/aij
Variable x1 x2 x3 x4
x3 1 -1 1 0 0 1 1
x4 3 -2 0 1 0 6 2
f -3 -2 0 0 -1 0
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Basic Variable
f bi bi/ais
Variable x1 x2 x3 x4
x1 1 -1 1 0 0 1
x4 0 1 -3 1 0 3 3
f 0 -5 3 0 -1 3
Basic Variable
f bi bi/ais
Variable x1 x2 x3 x4
x1 1 0 -2 1 0 4
x2 0 1 -3 1 0 3
f 0 0 -12 5 -1 18
All ܽ are negative
Unbounded solution
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Example 2 (Alternate optimal solutions)
Minimize f = −40ݔଵ − 100ݔଶ
Subject to
10ݔଵ + 5ݔଶ ≤ 2500 10ݔଵ + 5ݔଶ + ݔଷ = 2500
4ݔଵ + 10ݔଶ ≤ 2000 4ݔଵ + 10ݔଶ + ݔସ = 2000
2ݔଵ + 3ݔଶ ≤ 900 2ݔଵ + 3ݔଶ + ݔହ = 900
ݔ ≥ 0 ݅ = 1,2,3 ݔ ≥ 0 ݅ = 1,2,3,4,5
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Basic Variable
Variable x1 x2 x3 x4 x5 f b bi/ais
x3 10 5 1 0 0 0 2500 500
x4 4 10 0 1 0 0 2000 200
x5 2 3 0 0 1 0 900 300
f -40 -100 0 0 0 -1 0
Solution is
Basic Variable
ݔଷ = 1500
Variable x1 x2 x3 x4 x5 f b bi/ais
x3 8 0 1 -0.5 0 0 1500 187.5 ݔଶ = 500
x2 0.4 1 0 0.1 0 0 200 500 ݔହ = 0
x5 0.8 0 0 -0.3 1 0 300 375
ݔଵ = ݔସ = 0
f 0 0 0 10 0 -1 20000
݂ = −20000
All ܿ are positive, so no improvement is possible
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Basic Variable
Variable x1 x2 x3 x4 x5 f b bi/ais
x1 1 0 0.125 -0.0625 0 0 187.5
x2 0 1 -0.05 0.125 0 0 125
x5 0 0 -0.1 -0.25 1 0 150
f 0 0 0 10 0 -1 20000
Solution is The problem has infinite number of
ݔଵ = 187.5 optimal solutions, which can be obtained
using the following equation
ݔଶ = 125
ݔହ = 0 ܺ ߣ = ߣܺଵ + 1 − ߣ ܺ ଶ
ݔଷ = ݔସ = 0
݂ = −20000
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Example 3 (Artificial variable)
Minimize f = 2ݔଵ + 3ݔଶ + 2ݔଷ − ݔସ + ݔହ
Subject to
3ݔଵ − 3ݔଶ + 4ݔଷ + 2ݔସ − ݔହ = 0 3ݔଵ − 3ݔଶ + 4ݔଷ + 2ݔସ − ݔହ + ݕଵ = 0
ݔଵ + ݔଶ + ݔଷ + 3ݔସ + ݔହ = 2 ݔଵ + ݔଶ + ݔଷ + 3ݔସ + ݔହ + ݕଶ = 2
ݔ ≥ 0 ݅ = 1,2, … , 5 ݔ ≥ 0 ݅ = 1,2, … , 5
ݕଵ , ݕଶ ≥ 0
ݕଵ and ݕଶ Artificial variable
Rajib Bhattacharjya, IITG CE 602: Optimization Method
3ݔଵ − 3ݔଶ + 4ݔଷ + 2ݔସ − ݔହ + ݕଵ =0
ݔଵ + ݔଶ + ݔଷ + 3ݔସ + ݔହ + ݕଶ =2
2ݔଵ + 3ݔଶ + 2ݔଷ − ݔସ + ݔହ −݂ =0
The Artificial variables have to be remove from the basis initially (Phase I)
This can be remove using the following formulation
Minimize ݕ = ݓଵ +ݕଶ
Now the problem
3ݔଵ − 3ݔଶ + 4ݔଷ + 2ݔସ − ݔହ + ݕଵ =0
ݔଵ + ݔଶ + ݔଷ + 3ݔସ + ݔହ + ݕଶ =2
2ݔଵ + 3ݔଶ + 2ݔଷ − ݔସ + ݔହ −݂ =0
ݕଵ + ݕଶ − ݓ =0
Rajib Bhattacharjya, IITG CE 602: Optimization Method
3ݔଵ − 3ݔଶ + 4ݔଷ + 2ݔସ − ݔହ + ݕଵ =0
ݔଵ + ݔଶ + ݔଷ + 3ݔସ + ݔହ + ݕଶ =2
2ݔଵ + 3ݔଶ + 2ݔଷ − ݔସ + ݔହ −݂ =0
−4ݔଵ + 2ݔଶ − 5ݔଷ − 5ݔସ + 0ݔହ − ݓ = −2
Basic Variable
Variable x1 x2 x3 x4 x5 y1 y2 f w b bi/ais
y1 3 -3 4 2 -1 1 0 0 0 0 0
y2 1 1 1 3 1 0 1 0 0 2 0.67
f 2 3 2 -1 1 0 0 -1 0 0
w -4 2 -5 -5 0 0 0 0 -1 -2
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Basic Variable
Variable x1 x2 x3 x4 x5 y1 y2 f w b bi/ais
x4 1.5 -1.5 2 1 -0.5 0.5 0 0 0 0
y2 -3.5 5.5 -5 0 2.5 -1.5 1 0 0 2 0.36
f 3.5 1.5 4 0 0.5 0.5 0 -1 0 0
w 3.5 -5.5 5 0 -2.5 2.5 0 0 -1 -2
Basic Variable
Variable x1 x2 x3 x4 x5 y1 y2 f w b bi/ais
x4 0.55 0 0.64 1 0.18 0.09 0.27 0 0 0.55
-
x2 0.64 1 -0.91 0 0.45 -0.27 0.18 0 0 0.36
f 4.45 0 5.36 0 -0.18 0.91 -0.27 -1 0 -0.55
w 0 0 0 0 0 1 1 0 -1 0
Rajib Bhattacharjya, IITG
All ܿ are positive, so no improvementCE 602:
is Optimization
possible Method
Phase II
Basic Variable bi/ais
Variable x1 x2 x3 x4 x5 f b
x4 0.55 0 0.64 1 0.18 0 0.55 3
x2 -0.64 1 -0.91 0 0.45 0 0.36 0.8
f 4.45 0 5.36 0 -0.18 -1 -0.55
Solution is
ݔସ = 0.4
Basic Variable bi/ais ݔହ = 0.8
ݔଵ = ݔଶ = ݔଵ = 0
Variable x1 x2 x3 x4 x5 f b
x4 0.8 -0.4 1 1 0 0 0.4
x5 -1.4 2.2 -2 0 1 0 0.8
f 4.2 0.4 5 0 0 -1 -0.4 ݂ = 0.4
All ܿ are positive, so no improvement is possible Optimal
Rajib Bhattacharjya, IITG CE 602: Optimization Method
solution
Example 4 (Unrestricted in sign)
Minimize ݂ = 4ݔଵ + 2ݔଶ Consider ݔଶ =ݔଷ − ݔସ
Subject to Where, ݔଷ , ݔସ ≥ 0
ݔଵ − 2ݔଶ ≥ 2 Now, the problem can be
ݔଵ + 2ݔଶ = 8 written as
ݔଵ − ݔଶ ≤ 11 Minimize ݂ = 4ݔଵ + 2ݔଷ − 2ݔସ
ݔଵ ≥ 0
Subject to
ݔଶ is unrestricted in sign ݔଵ − 2ݔଷ + 2ݔସ ≥ 2
ݔଵ + 2ݔଷ − 2ݔସ = 8
ݔଵ − ݔଷ + ݔସ ≤ 11
ݔ ≥ 0 ݅ = 1,3,4
Rajib Bhattacharjya, IITG CE 602: Optimization Method
ݔଵ − 2ݔଷ + 2ݔସ − ݔହ + ݕଵ =2
ݔଵ + 2ݔଷ − 2ݔସ + ݕଶ =8
ݔଵ − ݔଷ + ݔସ + = ݔ11
4ݔଵ + 2ݔଷ − 2ݔସ −݂ =0
Phase I
Minimize ݕ = ݓଵ + ݕଶ
Or, Minimize w = −2ݔଵ + 0ݔଷ + 0ݔସ + ݔହ = −10
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Phase I problem can be written as
ݔଵ − 2ݔଷ + 2ݔସ − ݔହ + ݕଵ =2
ݔଵ + 2ݔଷ − 2ݔସ + ݕଶ =8
ݔଵ − ݔଷ + ݔସ + = ݔ11
4ݔଵ + 2ݔଷ − 2ݔସ −݂ =0
−2ݔଵ + 0ݔଷ + 0ݔସ + ݔହ − = ݓ−10
Basic Variable
w f bi bi/aij
Variable x1 x3 x4 x5 x6 y1 y2
y1 1 -2 2 -1 0 1 0 0 0 2 2
y2 1 2 -2 0 0 0 1 0 0 8 8
x6 1 -1 1 0 1 0 0 0 0 11 11
f 4 2 -2 0 0 0 0 0 -1 0
w -2 0 0 1 0 0 0 -1 0 -10
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Basic Variable
w f bi bi/aij
Variable x1 x3 x4 x5 x6 y1 y2
x1 1 -2 2 -1 0 1 0 0 0 2
y2 0 4 -4 1 0 -1 1 0 0 6 1.5
x6 0 1 -1 1 1 -1 0 0 0 9 9
f 0 10 -10 4 0 -4 0 0 -1 -8
w 0 -4 4 -1 0 2 0 -1 0 -6
Basic Variable
w f bi bi/aij
Variable x1 x3 x4 x5 x6 y1 y2
x1 1 0 0 -0.5 0 0.5 0.5 0 0 5
x3 0 1 -1 0.25 0 -0.25 0.25 0 0 1.5
x6 0 0 0 0.75 1 -0.75 -0.25 0 0 7.5
f 0 0 0 1.5 0 -1.5 -2.5 0 -1 -23
w 0 0 0 0 0 1 1 -1 0 0
All ܿ are positive, so no improvementCEis602:possible
Rajib Bhattacharjya, IITG Optimization Method
Phase II
Basic Variable
f bi bi/aij
Variable x1 x3 x4 x5 x6
x1 1 0 0 -0.50 0 0 5
x3 0 1 -1 0.25 0 0 1.5
x6 0 0 0 0.75 1 0 7.5
f 0 0 0 1.5 0 -1 -23
It can be noted that all the coefficients of the cost function is
positive, hence it is not possible to improve the objective
function value
This the optimal solution of the problem is
ݔଵ = 5 ݔଶ = 1.5 ݔଷ = 1.5 = ݔ7.5 ݔସ = ݔହ = 0 ݂ = 23
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Example 5
A manufacturer produces, A, B, C, and D, by using two types of machines
(lathes and milling machines). The time required on the two machines to
manufacture one unit of each of the four products, the profit per unit products
and the total time available on the two types of machines per day are given
below.
Machine Time required per unit (min) for Available
product time
A B C D (min)
Lathe machine 7 10 4 9 1200
Milling machine 3 40 1 1 800
Profit per unit 45 100 30 50
Find the number of units to be manufactured of each product per day for
maximizing profit.
Rajib Bhattacharjya, IITG CE 602: Optimization Method
LP Formulation
Maximize ݂ = 45ݔଵ + 100ݔଶ + 30ݔଷ + 50ݔସ
Subject to
7ݔଵ + 10ݔଶ + 4ݔଷ + 9ݔସ ≤ 1200
3ݔଵ + 40ݔଶ + ݔଷ + ݔସ ≤ 800
ݔ ≥ 0 ݅ = 1,2,3,4
Minimize ݂ = −45ݔଵ − 100ݔଶ − 30ݔଷ − 50ݔସ
Subject to
7ݔଵ + 10ݔଶ + 4ݔଷ + 9ݔସ + ݔହ = 1200
3ݔଵ + 40ݔଶ + ݔଷ + ݔସ + = ݔ800
ݔ ≥ 0 ݅ = 1,2,3,4,5,6
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Basic Variable
f bi bi/aij
Variable x1 x2 x3 x4 x5 x6
x5 7 10 4 9 1 0 0 1200 120
x6 3 40 1 1 0 1 0 800 20
f -45 -100 -30 -50 0 0 -1 0
Basic Variable
f bi bi/aij
Variable x1 x2 x3 x4 x5 x6
x5 6.25 0 3.75 8.75 1 -0.25 0 1000 114
x2 0.075 1 0.025 0.025 0 0.025 0 20 800
f -37.5 0 -27.5 -47.5 0 2.5 -1 2000
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Basic Variable
f bi bi/aij
Variable x1 x2 x3 x4 x5 x6
x4 0.71 0 0.43 1 0.11 -0.03 0 114 266
x2 0.06 1 0.01 0 0.00 0.03 0 17 1200
f -3.57 0 -7.14 0 5.43 1.14 -1 7428
Basic Variable
f bi bi/aij
Variable x1 x2 x3 x4 x5 x6
x3 1.67 0 1 2.33 0.27 -0.07 0 267
x2 0.03 1 0 -0.03 -0.01 0.03 0 13
f 8.33 0 0 16.67 7.33 0.67 -1 9333
This the optimal solution of the problem is
ݔଵ = 0 ݔଶ = 13 ݔଷ = 267 ݔସ = 0 ݔହ = 0 = ݔ0 ݂ = −9333
Rajib Bhattacharjya, IITG CE 602: Optimization Method
Rajib Bhattacharjya, IITG CE 602: Optimization Method