You are on page 1of 35

Linear Programming

Solution
LP Solutions
 The maximization or minimization of some
quantity is the objective in all linear
programming problems.
 A feasible solution satisfies all the problem's
constraints.
 An optimal solution is a feasible solution that
results in the largest possible objective
function value when maximizing (or smallest
when minimizing).
 A graphical solution method can be used to
solve a linear program with two variables.
LP Formulation: Problem 1
Max z = 25x1 + 18x2
s.t.
3x1 + 2x2 < 240
3x1 + x2 < 180
x1 + 3x2 < 300
x1 , x2 > 0
Problem 1
Problem 1
Graphical Solution of an LP
 Prepare a graph of the feasible solutions for
each of the constraints.
 Determine the feasible region that satisfies all
the constraints simultaneously.
 Any interior point of the feasible region cannot
be an optimal solution for a non-trivial solution.
 Any boundary point of the feasible region can
be an optimal solution only when the whole
boundary is optimal.
 A unique optimal solution can lie only at one of
the corner points of the feasible region.
Graphical Solution of an LP

 An LP has either a unique optimal or infinite


optima.
 We can, therefore, use the following three-step
method to search for the optimal:
1. Start at any corner point of the feasible region.
2. Ask “Is it profitable to move along any edge?”
3(a) If yes, move as much as possible till you
reach a neighbouring corner point. Go back
to Step 2.
3(b) If the answer is “NO” then stop.
Problem 1

Let’s begin our search for the


optimal from the obvious corner
point O.
At O, we ask if it is profitable to
move along any edge and find that
we could move either along OA or
along OB. Both are profitable, but
the rate of improvement is higher
along OA (+25) vis-à-vis OB (+18).
So using the highest gradient, we
choose to move as much as possible
along OA to reach the neighbouring
corner-point A.
Problem 1

At A, we ask:
Is it profitable to move along AB?
Along AB, 3x1 + x2 = 180
And so along AB 3Δx1 + Δx2 = 0
If Δx2 = +1, Δx1 = -⅓Δx2 = -⅓
and so Δz = 25Δx1+18Δx2 = 25(-⅓)
+ 18(+1) = +9⅔
Hence, it is profitable to move
along AB and for every unit
increase in x2, the objective function
value (z) increases by 9⅔.
Therefore, we move as much as
possible along AB to reach the
neighbouring corner-point B.
Problem 1

Again, at B, we ask:
Is it profitable to move along BC?
Along BC, 3x1 + 2x2 = 180
And so along BC 3Δx1 + 2Δx2 = 0
If Δx2 = +1, Δx1 = - ⅔Δx2 = - ⅔
and so Δz = 25Δx1+18Δx2 = 25(-⅔)
+ 18(+1) = +1⅓
Hence, it is profitable to move
along BC and for every unit
increase in x2, the objective function
value (z) increases by 1⅓.
Therefore, we move as much as
possible along BC to reach the
neighbouring corner-point C.
Problem 1

Finally, at C we again ask:


Is it profitable to move along CD?
Along CD, x1 + 3x2 = 300
And so along CD, Δx1 + 3Δx2 = 0
If Δx2 = +1, Δx1 = - 3Δx2 = - 3
and so Δz = 25Δx1+18Δx2 = 25(-3)
+ 18(+1) = - 57
Hence, it is not profitable to move
along CD and for every unit
increase in x2, the objective function
value (z) decreases by 57.
Therefore, we should not move
along CD. Hence, we stop as we
have reached the optimum corner-
point C.
Problem 1: Computer Solution
The same three-step process that we used in the
graphical solution is used mathematically in the
simplex procedure used to solve an LP – either
manually or using a computer. The LP is:

Max z= 25x1 + 18x2


s.t.
3x1 + 2x2 < 240
3x1 + x2 < 180
x1 + 3x2 < 300
x1 , x2 > 0
Slack and Surplus Variables
 Slack variables are added to convert a ≤
constraint into an = constraint. Similarly, surplus
variables are added to convert a ≥ constraint into
an = constraint.
 Slack and surplus variables represent the
difference between the left and right sides of the
constraints.
 A binding constraint is one having no slack or
surplus i.e. its LHS and RHS are equal.
 A non-binding constraint has a non-zero slack
or surplus variable associated with it.
Problem 1: Computer Solution
Rewriting the problem as a system of simultaneous
equations by adding three slack variables and writing
the objective function also as an equation:

z - 25x1 - 18x2 = 0
3x1 + 2x2 + S1 = 240
3x1 + x2 + S2 = 180
x1 + 3x2 + S3 = 300
Problem 1: Initial Solution (Pt. O)
Problem 1: Iteration 2 (Pt. A)
Problem 1: Iteration 3 (Pt. B)
Problem 1: Iteration 4 (Pt. C)
Problem 1: Iteration 4
Problem 1: Final Solution
Excel Solutions
Excel Solutions
Excel Solutions
Excel Solutions
Excel Solutions
Extreme Points and the Optimal
Solution
 The corners or vertices of the feasible region are
referred to as the extreme points.
 An optimal solution to an LP problem can be
found at an extreme point of the feasible region.
 When looking for the optimal solution, you do
not have to evaluate all feasible solution points.
 You have to consider only the extreme points of
the feasible region.
Computer Solutions
 Computer programs designed to solve LP
problems are now widely available.
 Very large LP problems can be solved with just
a few seconds of computer time.
 Small LP problems usually require only a small
fraction of a second.
 Linear programming solvers are now part of
many spreadsheet packages, such as Microsoft
Excel.
Interpretation of Computer
Output
 From the computer output, we can easily find:
• objective function value
• values of the decision variables
• reduced costs
• slack/surplus
 Computer output also reports how an optimal
solution is affected by a change in:
• a coefficient of the objective function
• the right-hand side value of a constraint
Reduced Cost
 The reduced cost for a decision variable whose
value is 0 in the optimal solution is the amount
the variable's objective function coefficient
would have to improve (increase for
maximization problems, decrease for
minimization problems) before this variable
could assume a positive value.
 The reduced cost for a decision variable with a
positive value is 0.
Feasible Region
 The feasible region for a two-variable linear
programming problem can be nonexistent, a single
point, a line, a polygon, or an unbounded area.
 Any linear program falls in one of three categories:
• is infeasible
• has a unique optimal solution or alternate
optimal solutions
• has an objective function that can be increased
without bound
 A feasible region may be unbounded and yet there
may be optimal solutions. This is common in
minimization problems and is possible in
maximization problems.
Special Cases
 Alternative Optimal Solutions
In the graphical method, if the objective
function line is parallel to a boundary constraint
in the direction of optimization, there are
alternate optimal solutions, with all points on
this line segment being optimal.
 Infeasibility
A linear program which is overconstrained so
that no point satisfies all the constraints is said
to be infeasible.
 Unbounded
(See example on upcoming slide.)
Example: Infeasible Problem
 Solve graphically for the optimal solution:

Max z = 2x1 + 6x2

s.t. 4x1 + 3x2 < 12


2x1 + x2 > 8

x1 , x2 > 0
Example: Infeasible Problem
 There are no points that satisfy both constraints, hence
this problem has no feasible region, and no optimal
solution.
x2

8 2x1 + x2 > 8

4x1 + 3x2 < 12


4

x1
3 4
Example: Unbounded Problem
 Solve graphically for the optimal solution:

Max z = 3x1 + 4x2

s.t. x1 + x2 > 5
3x1 + x2 > 8
x1 , x2 > 0
Example: Unbounded Problem
 The feasible region is unbounded and the objective
function line can be moved parallel to itself without
bound so that z can be increased infinitely.

x2

3x1 + x2 > 8
8
Max 3x1 + 4x2
5
x1 + x2 > 5

x1
2.67 5

You might also like