Solving Linear Programming Problems Graphically: Constraints, Corners and Slack
Turn a word problem into inequalities, shade the feasible region, test every corner point and read binding constraints and slack, with a worked example.

Solving Linear Programming Problems Graphically: Constraints, Corners and Slack
Linear programming answers questions like "how many of each product should we make to earn the most?" when time, money or materials are limited. With two unknowns the whole problem fits on one graph, and the method is the same every time: translate, draw, list the corners, compare. This guide walks through each stage with a bakery example and points out the errors that cost marks most often.
Step 1: translate the words
Start by naming the decision variables in a full sentence. Here, let x be the number of trays of bread and y the number of trays of cakes baked per day. Then write the objective, the quantity to maximise or minimise, as a linear expression. Next turn each limitation into an inequality, and finally add the non-negativity conditions x ≥ 0 and y ≥ 0, which say you cannot bake a negative number of trays.
Our bakery earns 5 dollars profit per tray of bread and 4 per tray of cakes, so P = 5x + 4y. Each tray of either kind needs one hour of oven time and the oven is free for 8 hours: x + y ≤ 8. Bread needs 2 kg of flour per tray and cakes 1 kg, with 12 kg available: 2x + y ≤ 12. The shop cannot sell more than 6 trays of cakes: y ≤ 6.
Step 2: draw the feasible region
Draw each constraint as a line by finding its two intercepts. For x + y = 8 those are (8, 0) and (0, 8); for 2x + y = 12 they are (6, 0) and (0, 12); y = 6 is horizontal. Decide which side of each line is allowed by testing the origin: 0 + 0 ≤ 8 is true, so the allowed side contains (0, 0). The feasible region is the overlap of all allowed sides. Here it is a five-sided shape in the first quadrant.
Step 3: find every corner
Corners are where two boundary lines meet and every other constraint still holds.
- (0, 0), the origin.
- (6, 0), where the flour line meets the x-axis.
- Flour and oven lines together: subtract x + y = 8 from 2x + y = 12 to get x = 4, so y = 4. Corner (4, 4).
- Oven line and y = 6: x = 2. Corner (2, 6). Check flour: 2·2 + 6 = 10, which is within 12.
- (0, 6), where y = 6 meets the y-axis.
Note that (0, 8) is not a corner of the region, because it breaks y ≤ 6. Intersections must always be tested against all constraints.
Step 4: evaluate the objective
The corner point theorem says that if a bounded region has an optimum, it occurs at a corner. So we only need five evaluations:
| Corner | P = 5x + 4y |
|---|---|
| (0, 0) | 0 |
| (6, 0) | 30 |
| (4, 4) | 36 |
| (2, 6) | 34 |
| (0, 6) | 24 |
The maximum profit is 36 dollars, from 4 trays of bread and 4 trays of cakes.
Step 5: read slack and binding constraints
At (4, 4) the oven uses 4 + 4 = 8 hours, all of them, and flour uses 2·4 + 4 = 12 kg, also all of it. Both of those constraints are binding. The cake limit allows 6 but only 4 are baked, so it has a slack of 2. In plain terms, more oven time or flour could raise profit, but raising the cake sales limit would change nothing at the moment.
Common mistakes
- Shading the wrong side of a line. Always test a point.
- Including an intersection point that violates another constraint.
- Forgetting x ≥ 0 and y ≥ 0, which adds impossible corners with negative values.
- Writing "at most" as ≥ or "at least" as ≤.
- Assuming every problem has an answer. A region can be empty, or open in the direction the objective improves, in which case there is no maximum.
How to check your answer
Substitute the optimal point into every constraint and confirm each one holds. Then slide a level line of the objective, such as 5x + 4y = 20, parallel to itself across the region; the last point it touches before leaving should be your optimum. If two corners give the same best value, the whole edge between them is optimal.
Doing it with the tool
The Linear Programming Graphical Solver follows the same five steps. Pick Maximise, enter 5 and 4 as the objective coefficients and name the variables bread and cakes. Add three constraint rows, 1, 1, ≤, 8 and 2, 1, ≤, 12 and 0, 1, ≤, 6, and keep the non-negativity boxes ticked. The graph shades the region, the corner table should list the same five points and values as above, and the slack table should show zero for oven and flour and 2 for cakes. Change the cake profit to 6 and see the optimum move to (2, 6) with P = 46.
Limits
The graphical method works only for two variables; three or more need the simplex method or software. The solver does not force whole-number answers, so if a problem needs integer quantities and the optimum is fractional, you must check nearby whole points yourself. It also does not give sensitivity ranges. Use it as a study aid to check your sketches and corner calculations, not as a business planning tool.


