Graphical Solution of Linear Programming
Models
Graphical solution is limited to linear
programming models containing only two
decision variables. (Can be used with three
variables but only with great difficulty.)
Graphical methods provide visualization of
how a solution for a linear programming
problem is obtained.
Graphical Solution Procedure
for Maximization Problems
Prepare a graph of the feasible
solutions for each of the constraints.
Determine the feasible region that
satisfies all the constraints
simultaneously.
Draw an objective function line.
Feasible Region of a constraint
We always label the
variables x1 and x2
and the coordinate
axes the x1 and x2
axes.
X2
4
2x1 + 3x2 6
Graphical Example:
The shaded area in the
graph are the set of
points satisfying the
inequality:
2x1 + 3x2 6
X1
-1
-1
Graphical Solution Procedure
for Maximization Problems
Move parallel objective function lines
toward larger objective function values
without entirely leaving the feasible
region.
Any feasible solution on the objective
function line with the largest value is
an optimal solution.
Maximization Problem (Example 1)
LP Formulation
Max
5x1 + 7x2
such that
x1
< 6
2x1 + 3x2 < 19
x1 + x2 < 8
x1, x2 > 0
Example 1: Graphical Solution
Constraint #1 Graphed
x2
8
7
x1 < 6
6
5
4
3
2
(6, 0)
1
1
10
x1
Example 1: Graphical Solution
Constraint #2 Graphed
x2
(0, 6 1/3)
8
7
6
5
2x1 + 3x2 < 19
4
3
(9 1/2, 0)
2
1
1
10
x1
Example 1: Graphical Solution
Constraint #3 Graphed
x2
(0, 8)
8
7
x1 + x2 < 8
6
5
4
3
2
(8, 0)
1
1
10
x1
Example 1: Graphical Solution
Combined-Constraint Graph
x2
x1 + x2 < 8
8
7
x1 < 6
6
5
4
2x1 + 3x2 < 19
3
2
1
1
10
x1
Example 1: Graphical Solution
x2
Feasible Solution Region
8
7
6
5
4
3
Feasible
Region
2
1
1
10
x1
Example 1: Graphical Solution
x2
Objective Function Line
8
7
(0, 5)
Objective Function
5x1 + 7x2 = 35
5
4
3
2
(7, 0)
1
1
10
x1
Example 1: Graphical Solution
x2
Optimal Solution
Objective Function
5x1 + 7x2 = 46
8
7
Optimal Solution
(x1 = 5, x2 = 3)
6
5
4
3
2
1
1
10
x1
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.
Extreme Points and the Optimal Solution
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.
Example 1: Graphical Solution
x2
The Five Extreme Points
8
7
6
5
4
Feasible
Region
2
1
2
1
10
x1
Maximization Problem: Example 2
RESOURCE REQUIREMENTS
PRODUCT
Bowl
Mug
Labor
Clay Revenue
(hr/unit) (kg/unit)(RM/unit)
1
4
40
2
3
50
There are 40 hours of labor and 120 kg of
clay available each day.
Decision variables:
x1 = number of bowls to produce
x2 = number of mugs to produce
Example 2
Maximize Z = RM40x1 + RM50x2
Subject to
x1 +2x2 40 hr (labor constraint)
4x1 +3x2 120 kg (clay constraint)
x1 , x2 0
Solution: x1 = 24 bowls
x2 = 8 mugs
Revenue = RM1,360
How to get these?
Graphical Solution Method
1. Plot model constraint on a set of
coordinates in a plane.
2. Identify the feasible solution space
on the graph where all constraints
are satisfied simultaneously.
3. Plot objective function to find the
point on boundary of this space that
maximizes (or minimizes) value of
objective function.
Example 2
x2
50
40
4 x1 + 3 x2 120 kg
30
20
area common to
both constraints
10
0
x1 + 2 x2 40 hr
|
10
|
20
|
30
|
40
|
50
|
60
x1
Computing Optimal Values
x2
40
30
x1 + 2x2 =
4 x1 + 3 x2 120 kg
40
4x1 + 3x2 = 120
4x1 + 8x2 = 160
-4x1 - 3x2 =-120
20
x1 + 2 x2 40 hr
10
0
8
|
10
|
|
20 24 30
| x1
40
5x2 =
40
x2 =
x1 + 2(8) =
40
x1
= 24
Z = 50(24) + 50(8) = 1,360
Extreme Corner Points
Objective Function
x2
40
4x1 + 3x2 120 kg
30
20
Z = 70x1 + 20x2
A
Optimal point:
x1 = 30 bowls
x2 = 0 mugs
10
Z = RM2,100
B
0
|
10
|
20
| C
30
x1 + 2x2 40 hr
|
40
x1
Minimization Problem: Example 1
LP Formulation
Min
s.t.
5x1 + 2x2
2x1 + 5x2 > 10
4x1 - x2 > 12
x1 + x2 > 4
x1, x2 > 0
Example 1
Graph the Constraints
2x1 + 5x2 > 10
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:
Example 1
4x1 - x2 > 12
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.
Example 1
Constraint 3:
x1 + x 2 > 4
When x1 = 0, then x2 = 4;
when x2 = 0, then x1 = 4.
Connect (4,0) and (0,4).
The ">" side is above this line.
Example 1
Constraints
x2
Graphed
Feasible Region
4x1 - x2 > 12
x1 + x2 > 4
4
3
2x1 + 5x2 > 10
2
1
1
x1
Example 1
Graph the Objective Function
Set the objective function equal to an
arbitrary constant (say 20) and graph it.
For 5x1 + 2x2 = 20, when x1 = 0, then x2
= 10; when x2= 0, then x1 = 4. Connect
(4,0) and (0,10).
Example 1
Move the Objective Function Line
Toward Optimality
Move it in the direction which lowers
its value (down), since we are
minimizing, until it touches the last
point of the feasible region,
determined by the last two constraints.
Example 1
Objective
x2
Function Graphed Min z = 5x1 + 2x2
5
4x1 - x2 > 12
x1 + x2 > 4
2x1 + 5x2 > 10
2
1
1
x1
Example 1
Solve for the Extreme Point at the
Intersection of the Two Binding 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
Example 1
Solve for the Optimal Value of the Objective
Function
Solve for z = 5x1 + 2x2
= 5(16/5) + 2(4/5) = 88/5.
Thus the optimal solution is
x1 = 16/5; x2 = 4/5; z = 88/5
Example 1
Optimal
x2 Solution
Min z = 5x1 + 2x2
4x1 - x2 > 12
x1 + x2 > 4
2x1 + 5x2 > 10
2
1
1
Optimal: x1 = 16/5
x2 = 4/5
x1
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
Feasible Region
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.
Alternate Optimal Solutions
Some LPs have an infinite
number of solutions.
Consider the following
formulation:
X2
D
Feasible Region
max z =13x1 + 2x2
1
x1
x2 1
40
60
s.t.
1
50
x1
1
50
x2 1
z = 100
z = 120
x1 x2 0
Any point (solution) falling on line
segment AE will yield an optimal
solution of z =120.
z = 60
A
10
20
30
40
50
X1
Special Cases
Infeasibility
A linear program which is
overconstrained so that no point
satisfies all the constraints is said to be
infeasible.
Unboundedness
(See example on upcoming slide.)
Example: Infeasible Problem
Solve graphically for the optimal solution:
Max
s.t.
2x1 + 6x2
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
x2
feasible region,
and no optimal solution.
2x1 + x2 > 8
4x1 + 3x2 < 12
3 4
x1
Example: Unbounded Problem
Solve graphically for the optimal
solution:
Max 3x1 + 4x2
s.t.
x 1 + x2 > 5
3x 1 + x 2 > 8
x1, x2 > 0
Example: Unbounded Problem
The feasible region is unbounded and
the objective
x2 function line can be moved
parallel to itself without
bound so that
3x1 + x2 > 8
z can be increased
infinitely.
8
Max 3x1 + 4x2
x1 + x2 > 5
2.67
x1
Exercise
Solve the following
LP model graphically:
Minimize
subject to
Z = 8 x1 + 2x2
2x1- 6x2 < 12
5x1 + 4x2 > 40
x1 + 2x2 > 12
x2 < 6
x 1, x 2 > 0
Ans:
x1 = 3.2,
x2 = 6,
Z = 37.6
Food of thought
The hardest arithmetic to master is
that which enables us to count our
blessings.