Linear Programming: The Graphical Method
Linear Programming: The Graphical Method
Graphical Method
1
Introduction
2
Introduction
• Since most real world problems have more
than two decision variables, such problems
cannot be solved graphically.
• However, graphical approach provides
understanding of solving an LP problem
algebraically, involving more than two
variables.
• Though two-variable problems hardly exist in
practice, the treatment provides concrete
foundations for the development of the
general simplex algorithm presented in
Chapter 3. 3
Example
Reddy Mikks produces both interior and exterior paints from
two raw materials, Ml and M2. The following table provides the
basic data of the problem:
5
Solution
8
Solution
9
Graphical Solution
Methods:
10
Terminology for solution of LP
• Solution:
• A feasible solution is a solution for which all the
constraints are satisfied.
• A corner point feasible solution (CPF) is a feasible
solution that lies at a corner point.
• An infeasible solution is a solution for which at least
one constraint is violated.
• The feasible region is the collection of all feasible
solution.
• An Optimal solution is a feasible solution that has the
most favorable value of the objective function. (it is
always one of the CPF solution
• The most favorable value is the largest (smallest) value
if the objective function is to be maximized (minimized).
• An unbounded solution is a solution that increase or
decrease infinitely the value of the objective function of
the LP. 11
Terminology for solution of LP
• Basic Solution:- For a set of m simultaneous
equations in ‘n’ variables ( n > m), a solution obtained
by setting ‘n – m’ variables equal to zero and solving
for remaining ‘m’ equations in ‘n’ variables is called a
basic solution. The n – m variables whose value did
not appear in the solution are called non – basic
variables and the remaining variables are called basic
variables.
• Basic Feasible Solution (BFS):- A feasible solution to
an LPP which is also the basic solution is called BFS.
ie, all basic variables assume non negative values.
BFS are of two types.
– Degenerate: A BFS is called degenerate if the value of at least
one basic variable is zero.
– Non – Degenerate: A BFS is called non – degenerate if the
value of all m basic variables are non – zero and positive. 12
Terminology for solution of LP
• Optimal BFS: - A BFS which optimizes the objective
function of the given LPP is called an Optimal BFS.
13
Graphical solution
• While obtaining the optimal solution to the LP
problem by the graphical method , the statements
of the following theorems of linear programming is
used:-
• Note.
Convex set is a polygon "Convex" implies that if any two points of the
polygon are selected arbitrarily then straight line segment Joining these
two points lies completely within the polygon. The extreme points of the
convex set are the basic solution to the linear programming problem.
15
Graphical solution
Extreme point solution method:
16
Example 1: A Minimization Problem
• LP Formulation
Min z = 5x1 + 2x2
s.t. 2x1 + 5x2 > 10
4x1 - x2 > 12
x 1 + x2 > 4
x1, x2 > 0
17
Example 1: Graphical Solution
• Graph the Constraints
• Constraint 1: When x1 = 0, then x2 = 2; when x2 =
0, then x1 = 5. Connect (5,0) and (0,2). The ">" side
is above this line.
• Constraint 2: When x2 = 0, then x1 = 3. But
setting x1 to 0 will yield x2 = -12, which is not on
the graph. Thus, to get a second point on this
line, set x1 to any number larger than 3 and solve
for x2: when x1 = 5, then x2 = 8. Connect (3,0) and
(5,8). The ">" side is to the right.
• Constraint 3: When x1 = 0, then x2 = 4; when x2 =
0, then x1 = 4. Connect (4,0) and (0,4). The ">" side
is above this line.
18
Example 1: Graphical Solution
• Constraints Graphed
3
2x11 + 5x22 > 10
2
(16/5,4/5)
1 (10/3, 2/3)
x11
1 2 3 4 5 6
(5,0) 19
Example 1: Graphical Solution
• Solve for the Extreme Point at the Intersection of the second and third Constraints
4x1 - x2 = 12
x1+ x2 = 4
Adding these two equations gives:
5x1 = 16 or x1 = 16/5.
Substituting this into x1 + x2 = 4 gives: x2 = 4/5
• Solve for the extreme point at the intersection of the first and third constraints
2x1 + 5x2 =10
x1 + x2= 4
Multiply the second equation by -2 and add to the first equation, gives
3x2 = 2 or x2 = 2/3
Substituting this in the second equation gives x1 = 10/3
Point Z
(16/5, 4/5) 88/5
(10/3, 2/3) 18
(5, 0) 25 20
Example 2: A Maximization Problem
s.t. x1 < 6
2x1 + 3x2 < 19
x1 + x2 < 8
x1, x2 > 0
21
Example 2: A Maximization Problem
• Constraint #1 Graphed
x2
8
6
x1 < 6
5
1 (6, 0)
1 2 3 4 5 6 7 8 9 10
x1
22
Example 2: A Maximization Problem
• Constraint #2 Graphed
x2
8 (0, 6 1/3)
7
4
3
2
(9 1/2, 0)
1
1 2 3 4 5 6 7 8 9 10
x1
23
Example 2: A Maximization Problem
• Constraint #3 Graphed
x2
(0, 8)
8
6
x1 + x2 < 8
5
1 (8, 0)
1 2 3 4 5 6 7 8 9 10
x1
24
Example 2: A Maximization Problem
• Combined-Constraint Graph
x2
8
x1 + x2 < 8
7
6
x1 < 6
5
2
2x1 + 3x2 < 19
1
1 2 3 4 5 6 7 8 9 10
x1
25
Example 2: A Maximization Problem
• Feasible Solution Region
x2
8
2 Feasible
1
Region
1 2 3 4 5 6 7 8 9 10
x1
26
Example 2: A Maximization Problem
• The Five Extreme Points
7
5
(0, 19/3) 6
4 (5, 3)
3
4
2 Feasible 3 (6, 2)
1
Region
1 2
(0, 0) x1
1 2 3 4 5 6 7 8 9 10
(6, 0) 27
Example 2: A Maximization Problem
• Having identified the feasible region for the
problem, we now search for the optimal
solution, which will be the point in the
feasible region with the largest (in case of
maximization or the smallest (in case of
minimization) of the objective function.
• To find this optimal solution, we need to
evaluate the objective function at each one of
the corner points of the feasible region.
28
Example 2: A Maximization Problem
• Optimal Solution
Point Z
x2
(0,0) 0
8
(6,0) 30
7
(6,2) 44
6
Optimal Solution (5,3) 46
5
(0,19/3) 44.33
4
1 2 3 4 5 6 7 8 9 10
x1
29
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.
30
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.
31
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
For a max (min) problem, an unbounded LP occurs
in it is possible to find points in the feasible region
with arbitrarily large (small) Z
32
Example with Multiple Optimal
Solutions
x2
z1 z2 z3
Maximize z = 3x1 – x2
4
33
Example: Infeasible Problem
• Solve graphically for the optimal solution:
34
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
x1
3 4 35
Example: Unbounded Problem
• Solve graphically for the optimal solution:
s.t. x1 + x2 > 5
3x1 + x2 > 8
x1, x2 > 0
36
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
5
x1 + x2 > 5
x1
2.67 5 37
Solve the following LP graphically
max 45 x1 + 60 x2 Objective Function
s.t. 10 x1 + 20 x2 1800 A Structural
28 x1 + 12 x2 1440 B constraints
6 x1 + 15 x2 2040 C
15 x1 + 10
0 x2 2400 D
x1 40 E
x2 100 F
x1 ≥ 0, x2 ≥ 0 nonnegativity
38
The graphical solution
P
Assignment:
240 Max Q Complete the
E problem to find the
200
D optimal solution
160
120 Max P
F
80 A
(
40 1
B C
)
0
0 40 80 120 160 200 240 280 320 360 Q
39
Possible Outcomes of an LP