Algebra 2 · Grades 10, 11

Linear Programming: Optimizing with Constraints

Quick answer

Linear programming finds the largest or smallest value of a linear expression, such as the profit 50x + 30y, when x and y must satisfy a system of linear inequalities. The inequalities cut out a feasible region of allowed choices. The best value always occurs at a vertex of that region, so the method is to graph the constraints, find the corners by solving pairs of boundary equations, evaluate the objective at each corner, and pick the best.

What you'll learn

  • Write constraints and an objective function from a word problem
  • Graph a feasible region and find its vertices
  • Explain why an optimum occurs at a vertex
  • Find a maximum or minimum, or recognize that none exists

Choosing the best mix

A workshop builds bookshelves and tables. A bookshelf takes 22 hours of cutting and 11 hour of finishing; a table takes 11 hour of each. Each week the workshop has 1616 hours of cutting time and 1010 hours of finishing time. A bookshelf earns 5050 dollars of profit and a table 3030 dollars. How many of each should it build?

Let xx be the number of bookshelves and yy the number of tables. The time limits and the fact that counts cannot be negative give the constraints:

2x+y≤16cuttingx+y≤10finishingx≥0,y≥0\begin{aligned} 2x + y &\le 16 && \text{cutting}\\ x + y &\le 10 && \text{finishing}\\ x \ge 0, \quad y &\ge 0 \end{aligned}

The profit is the objective function, P=50x+30yP = 50x + 30y. Maximizing or minimizing a linear objective under linear constraints is called linear programming. The points that satisfy every constraint form the feasible region: every allowed week of work.

The workshop's feasible region The region in the first quadrant below both lines 2x + y = 16 and x + y = 10 is shaded. It has four corners: (0, 0), (8, 0), (6, 4) and (0, 10). A dashed profit line, 50x + 30y = 420, touches the region only at the corner (6, 4). 5101551015xy (8, 0) (6, 4) (0, 10)
  • 2x + y = 16
  • x + y = 10
  • 50x + 30y = 420
The workshop's feasible region

Why the best point is a corner

Pick any profit, say 300300 dollars. The weeks that earn exactly 300300 lie on the line 50x+30y=30050x + 30y = 300. Another profit gives a parallel line, and bigger profits sit farther up and to the right. To find the maximum, slide the line in that direction for as long as it still touches the feasible region. At the last moment of contact it meets the region at a corner, or along a whole edge when the line runs parallel to that edge. The lines of equal profit are parallel, so as they sweep across a polygon the last point they touch is a corner, and checking the corners is enough.

Corner point principle. If a linear objective has a maximum or a minimum on a feasible region, it occurs at a vertex of the region.

The method

  1. Name the variables and write the constraints and the objective.
  2. Graph the feasible region.
  3. Find each vertex by solving the two boundary equations that meet there.
  4. Evaluate the objective at every vertex and choose the best.

Worked examples

Common mistakes

Practice problems

  1. A feasible region has vertices (0,0)(0, 0), (5,0)(5, 0), (3,4)(3, 4) and (0,6)(0, 6). Find the maximum and minimum of P=4x+3yP = 4x + 3y.

    Answer

    Maximum 2424 at (3,4)(3, 4); minimum 00 at (0,0)(0, 0)

    Full solution

    At the vertices PP is 00, 2020, 2424 and 1818.

  2. Find the vertices of the region x≥0x \ge 0, y≥0y \ge 0, x+2y≤8x + 2y \le 8, 3x+y≤93x + y \le 9.

    Answer

    (0,0)(0, 0), (3,0)(3, 0), (2,3)(2, 3) and (0,4)(0, 4)

    Full solution

    On the axes: 3x+y≤93x + y \le 9 stops the xx-axis at 33, and x+2y≤8x + 2y \le 8 stops the yy-axis at 44. The slanted lines cross where y=9−3xy = 9 - 3x and x+2(9−3x)=8x + 2(9 - 3x) = 8, so x=2x = 2 and y=3y = 3.

  3. Maximize P=2x+5yP = 2x + 5y over the region in exercise 2.

    Answer

    2020 at (0,4)(0, 4)

    Full solution

    At the vertices PP is 00, 66, 1919 and 2020.

  4. Maximize P=5x+2yP = 5x + 2y over the region in exercise 2.

    Answer

    1616 at (2,3)(2, 3)

    Full solution

    At the vertices PP is 00, 1515, 1616 and 88.

  5. Minimize C=4x+5yC = 4x + 5y subject to x+y≥5x + y \ge 5, x+3y≥9x + 3y \ge 9, x≥0x \ge 0 and y≥0y \ge 0.

    Answer

    2222 at (3,2)(3, 2)

    Full solution

    The corners are (0,5)(0, 5), (9,0)(9, 0), and (3,2)(3, 2), where x+y=5x + y = 5 meets x+3y=9x + 3y = 9. The costs are 2525, 3636 and 2222.

  6. A student can work at most 1212 hours a week: tutoring at 1515 dollars an hour and at a store at 1010 dollars an hour. The store needs at least 44 hours, and tutoring is limited to 66 hours. How should the student split the week to earn the most?

    Answer

    66 hours of tutoring and 66 at the store, for 150150 dollars

    Full solution

    With xx hours tutoring and yy at the store: x+y≤12x + y \le 12, y≥4y \ge 4 and 0≤x≤60 \le x \le 6. The corners are (0,4)(0, 4), (6,4)(6, 4), (6,6)(6, 6) and (0,12)(0, 12), and E=15x+10yE = 15x + 10y gives 4040, 130130, 150150 and 120120.

  7. Explain why P=x+yP = x + y has no maximum on the region x≥0x \ge 0, y≥0y \ge 0, x+y≥4x + y \ge 4. What is its minimum?

    Answer

    The region is unbounded; the minimum is 44.

    Full solution

    Points such as (100,100)(100, 100) lie in the region, and PP can be made as large as we like. The smallest value, 44, occurs all along the edge from (4,0)(4, 0) to (0,4)(0, 4).

  8. Maximize P=2x+2yP = 2x + 2y subject to x≥0x \ge 0, y≥0y \ge 0, x+y≤5x + y \le 5 and 2x+y≤82x + y \le 8.

    Answer

    1010, at (3,2)(3, 2), at (0,5)(0, 5), and at every point of the edge between them

    Full solution

    The corners are (0,0)(0, 0), (4,0)(4, 0), (3,2)(3, 2) and (0,5)(0, 5), with PP equal to 00, 88, 1010 and 1010. The objective’s lines are parallel to the edge x+y=5x + y = 5.

  9. Could the workshop build 55 bookshelves and 55 tables in one week? How does that profit compare with the best week?

    Answer

    Yes; it earns 400400 dollars, 2020 less than the best week.

    Full solution

    Cutting takes 2(5)+5=15≤162(5) + 5 = 15 \le 16 hours and finishing 5+5=10≤105 + 5 = 10 \le 10 hours, so the point is in the region, on its edge. Its profit is 50(5)+30(5)=40050(5) + 30(5) = 400, less than 420420 at (6,4)(6, 4).

  10. A student maximizes P=3x+2yP = 3x + 2y over the workshop’s region by checking only (8,0)(8, 0) and (0,10)(0, 10), and reports 2424 at (8,0)(8, 0). What went wrong?

    Hint

    How many corners does the region have?

    Answer

    The student skipped the corner (6,4)(6, 4), where P=26P = 26 is the maximum.

    Full solution

    The region has four corners. At (0,0)(0, 0), (8,0)(8, 0), (6,4)(6, 4) and (0,10)(0, 10) the values are 00, 2424, 2626 and 2020. The corner where the two constraint lines cross beats both corners on the axes.

Frequently asked questions

What is linear programming?

A method for finding the largest or smallest value of a linear expression, the objective, when the variables must satisfy a system of linear inequalities, the constraints.

What is a feasible region?

The set of points that satisfy every constraint. In two variables it is a region of the plane, often a polygon.

Why is the maximum always at a vertex?

The points with one objective value form a line, and changing the value slides that line parallel to itself. Pushed as far as the region allows, the line last touches a corner.

What if two vertices give the same best value?

Then every point on the edge between them is also best. The objective's lines are parallel to that edge.

Can a linear programming problem have no maximum?

Yes, when the feasible region is unbounded in the direction that increases the objective. A minimum may still exist.

What to learn next

Standards alignment

This lesson covers the following Common Core State Standards for Mathematics.

  • CCSS.MATH.CONTENT.HSA.CED.A.3Creating EquationsRepresent constraints by equations or inequalities, and by systems of equations and/or inequalities, and interpret solutions as viable or nonviable options in a modeling context.
  • CCSS.MATH.CONTENT.HSA.REI.D.12Reasoning with Equations and InequalitiesGraph the solutions to a linear inequality in two variables as a half-plane (excluding the boundary in the case of a strict inequality), and graph the solution set to a system of linear inequalities in two variables as the intersection of the corresponding half-planes.