Introduction to Optimization Advanced. This lesson goes beyond core Algebra I. You can skip it.

Learning goals

  • Turn a word problem into an objective and linear constraints, with x≥0x \ge 0, y≥0y \ge 0
  • Explain why a linear objective's best value sits at a vertex
  • Find every vertex, evaluate the objective there, and pick the extreme
  • Say why an unbounded region may have no maximum

Constraints, the objective, and the feasible region

An optimization problem in two variables has two parts. The first part is a list of constraints, the hard limits written as linear inequalities such as x+y≤4x + y \le 4 or 2x+y≥62x + y \ge 6. The list also carries the natural restrictions x≥0x \ge 0 and y≥0y \ge 0 whenever the variables measure amounts that cannot be negative. Those two inequalities only rule out negative values; if xx and yy must also be whole numbers, because they count separate items like chairs or trucks, that is a further restriction worth remembering, even though the examples in this lesson happen to work out whole anyway. Every constraint here is written with ≤\le or ≥\ge, never the strict << or >>, so every boundary line belongs to the region it bounds; that inclusive boundary is what the corner-point method below relies on. You already know how to graph such a system: each inequality shades a half-plane. The points that satisfy all of the inequalities at once fill the overlap, the feasible region. Every point inside that region is an allowed choice, and there are usually infinitely many of them.

The second part is the objective function, the single linear quantity you are trying to make as large or as small as possible. Write it as

P=ax+by,P = ax + by,

where aa and bb are fixed numbers set by the problem, such as P=3x+2yP = 3x + 2y. Maximizing profit, minimizing cost, and minimizing time are all of this form. The task is now exact: among the infinitely many points of the feasible region, find the one (or ones) where the objective PP is largest, for a maximum, or smallest, for a minimum. Testing points one at a time would never end, so you need a reason to look in just one place. That reason is the corner-point principle.

Why the best value sits at a corner

Fix an objective, say P=2x+3yP = 2x + 3y, over a feasible region. For any chosen number cc, the points where P=cP = c, that is where 2x+3y=c2x + 3y = c, form a straight line called a level line of the objective. Every point on that line gives the objective the same value cc. Solving for yy gives y=−23x+c3y = -\tfrac{2}{3}x + \tfrac{c}{3}, a line whose slope −23-\tfrac{2}{3} does not depend on cc. So the level lines for different values of cc are all parallel. Changing cc slides the line across the plane without ever turning it. Sliding it one way makes PP larger, while sliding it the other way makes PP smaller.

Level lines of an objective sweeping to a cornerThe feasible region is shaded; three parallel dashed lines 2x+3y = 3, 6, 9 move outward, and the largest touches the region only at the corner (3,1).1234123P=3P=6P=9larger P(3, 1)xy
Level lines of P = 2x + 3y over a feasible region with corners (0,0), (4,0), (3,1), and (0,2). The dashed lines P = 3, P = 6, P = 9 are parallel; sliding them in the direction of larger P, the last one to touch the region meets it only at the corner (3,1), so the maximum is P = 9 there.

The corners of this region are (0,0)(0, 0), (4,0)(4, 0), (3,1)(3, 1), and (0,2)(0, 2). As the three dashed level lines slide toward larger PP, the last one that still touches the region is P=9P = 9, and it grazes only the corner (3,1)(3, 1). So the maximum of P=2x+3yP = 2x + 3y over this region is 99, at (3,1)(3, 1).

That last grazing point is no accident, and the same picture works for any bounded region with an included boundary, built from ≤\le and ≥\ge constraints, and any linear objective. Push the level line in the increasing direction as far as you can while it still touches the feasible region. The very last place it touches, just before it leaves the region behind, is where PP is largest. For a region with straight edges, that last contact happens at a single corner, or, if the line grazes a whole edge at once, at both corners of that edge together. That is the whole idea: the search collapses from infinitely many points down to a short list of corners.

Why a linear objective is optimized at a corner#

Take a bounded feasible region with straight edges meeting at corners, its boundary included in the region (every constraint ≤\le or ≥\ge, never strict), and an objective P=ax+byP = ax + by that is not just a constant, so aa and bb are not both zero.

No point strictly inside the region can be the best. An interior point has room to move in every direction, so a small step toward larger PP still lands inside the region, and that step reaches a bigger level line. There is always a nearby point that beats an interior point, so the maximum must sit on the boundary.

Now follow a single edge from one end to the other. Both xx and yy change at a constant rate along a straight edge, so P=ax+byP = ax + by changes at a constant rate too: it climbs the whole way, falls the whole way, or (when the edge happens to run along a level line) stays exactly the same the whole way. In the first two cases the best value on that edge sits at one end. In the third case every point on the edge ties for the best value, including both ends. Either way, an endpoint is always among the best points on the edge, and the endpoints of the edges are exactly the corners of the region.

Putting the two facts together: the maximum is never interior, and along the boundary it is always matched by an endpoint. So at least one corner achieves the maximum, matching the level-line picture above. Sliding the level line the opposite way runs the identical argument for the minimum.

The corner-point method

The principle turns into a four-step recipe, for any feasible region that is bounded, has an included boundary, and has at least one point in it:

  1. Graph the feasible region from the constraints, exactly as in the last lesson.
  2. Find every vertex (corner) of the region. Each corner is where two boundary lines cross, so read off which two lines meet there and solve that pair as a 2×22 \times 2 system, the way you solved systems in an earlier chapter. Not every such crossing is a vertex of the region: check the result against every other constraint, and discard a crossing that fails one, since it lies outside the feasible region rather than on a corner of it.
  3. Evaluate the objective PP at each vertex.
  4. Compare the values: the largest is the maximum and the smallest is the minimum, and the vertex where it happens is the point that achieves it.

Worked example 1 Maximize P=3x+2yP = 3x + 2y subject to 2x+y≤62x + y \le 6, x+2y≤6x + 2y \le 6, x≥0x \ge 0, y≥0y \ge 0

Start with the region. The two axes give the lower and left edges, since x≥0x \ge 0 and y≥0y \ge 0 pin everything to the first quadrant. The line 2x+y=62x + y = 6 runs through (3,0)(3, 0) and (0,6)(0, 6), and testing the origin gives 0≤60 \le 6, so its half-plane is the side toward the origin. The line x+2y=6x + 2y = 6 runs through (6,0)(6, 0) and (0,3)(0, 3), and again the origin satisfies it. Shading all four conditions leaves a four-cornered region.

Next, find the vertices. Two come from the axes meeting the slanted lines, and one comes from the two slanted lines meeting each other.

The origin (0,0)(0, 0) is where the axes cross. On the xx-axis, the constraint that actually reaches down to meet it is 2x+y=62x + y = 6 with y=0y = 0, giving x=3x = 3, so (3,0)(3, 0). On the yy-axis, the constraint that reaches it is x+2y=6x + 2y = 6 with x=0x = 0, giving y=3y = 3, so (0,3)(0, 3). The last corner is where 2x+y=62x + y = 6 and x+2y=6x + 2y = 6 cross. Subtracting the second from the first removes the constant:

(2x+y)−(x+2y)=0⟹x−y=0⟹x=y.(2x + y) - (x + 2y) = 0 \quad\Longrightarrow\quad x - y = 0 \quad\Longrightarrow\quad x = y.

Putting x=yx = y into 2x+y=62x + y = 6 gives 3x=63x = 6, so x=2x = 2 and y=2y = 2: the vertex (2,2)(2, 2).

A feasible region with four labeled cornersThe shaded quadrilateral has corners (0,0), (3,0), (2,2), (0,3); the objective 3x+2y is largest at (2,2).123123(0, 0)(3, 0)(2, 2)(0, 3)xy
The feasible region for 2x + y ≤ 6, x + 2y ≤ 6, x ≥ 0, y ≥ 0. Its four corners are (0,0), (3,0), (2,2), and (0,3). The objective P = 3x + 2y is evaluated at each to find the maximum.

Finally, evaluate P=3x+2yP = 3x + 2y at all four corners.

P(0,0)=0,P(3,0)=9,P(2,2)=6+4=10,P(0,3)=6.P(0, 0) = 0, \qquad P(3, 0) = 9, \qquad P(2, 2) = 6 + 4 = 10, \qquad P(0, 3) = 6.

The largest value is 1010, reached at (2,2)(2, 2). So the maximum of P=3x+2yP = 3x + 2y over this region is 10\mathbf{10}, achieved at x=2x = 2, y=2y = 2. Notice the winner is the inside corner where the two slanted limits meet, not one of the axis corners, which is why checking every vertex matters.

Check your understanding

A feasible region has corners (0,0)(0, 0), (5,0)(5, 0), (4,3)(4, 3), and (0,6)(0, 6). Which corner maximizes P=2x+5yP = 2x + 5y?

Answer choices

Check your understanding

A feasible region is bounded by x≥0x \ge 0, y≥0y \ge 0, x+y≤5x + y \le 5, and 2x+y≤82x + y \le 8. What is the vertex where the lines x+y=5x + y = 5 and 2x+y=82x + y = 8 cross?

Answer choices

When the region is unbounded

The corner-point principle promises a maximum and a minimum whenever the feasible region is bounded, meaning it fits inside some large box, and has an included boundary, meaning every constraint is ≤\le or ≥\ge rather than strict, exactly as in every constraint you have written so far. Many cost problems instead have an unbounded region that stretches out forever in some direction, because the constraints only set lower limits. There you have to be a little careful. Being unbounded does not by itself remove the maximum or the minimum; what matters is which direction the region stretches, compared to the direction that grows the objective. If the region keeps going exactly where PP keeps growing, there is no maximum, because you can travel outward without limit and drive PP as high as you like. Whenever the region does have at least one vertex, an extreme that exists is still found among the vertices, exactly as before; every region you build in this lesson, from x≥0x \ge 0, y≥0y \ge 0, and at least one more constraint, always has one. You just have to notice, and say plainly, when the extreme in the runaway direction does not exist.

Worked example 2 Minimize C=3x+2yC = 3x + 2y subject to 2x+y≥42x + y \ge 4, 2x+3y≥82x + 3y \ge 8, x≥0x \ge 0, y≥0y \ge 0

Because both slanted constraints are “greater than or equal to,” each half-plane is the side away from the origin. So the feasible region sits above and to the right of the two lines, and it runs off to infinity in that direction. The region is unbounded, which is fine for a minimum. Push the level line of C=3x+2yC = 3x + 2y in the decreasing direction, toward the origin, and it last touches the region at a corner.

Find the corners. On the yy-axis (x=0x = 0), the constraint that reaches it is 2x+y=42x + y = 4, giving y=4y = 4, so (0,4)(0, 4). On the xx-axis (y=0y = 0), the constraint that reaches it is 2x+3y=82x + 3y = 8, giving x=4x = 4, so (4,0)(4, 0). The middle corner is where 2x+y=42x + y = 4 and 2x+3y=82x + 3y = 8 meet. Subtracting the first from the second removes 2x2x:

(2x+3y)−(2x+y)=8−4⟹2y=4⟹y=2,(2x + 3y) - (2x + y) = 8 - 4 \quad\Longrightarrow\quad 2y = 4 \quad\Longrightarrow\quad y = 2,

and then 2x+2=42x + 2 = 4 gives x=1x = 1: the vertex (1,2)(1, 2).

An unbounded feasible region for a minimizationThe region lies on and above the path (0,4)-(1,2)-(4,0) and extends up and to the right without bound; 3x+2y is smallest at the corner (1,2).12341234(0, 4)(1, 2)(4, 0)xy
The unbounded feasible region for 2x + y ≥ 4, 2x + 3y ≥ 8, x ≥ 0, y ≥ 0. The shaded area opens up and to the right without end. Its corners are (0,4), (1,2), and (4,0), and C = 3x + 2y is smallest at (1,2).

Evaluate C=3x+2yC = 3x + 2y at the three corners.

C(0,4)=8,C(1,2)=3+4=7,C(4,0)=12.C(0, 4) = 8, \qquad C(1, 2) = 3 + 4 = 7, \qquad C(4, 0) = 12.

The smallest value is 77, at (1,2)(1, 2), so the minimum cost is 7\mathbf{7}. There is no maximum here: starting from any feasible point and moving up and to the right keeps every constraint satisfied while sending C=3x+2yC = 3x + 2y upward without bound. Reporting “no maximum” is the honest and correct answer when the region is unbounded in the increasing direction.

Check your understanding

A feasible region satisfies x≥0x \ge 0, y≥0y \ge 0, and x+y≥3x + y \ge 3, and it stretches upward and to the right without end. For the objective P=x+yP = x + y, which is true?

Answer choices

Optimization in word problems

Most optimization problems arrive as a story, not as ready-made inequalities. Your job is to name the variables, translate each limited resource into one inequality, add the non-negativity constraints, and write the objective. After that, the corner-point method finishes the work, provided the variables can take any value in the region; if they must be whole numbers because they count separate items, that adds one more thing to check, covered below.

Worked example 3 A workshop's best daily plan

A workshop builds chairs and tables. Each chair needs 22 hours of cutting and 11 hour of assembly. Each table needs 11 hour of cutting and 33 hours of assembly. In a day the shop has at most 88 hours of cutting and 99 hours of assembly available. Each chair brings a profit of 3030 dollars and each table 5050 dollars. How many of each should the shop build to maximize profit?

Every number in the story becomes one coefficient. Laying them out in a table makes the translation easy to check:

Cutting (hr)Assembly (hr)Profit (dollars)
Chair (xx)22113030
Table (yy)11335050
Daily limit8899maximize

Let xx be the number of chairs and yy the number of tables. Reading down the Cutting column, cutting time used is 2x+y2x + y hours and cannot exceed 88; reading down the Assembly column, assembly time used is x+3yx + 3y hours and cannot exceed 99. The Profit column gives the objective, P=30x+50yP = 30x + 50y dollars. Since xx and yy count separate items, they must also be whole numbers, and of course neither can be negative. The full model is

maximize P=30x+50ysubject to2x+y≤8,    x+3y≤9,x≥0,    y≥0,    x,y whole numbers.\begin{aligned} \text{maximize } P = 30x + 50y \quad\text{subject to}\quad &2x + y \le 8, \;\; x + 3y \le 9, \\ &x \ge 0, \;\; y \ge 0, \;\; x, y \text{ whole numbers}. \end{aligned}

The corner-point method finds the best point while treating xx and yy as any real numbers, whole or not. Whenever that point turns out to have whole-number coordinates, as it will here, it is also the best whole-number plan, so the method still gives the answer directly.

Graph the region and find its corners. The origin (0,0)(0, 0) is one. On the xx-axis the constraint that reaches it is 2x+y=82x + y = 8, giving (4,0)(4, 0). On the yy-axis the constraint that reaches it is x+3y=9x + 3y = 9, giving (0,3)(0, 3). The inside corner is where 2x+y=82x + y = 8 and x+3y=9x + 3y = 9 meet. From the first, y=8−2xy = 8 - 2x; substituting into the second,

x+3(8−2x)=9⟹x+24−6x=9⟹−5x=−15,x + 3(8 - 2x) = 9 \quad\Longrightarrow\quad x + 24 - 6x = 9 \quad\Longrightarrow\quad -5x = -15,

so x=3x = 3 and y=8−2(3)=2y = 8 - 2(3) = 2: the vertex (3,2)(3, 2).

The feasible production plans of the workshopThe shaded quadrilateral has corners (0,0), (4,0), (3,2), (0,3); profit 30x+50y is largest at (3,2).1234123(0, 0)(4, 0)(3, 2)(0, 3)xy
The workshop's feasible production plans: 2x + y ≤ 8 (cutting) and x + 3y ≤ 9 (assembly), with x, y ≥ 0. The corners are (0,0), (4,0), (3,2), and (0,3), where x counts chairs and y counts tables.

Evaluate the profit P=30x+50yP = 30x + 50y at every corner.

P(0,0)=0,P(4,0)=120,P(3,2)=90+100=190,P(0,3)=150.\begin{aligned} P(0, 0) &= 0, &\qquad P(4, 0) &= 120, \\ P(3, 2) &= 90 + 100 = 190, &\qquad P(0, 3) &= 150. \end{aligned}

The best profit is 190190 dollars, at (3,2)(3, 2), both whole numbers, so the shop should build 33 chairs and 22 tables each day. That plan uses 2(3)+2=82(3) + 2 = 8 cutting hours and 3+3(2)=93 + 3(2) = 9 assembly hours, so it spends both resources completely, which confirms (3,2)(3, 2) is where the two slanted limits cross. It is comparing all four corners, not merely using up every resource, that proves this plan earns the most profit.

Check your understanding

A garden shop plants rose bushes (xx) and shrubs (yy). Each rose bush needs 33 square feet and each shrub needs 22 square feet, in a bed with at most 1818 square feet. Which inequality models the space limit?

Answer choices

Check your understanding

A caterer makes wraps (xx) and salads (yy). Each wrap needs 44 minutes of prep and each salad needs 66 minutes, with at most 120120 minutes of prep time available. Each wrap earns 55 dollars profit and each salad 77 dollars. Which is the complete correct model for maximizing profit?

Answer choices

Check your understanding

Why is it enough to check only the corners of the feasible region when maximizing a linear objective?

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

A bit of history (optional)

Testing every corner works nicely when a region has four of them. Real planning problems are not so polite. An army’s supply schedule carries hundreds of limits on hundreds of quantities to decide at once, chairs and tables now joined by trucks, fuel, and hundreds of other supplies. Adding that many variables on top of that many constraints is what makes the corners of that region impossible to draw, list, or count in a lifetime, far more than the same number of limits would give in just two dimensions.

George Dantzig walked straight into that wall. In 19471947 he was planning for the American air force. He wrote down the general shape you have been using. Push one linear quantity as high as it will go, subject to a list of linear limits. Then he gave a rule for the search, and called it the simplex method. Rather than visit every corner, it starts at one corner. It steps to a neighbor that improves the score. Then it repeats, and stops when no neighbor is better.

That is your own method, with the checking trimmed down to a path. The subject Dantzig founded is called linear programming. The Soviet mathematician Leonid Kantorovich had reached much the same ideas a few years earlier. He was working out how to organize factory production. He later shared a Nobel prize in economics for them.

So the four corners you tested here are a scale model. The same patient walk, stepping corner to neighboring corner, scales up to problems with thousands of variables and far more possible corners than four, and that is what large-scale scheduling and logistics software still does today.