Learning Outcomes
Resources
Try it out visually!
Objective-Level Slider: drag the objective line across the feasible region and watch where optima land.
A linear program with two decision variables fits entirely on a sheet of paper: each constraint cuts the plane with a line, the points surviving every cut form the feasible region, and the objective becomes a family of parallel lines, one for each possible objective value. Sliding a line from this family across the region and watching where it exits gives a purely visual way to locate a best possible point, and this picture is the subject of the present chapter.
Our starting point is a small, well-behaved example whose picture is easy to draw. Once its geometry is understood, we move on to examples where things go wrong in instructive ways.
Consider the problem
The first step is a picture of the feasible region: every point that survives all of the constraints at once.
A reliable way to draw it is boundary-first: sketch the line where each constraint holds with equality, namely
and then shading in the side of the space cut out by the corresponding inequality.

Each line splits the plane in two; keeping the correct side of every line and shading whatever survives produces the feasible region.
Two features of this particular region are worth naming. It is nonempty: at least one point satisfies every constraint. And it is bounded: the whole region fits inside some large circle, with no direction in which it stretches forever.
The corners of the region, called extreme points, will turn out to carry all the information we need about optimal solutions. Each corner sits where two of the boundary lines cross, so corner coordinates come from solving linear systems. Watch out, though: crossing two boundary lines is necessary but not sufficient, since two lines can also intersect at a point that violates some third constraint.
We will later use the terminology basic feasible solution for an extreme point of the feasible region, and basic solution as a point that is the intersection of 2 lines, but is actually infeasible (does not satisfy all the constraints).
Theorem 5.1: Optimal Solution at a Vertex
If the feasible region of the linear program is nonempty and bounded, then there exists an optimal solution at a vertex of the feasible region.
This theorem implies the following algorithm.
Algorithm: Enumerate Vertices Algorithm for Solving a Linear Programming Problem
We will explore why Theorem 5.1 is true, and also what happens when the feasible region does not satisfy the assumptions of either nonempty or bounded.
We now apply the vertex enumeration idea graphically using a concrete example.
Example 5.2: Furniture Workshop
A small furniture workshop produces chairs and tables. Each chair requires 2 hours of carpentry and 1 hour of finishing, earning a profit of $8. Each table requires 1 hour of carpentry and 3 hours of finishing, earning a profit of $6. The workshop has 80 hours of carpentry time and 90 hours of finishing time available per week. Market demand limits chair production to at most 32 per week.
Letting denote the number of chairs and the number of tables, the linear program is:
| (5.1) |
Solution
To solve graphically, we first sketch the feasible region by plotting the boundary lines of each constraint and shading the region that satisfies all inequalities simultaneously. The result is shown in Figure 5.2.
Next, we overlay level curves of the objective function. Setting gives the family of lines
which are parallel lines with slope . Increasing shifts them in the direction of the gradient . Sweeping the level curves in this direction, the last one to touch the feasible region does so at the vertex , yielding the optimal profit
This optimal point sits at the intersection of the two constraints and . Both constraints are satisfied with equality at the optimum; we say they are binding. The remaining constraints (, , ) are satisfied strictly and are non-binding.
This illustrates a general principle: when an optimal solution to a linear program exists, it occurs at a vertex of the feasible region, the intersection of several binding constraints.
We can now state a preliminary algorithm for solving a two-variable LP with a bounded feasible region graphically.
➀ Graphical Method 1: Bounded Region, Unique Optimum
Example 5.3: Lemonade Vendor
Say you are a vendor of lemonade and lemon juice. Each unit of lemonade requires 1 lemon and 2 litres of water. Each unit of lemon juice requires 3 lemons and 1 litre of water. Each unit of lemonade gives a profit of three dollars. Each unit of lemon juice gives a profit of two dollars. You have 6 lemons and 4 litres of water available. How many units of lemonade and lemon juice should you make to maximize profit?
If we let denote the number of units of lemonade to be made and let denote the number of units of lemon juice to be made, then the profit is given by dollars. We call the objective function. Note that there are a number of constraints that and must satisfy. First of all, and should be nonnegative. The number of lemons needed to make units of lemonade and units of lemon juice is and cannot exceed 6. The number of litres of water needed to make units of lemonade and units of lemon juice is and cannot exceed 4. Hence, to determine the maximum profit, we need to maximize subject to and satisfying the constraints , , , and
A more compact way to write the problem is as follows:
Solution
We can solve this maximization problem graphically as follows. We first sketch the set of satisfying the constraints, called the feasible region, on the -plane. We then take the objective function and turn it into an equation of a line where is a parameter. Note that as the value of increases, the line defined by the equation moves in the direction of the normal vector . We call this direction the direction of improvement. Determining the maximum value of the objective function, called the optimal value, subject to the constraints amounts to finding the maximum value of so that the line defined by the equation still intersects the feasible region.
In Figure 5.3, level curves of are drawn for several values of . From the picture, we can see that if is greater than 6.8, the line defined by will not intersect the feasible region. Hence, the profit cannot exceed 6.8 dollars.
As the line does intersect the feasible region, is the maximum value for the objective function. Note that there is only one point in the feasible region that intersects the line , namely . In other words, to maximize profit, we want to make 1.2 units of lemonade and 1.6 units of lemon juice.
The examples above each have a single optimal solution. However, four qualitatively different outcomes are possible for any linear program:
The third outcome can only arise when the feasible region is unbounded. We will illustrate each of these outcomes below and, in a later chapter, prove that these are the only possibilities.
It is possible for a linear program to have more than one optimal solution. When this happens, there are in fact infinitely many. We illustrate with a modification of the Furniture Workshop.
Example 5.4: Furniture Workshop: Alternative Objective
Suppose the workshop in Example 5.2 revises its pricing so that each chair earns $2 and each table earns $1. The new objective function is , while the constraints remain unchanged:
| (5.2) |
Solution
The gradient of the new objective is , which is parallel to the constraint . As we sweep the level curves in the gradient direction, the last level curve that touches the feasible region coincides with the entire edge from to . Along this edge, for every point, so everywhere on it.
Let denote the feasible region. For any with , the point lies on the edge from to , and for all . Since there are infinitely many such points, the problem has infinitely many optimal solutions.
Based on this example, we extend our graphical algorithm to handle multiple optimal solutions:
➁ Graphical Method 2: Allowing Multiple Optima
Everything from Method 1, plus a check for ties.
Learning Checkpoint 5.3.1
Consider the graphical representation below. How many optimal solutions are there if we are maximizing? How about if we are minimizing?

When the constraints of a linear program contradict one another, no point can satisfy them all. The feasible region is empty and we say the problem is infeasible.
Example 5.5: Infeasible Problem
Consider the following linear programming problem:
| (5.3) |
Solution
The constraints are plotted in Figure 5.6. The first two constraints restrict , but the lower bounds and together require . These are contradictory, so no point satisfies all constraints simultaneously.
Since the feasible region is empty, the problem has no solution.
Before stating the complete graphical algorithm, we also consider the case of unbounded feasible regions.
Consider the problem

As you can see, the feasible region is unbounded. In particular, from any point in the feasible region, one can always find another feasible point by increasing the coordinate (i.e., move to the right in the picture). However, this does not necessarily mean that the optimization problem is unbounded.
Indeed, the optimal solution is at , the extreme point in the lower left hand corner, with optimal objective value
Consider however, if we consider a different problem where we try to maximize the objective
Solution
This optimization problem is unbounded! For example, notice that the point is feasible for all . Then the objective function follows the sequence , which diverges to infinity.
We now illustrate two more scenarios with unbounded feasible regions. In the first, the problem is unbounded; in the second, a finite optimum exists despite the unbounded region.
Example 5.6: Unbounded Problem
Consider the linear programming problem:
| (5.4) |
Solution
The feasible region and level curves are shown in Figure 5.7.
The feasible region extends infinitely upward and to the right. For any target value , we can find a feasible point achieving . For instance, take for : then and , so the point is feasible, and , which grows without bound. Hence the optimal value is and the problem is unbounded.
An unbounded feasible region does not always lead to an unbounded objective. The key is whether the gradient of the objective points into the unbounded direction or away from it.
Example 5.7: Finite Optimum with Unbounded Feasible Region
Consider the same feasible region as in Example 5.6 but with a new objective:
| (5.5) |
Solution
The feasible region is the same unbounded region as before. However, we are now minimizing, and the gradient points to the right and slightly upward, precisely into the unbounded part of the feasible region. Moving opposite to the gradient (toward smaller ) takes us to the lower-left corner of the feasible region.
Evaluating the objective at the vertices: and . Since we are minimizing, the optimum is at . Once again, the optimal solution occurs at a vertex of the feasible region, even though the region is unbounded.
We can now state a complete algorithm for graphically solving any two-variable linear program.
✓ The Complete Graphical Method for Two-Variable LPs
Handles every case: infeasible, unbounded, unique, and multiple optima.
Exercise 5.8: Feasible Region Analysis
Consider the following system of constraints:
Which of the following statements is true about the feasible region?
Exercise 5.9: Sketch Feasible Region
Sketch all satisfying
on the -plane.
[§5.1]
Exercise 5.10: Graphical Method 1 Practice
Apply the steps of the box “Graphical Method 1: Bounded Region, Unique Optimum” to the linear program
Sketch the feasible region, list all four vertices, and sweep the level curves of in the gradient direction to find the optimal solution and the optimal value.
Exercise 5.11: Graphical Method for Lemonade Vendor
Solve the Lemonade Vendor problem from Example 5.3 using the graphical method.
Exercise 5.12: Graphical Method
Use the graphical method to determine two optimal solutions to linear program:
Exercise 5.13: Infeasible Region Graph
Graph the feasible region of the linear program:
Without considering the objective function, how many feasible solutions are there? Justify your answer.
Exercise 5.14: Determine Optimal Value
Determine the optimal value of
[§5.2]
Exercise 5.15: Show Unbounded Problem
Show that the problem
is unbounded.
Exercise 5.16: Bounded Solution on Unbounded Region
Consider the feasible region from Example 5.6 (with and ). Does the problem subject to these constraints have a finite solution? Justify your answer using the Complete Graphical Method.
Exercise 5.17: Diet Problem
Suppose that you are shopping for dietary supplements to satisfy your required daily intake of 0.40mg of nutrient and 0.30mg of nutrient . There are three popular products on the market. The costs and the amounts of the two nutrients are given in the following table:
You want to determine how much of each product you should buy so that the daily intake requirements of the two nutrients are satisfied at minimum cost. Formulate your problem as a linear programming problem, assuming that you can buy a fractional number of each product.
Exercise 5.18: Why Must an Optimum Be at a Vertex?
Suppose a linear program in two variables has a nonempty and bounded feasible region.
Exercise 5.19: Infinite Optimal Solutions
Find an objective function for the feasible region in Example 5.6 that produces infinitely many optimal solutions. Describe the set of optima.
[§5.3]
Exercise 5.20: Infinitely Many Optimal Solutions
Modify the objective function in Example 5.3 so that the resulting LP has infinitely many optimal solutions. Describe the complete set of optimal solutions.
Exercise 5.21: Bounded Optimum on Unbounded Region
Consider the constraints , , . Construct a maximization objective that has a finite optimum despite the unbounded feasible region. Sketch the feasible region and level curves to verify.
[Hint: Choose a gradient that points away from the unbounded direction.]
Exercise 5.22: Unbounded Objective Direction
Consider the following problem:
satisfies all the constraints. Show that the objective function is unbounded for this point as .
is feasible for any . What is the objective function value at this point? Show that the objective function is unbounded (yet again) by letting .
Exercise 5.23: Bounded and Unbounded Optimization
Consider the following problem:
for any . Show that as , the objective function becomes unbounded.
is feasible for any . Compute the objective function value at this point and demonstrate that it is unbounded as .
[§5.5]
Exercise 5.24: From an Optimal Edge to a Unique Optimum
Construct a tie between optimal solutions, then break it.
Solution
(Exercise 5.10) The feasible region has vertices , , , and . Evaluating the objective: , , , and . Sweeping the level curves of in the direction of the gradient , the last level curve to touch the region passes through , where the constraints and are both binding. The optimal solution is with optimal value .
Solution
(Exercise 5.13) In fact, constraints 2 and 3 point away from each other, and hence there are no feasible solutions.
Solution
(Exercise 5.9)
The points satisfying are precisely those above the line passing through and .
Solution
(5.14)
We want to determine the minimum value so that defines a line that has a nonempty intersection with the feasible region. However, we can avoid referring to a sketch by setting and substituting for in the inequalities to obtain:
or equivalently,
Thus, the minimum value for is , which occurs at . Hence, the optimal value is .
We can verify our work by doing the following. If our calculations above are correct, then an optimal solution is given by , since . It is easy to check that this satisfies both inequalities and therefore is a feasible solution.
Now, taking times the first inequality and times the second inequality, we can infer the inequality . The left-hand side of this inequality is precisely the objective function. Hence, no feasible solution can have objective function value less than . But , is a feasible solution with objective function value equal to . As a result, it must be an optimal solution.
Remark. We have not yet discussed how to obtain the multipliers and for inferring the inequality . This is an issue that will be taken up later. In the meantime, think about how one could have obtained these multipliers for this particular exercise.
Solution
(Exercise 5.15) We could glean some insight by first making a sketch on the -plane.
The line defined by has -intercept . Note that for , satisfies both inequalities and the value of the objective function at is . Hence, there is no lower bound on the value of the objective function.
Solution
(Exercise 5.17) Let denote the amount of Product to buy for . Then, the problem can be formulated as
Remark. If one cannot buy fractional amounts of the products, the problem can be formulated as
We now define a procedure for finding the extreme directions, using the following LP’s feasible region. Graphically, we can see that the extreme directions should follow the (red) line and the (orange) line.
E.g., consider the (orange) line, to find the extreme direction start at extreme point (2,3) and find another feasible point on the orange line, say (4,4) and subtract (2,3) from (4,4), which yields (2,1).
This is related to the slope in two dimensions: the rise is 1 and the run is 2. So this direction has a slope of 1/2, but this does not carry over easily to higher dimensions where directions cannot be defined by a single number.
To find the extreme directions we can change the right-hand-side to , which forms a polyhedral cone (in yellow), and then add the constraint . The intersection of the cone and form a line segment.
Magnifying for clarity, and removing the (teal) line, as it is redundant, and marking the extreme points of the new feasible region, (4/5, 1/5) and (2/3, 1/3), with red boxes, we have:
The extreme directions are thus (4/5, 1/5) and (2/3, 1/3).