Method · Linear Programming
Graphing constraints and optimising in linear programming
Turn the conditions into inequalities, draw each boundary line, shade the region that satisfies them all, then test the corner points in the objective function to find the maximum or minimum.
What this method is for
Linear programming answers a very practical question: given a set of limits, what choice makes some quantity as large or as small as possible? A workshop might ask how many of two products to make to maximise profit, subject to limits on time and materials.
Each limit becomes a linear inequality in two variables and .
We draw all the inequalities on one set of axes and shade the feasible region, the set of points that satisfy every constraint at once. The thing we want to maximise or minimise (profit, cost, score) is the objective function, a linear expression such as .
Because the objective is linear, its greatest and least values over the region always occur at a corner (vertex), so the method finishes by testing those corners.
When to reach for it
Reach for this method when a question gives two unknowns and several conditions expressed as 'at least', 'at most', 'not more than', or 'no fewer than', then asks for the maximum or minimum of some quantity. The words 'greatest profit', 'least cost', 'shade the region ', or 'find the maximum value of' are strong signals.
You will usually first translate a short story into inequalities, then graph. If a problem has only one variable, or asks simply to solve equations rather than to optimise within a region, it is not a linear programming question.
The presence of a region to shade together with a quantity to make as big or as small as possible is what marks this topic out.
The method, step by step
- 1
Define the variables
Let and stand for the two unknown quantities, stating clearly what each represents.
- 2
Form the inequalities
Translate every condition into an inequality, and include and where the quantities cannot be negative.
- 3
Draw the boundary lines
Treat each inequality as an equation and draw its line, using two clear points per line.
- 4
Shade the feasible region
Test a point (often the origin) in each inequality and shade the region that satisfies all of them.
- 5
Write the objective function
State the quantity to optimise, for example .
- 6
Test the vertices
Find the corner points of by solving pairs of lines, then substitute each into the objective function.
- 7
State the optimum
Choose the vertex giving the largest (or smallest) value and quote both the point and that value.
Worked example
A small workshop makes tables and chairs, where and satisfy , , and . The profit is .
Find the values of and that maximise the profit, and state the maximum profit.
Show worked solution
The feasible region is bounded by the lines , , the -axis and the -axis . Find the corner points by taking the boundary lines in pairs.
The corners are: ; from and ; from and (so ); and from and .
Substitute each corner into :
The largest value is , at the point .
So the profit is a maximum when and , giving a maximum profit of .
Common mistakes to avoid
- Getting the inequality direction wrong ( versus ) and shading the wrong side of a line.
- Forgetting the hidden constraints and , which changes the shape of the region.
- Reading vertex coordinates off the graph by eye instead of solving the two lines simultaneously for exact values.
- Testing only some corners, or testing an interior point, the optimum of a linear objective always sits at a vertex.
- Mixing up which variable is and which is when translating the story into inequalities.
How one-to-one teaching helps
The step where marks slip away is forming the inequalities and shading the right side, get one direction wrong and the whole region, and answer, follow it. In a one-to-one lesson our teachers work through the translation with you sentence by sentence, then check each shading by testing a point, so the region is correct before any optimising begins.
We also insist on solving lines simultaneously for exact vertices rather than reading them off the graph. Teachers at spmaddmath.com.my are experienced, and lessons are online and taught in English.
To see how we teach linear programming, message us on WhatsApp to arrange a one-hour paid class from RM50/hr at the teacher's rate.
Get 1-to-1 help.
Book a Trial ClassFrequently asked questions
How do I know which side of a line to shade?
Pick a test point not on the line, the origin is easiest when the line does not pass through it. Put it into the inequality: if the statement is true, shade the side containing that point; if false, shade the other side.
Why do I only need to test the corner points?
The objective function is linear, so over a polygon-shaped feasible region its maximum and minimum always occur at a vertex. Testing every corner and comparing the values is therefore enough, you never need to check interior points.
What does the feasible region represent?
It is the set of all points that satisfy every constraint at the same time. Any point inside or on its boundary is an allowed choice; the best allowed choice is the vertex that optimises the objective function.
Do I always include and ?
Include them whenever the quantities cannot be negative, which is almost always the case for counts of items, amounts of money, or time. These constraints keep the region in the first quadrant and are easy to forget, so add them as you list the inequalities.
Source:SRC-DSKP-EN