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

Suppose the allowed choices satisfy x+y≤4x+y\le4, x≥0x\ge0, and y≥0y\ge0. These constraints form the triangular feasible region from the last lesson. Each constraint keeps one half-plane, and the feasible region is their overlap. Every point in this triangle is an allowed choice, so there are infinitely many choices to compare. A condition such as 2x+y≥62x+y\ge6 would keep the side of its boundary away from the origin. In any model, keep only the overlap of all its constraints.

The constraints here use ≤\le or ≥\ge, so feasible boundary points are included. If the best boundary point were excluded, there might be no greatest value to reach. Nonnegative amounts need x≥0x\ge0 and y≥0y\ge0. If the variables count separate items such as chairs, they must also be whole numbers; nonnegativity alone does not require that.

The objective function is the quantity to maximize or minimize. A function here is simply a rule that gives one value for each allowed pair. For example, P=3x+2yP=3x+2y gives P=8P=8 at (2,1)(2,1). The general linear form is

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

where aa and bb are fixed numbers from the problem. We seek the largest value (a maximum) or smallest value (a minimum) among the feasible points. The corner-point principle lets us check a finite list instead of trying points at random.

Why the best value sits at a corner

For P=2x+3yP=2x+3y, the equations 2x+3y=32x+3y=3, 2x+3y=62x+3y=6, and 2x+3y=92x+3y=9 describe points with objective values 33, 66, and 99. These are level lines: the objective is constant along each one.

For any level cc, solving 2x+3y=c2x+3y=c for yy gives

y=−23x+c3.y=-\frac23x+\frac c3.

The slope stays −23-\tfrac23, so changing cc slides the line without turning it. The level lines are parallel. Sliding these lines up and to the right raises PP; sliding them the other way lowers it.

Parallel objective lines reach the last cornerAxes use equal units. The three level lines for P equals 2x plus 3y have slope negative two thirds. The increasing-P arrow points up and right. The largest level meeting the shaded polygon is 9 at (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).

For a nonempty, bounded feasible polygon with its boundary included, a nonconstant linear objective has a last level line that touches the region in each direction. That line meets a corner or an entire edge, including its two corners. Checking all the corners therefore finds both extremes.

Here bounded means the region fits inside some large box; nonempty means at least one point satisfies all the constraints. If a=b=0a=b=0, then P=0P=0 everywhere. Every feasible point ties, including every corner, and no sliding-line argument is needed.

Why a linear objective is optimized at a corner#

First take the triangle with corners (0,0)(0,0), (2,0)(2,0), and (0,2)(0,2), and let P=x+2yP=x+2y. At the interior point (0.5,0.5)(0.5,0.5), we get P=1.5P=1.5. Moving up to (0.5,1)(0.5,1) stays in the triangle and raises PP to 2.52.5, so that interior point is not best. Moving up helps because the coefficient of yy is positive. Along the slanted edge x+y=2x+y=2, substitute x=2−yx=2-y:

P=(2−y)+2y=2+y.P=(2-y)+2y=2+y.

As yy increases from 00 to 22, this climbs from 22 to 44, so that edge’s maximum is at (0,2)(0,2). On either axis edge, increasing its nonzero coordinate also increases PP. Checking the three corners gives 00, 22, and 44: the maximum is 44 at (0,2)(0,2).

The same reasoning works for a nonempty, bounded feasible polygon with its boundary included and P=ax+byP=ax+by nonconstant. An interior point has room for a small move in any direction. If a≠0a\ne0, move a little right when a>0a>0, or left when a<0a<0. Alternatively, when b≠0b\ne0, move up for b>0b>0 or down for b<0b<0, as in the numerical example. At least one coefficient is nonzero, so one of these moves raises PP while staying inside. Thus an interior point cannot maximize PP.

Along a straight edge, equal steps change xx and yy by fixed amounts, so they change PP by a fixed amount too. Its value rises, falls, or stays constant along the edge. An endpoint therefore matches or beats every other point of that edge. Any interior point can also be improved until reaching an edge: travel in the chosen direction to the boundary, which is reached because the polygon is bounded and includes that boundary.

Every feasible point is thus matched or beaten by a corner. There are finitely many corners, so the largest corner value is the maximum for the whole polygon. Reverse the improving direction to obtain the same conclusion 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).

The other axis crossings are not feasible: (6,0)(6,0) gives 2x+y=12>62x+y=12>6, and (0,6)(0,6) gives x+2y=12>6x+2y=12>6. Discard them. Each of the four listed corners satisfies every constraint.

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.\begin{aligned} P(0,0)&=0,\\ P(3,0)&=9,\\ P(2,2)&=6+4=10,\\ P(0,3)&=6. \end{aligned}

The maximum of P=3x+2yP = 3x + 2y over this region is 10\mathbf{10}, achieved at x=2x = 2, y=2y = 2. This point is the inside corner where the two slanted limits meet. If you had checked only the corners on the axes, you would have missed it.

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

A nonempty, bounded feasible polygon with its boundary included has both extremes. An unbounded region stretches forever in some direction. Such a region may lose the maximum, the minimum, both, or neither. Which ones it loses depends on how the objective changes as you move in the unbounded direction.

For example, if feasible points extend upward forever and raising yy keeps raising PP, there is no maximum. If that move lowers PP instead, it prevents a minimum. For the nonempty regions here, with x,y≥0x,y\ge0 and inclusive linear constraints, any extreme that exists is still achieved at a corner. We use that extension here; its general proof belongs to later optimization courses. Check the unbounded directions as well as the corners before claiming an extreme exists.

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, but a minimum can still exist. 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.\begin{aligned} C(0,4)&=8,\\ C(1,2)&=3+4=7,\\ C(4,0)&=12. \end{aligned}

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. When the region is unbounded in the direction that makes the objective grow, the correct answer is “no maximum.”

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 are given as a story, and you write the inequalities yourself. Name the variables, translate each limited resource into one inequality, add the non-negativity constraints, and write the objective. Then use the corner-point method, 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 goes into the model. 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≤8x+3y≤9x≥0,y≥0x,y whole numbers.\begin{aligned} &\text{maximize } P=30x+50y\\ &\text{subject to}\\ &2x+y\le8\\ &x+3y\le9\\ &x\ge0,\quad y\ge0\\ &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,\\ P(4,0)&=120,\\ P(3,2)&=90+100=190,\\ 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. Using up every resource does not by itself show that a plan is best. We know this plan earns the most profit because we compared all four corners.

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

For a nonempty, bounded feasible polygon with its boundary included and a nonconstant linear objective, why is checking the corners enough to find the maximum?

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)

In 19471947, George Dantzig was working on planning for the American air force. Supply schedules involved many quantities and restrictions, so listing every feasible corner was impractical. He developed the simplex method. On a bounded feasible region, its basic idea is to start at a corner, step to a better neighboring corner, and stop when no neighboring corner improves the value. This searches through corners rather than testing every one in advance.

The route was not obvious to him. In his later account, Dantzig recalled first dismissing movement along edges as likely to be inefficient. Further work led him back to a method based on those moves. The resulting procedure made large planning calculations practical and became a major tool of linear programming.

There was an earlier, independent line of work too. The Soviet mathematician Leonid Kantorovich studied how to organize production and published his approach in 19391939. In 19751975, he and the Dutch-American economist Tjalling Koopmans shared the Nobel prize in economics for work on allocating resources efficiently.

Dantzig’s own account describes the development of simplex. The Nobel announcement explains Kantorovich’s contribution.

Your progress

See all your progress →