Linear programming: graphical method and simplex

← Back to specs
High school 17 Rooms Optimization Linear algebra

Teaching objectives

How do you get the most out of resources that will not stretch to everything? A workshop making tables and chairs with limited carpentry, upholstery and assembly hours runs through the lab, which covers the graphical method in 17 rooms: setting up the model, drawing the feasible region and finding the optimal vertex, both when maximizing and when minimizing. The simplex method and the dual problem are covered in a separate lab, The simplex method. Aimed at upper secondary.

What you learn

  • Telling apart the roles each number plays in a word problem — variable, objective coefficient, unit consumption, capacity — and turning it into a model with an objective function and constraints (rooms 1-5).
  • Drawing the half-plane satisfying an inequality, intersecting several of them, and recognising the feasible region; reading each resource's slack as the gap left at the top of its bar (rooms 6-10).
  • Finding the optimum with level curves, computing it by solving a 2×2 system once the numbers can no longer be read off the grid, and understanding why it always lands on a vertex (rooms 11-13).
  • Solving a complete maximization problem from start to finish, following the method step by step (room 14).
  • Recognising problems that misbehave: a region with no upper bound and therefore no maximum, an empty region caused by incompatible constraints, and infinitely many optimal solutions along an edge (room 15).
  • Minimizing with "at least" constraints, where the region opens up instead of being enclosed, and solving a complete minimization problem from start to finish (rooms 16 and 17).

Key mathematical ideas

  • A constraint splits the plane in two; the feasible region is the intersection of all the valid half-planes and is always convex.
  • The slack of a resource is what is left over: zero means the constraint is active and the point rests on its line.
  • Because the objective function is linear, its level curves are parallel straight lines. That is why the optimum is reached at a vertex, except when the level line is parallel to an edge, in which case the whole edge is optimal.
  • A problem may have no solution: when the feasible region is empty, or when it is unbounded in the direction in which the objective improves.

Room-by-room contents

Room 1 · The furniture workshop

The hook of the lab, without a single formula. Two sliders choose how many tables and how many chairs are made, and three bars show live how much carpentry, upholstery and assembly time is used: the filled part is what is used and the gap at the top is what is left over. If a bar overflows, it turns red and the plan is impossible. The goal is to reach €33 of profit without overflowing any bar, and once that is achieved, the room points out that some bar has had to end up completely full.

Student tasks

  • Move the sliders looking for a feasible plan that gives €33 or more.
  • Work out how many chairs assembly allows if 4 tables are already being made.
  • Decide which resource runs out first if only chairs are made.

Room 2 · What role each number plays

Before writing anything, you need to know what is what. The workshop problem stays in view throughout the room, and the student sorts the highlighted parts into four roles: decision variable, objective coefficient, unit consumption and resource capacity. This is half the work of modelling, and the half that is usually taken for granted.

Student tasks

  • Classify three fragments of the problem statement by the role they play.
  • Tell a per-unit consumption apart from a total capacity.

Room 3 · From the sentence to the inequality

The algebraic step: if each table takes 3 hours, x tables take 3x. With that a whole constraint can be written, and the room explains why the sign is ≤ and not =. An editable consumption table lets you change the coefficients and watch the corresponding line rotate; when two sliders are moved, the name of what is being seen appears — the feasible region — and the plane becomes clickable for inspecting specific plans one at a time.

Student tasks

  • Write the algebraic expression for the total time used by the tables.
  • Translate two different statements into their inequalities.
  • Compute the assembly hours used by a given plan.

Room 4 · The profit map

The constraints are set aside for a moment and the whole plane is coloured by the profit at each point. Because the objective function is linear, the colour comes out in straight, parallel bands: the level curves appear on their own. One slider does not change the profit — which depends on x and y — but asks the picture where the plans giving exactly that profit are, and the answer is always a straight line. Two other sliders change what each piece of furniture is worth and rotate the whole family.

Student tasks

  • Compute the profit of a specific plan.
  • Compare three plans and decide which gives the most.
  • Explain why the lines of equal profit are parallel.

Room 5 · Build the model yourself

A new problem — a bakery — which the student models from scratch by filling in the consumption table: what one unit of each product uses and the total available. If something does not add up, from the second attempt onwards a specific hint appears for each wrong cell. Once the table is complete, the model writes itself out below. The room ends with a challenge to tick every condition the model is missing, which separates what the student decides from what is given in the problem.

Student tasks

  • Fill in the consumption table from the problem statement.
  • Recognize which inequality corresponds to each resource.
  • Tick all the missing conditions and tell them apart from quantities that are not decision variables.

Room 6 · One line splits the plane

A single constraint divides the plane in two: one side is valid and the other is not, and you decide which by testing a point, usually the origin. The point can be dragged while the resource bar fills up and overflows as it crosses the line. Then the student builds a new constraint from a sentence — for each table, at least two chairs — and, once it is right, its line is drawn and the student is asked to tap a point that satisfies it; only then is the whole region coloured.

Student tasks

  • Decide which side of the line satisfies the constraint.
  • Compute the consumption of a plan that exceeds the limit.
  • Translate “at least 2 chairs per table” into an inequality and mark a point that satisfies it.

Room 7 · Meeting two conditions at once

With two constraints, what is valid is the intersection of the two half-planes. Three buttons show each constraint separately and both together, with a draggable point marked green or red according to whether it satisfies each one. Computing where the two lines cross highlights that point and explains what it is for: one of the vertices is always the answer to the problem.

Student tasks

  • Choose, from four plans, the only one that satisfies both constraints.
  • Find where the two lines intersect.

Room 8 · The feasible region

All the constraints together, including non-negativity, cut out a polygon: inside it is everything that can be made. The draggable point is linked to the three bars and to a label saying whether the plan is possible, along with the profit it gives.

Student tasks

  • Decide whether a specific plan is feasible and justify why it is not.
  • Compute the slack of two different resources at the same point.

Room 9 · Constraints at their limit

A constraint is active when its bar is completely full, that is, when the point rests exactly on its line. The point snaps to whole-number coordinates — without that it is almost impossible to hit the edge by hand — and there are buttons that jump to each of the five vertices. What emerges is that the corners are exactly the places where two bars are full at once.

Student tasks

  • Identify which constraints are active at a given vertex.
  • Count how many constraints hold with equality at any corner.

Room 10 · The corners of the region

Each vertex is the solution of a 2×2 system formed by the two lines that cross there. A fully worked example is shown, and then the student picks two lines and the widget solves the system step by step, marking the point on the drawing.

Student tasks

  • Solve two 2×2 systems to find the coordinates of two vertices.
  • Compute the profit at the vertex found.
  • Count the vertices of the region.

Room 11 · Sweeping for profit

As the level line is pushed towards higher profits, the optimum is the last place where it still touches the region. A button animates the sweep and stops it exactly at that contact, highlighting the winning vertex; another button replays it. The second challenge asks for the slope of the level line, and the typical mistakes get their own responses: changing the sign and solving for the wrong variable receive different messages.

Student tasks

  • Decide in which direction the level line must be pushed.
  • Compute the slope of the profit level line.

Room 12 · When looking is not enough

The same steps, but with large numbers: here the right vertex cannot be read off the grid, and the system of the two lines that cross there has to be solved. This room closes the graphical method, making it clear that the drawing is for deciding which corner to look at, not for reading off the answer.

Student tasks

  • Solve the system 5x + 4y = 120, 3x + 8y = 156.
  • Compute the profit at that vertex.
  • Explain why the drawing alone is not enough.

Room 13 · Why always a corner?

A slider rotates the direction of profit and the winning vertex is seen jumping from one corner to another. At the critical angle — when the level line is parallel to a side — the whole edge lights up: there are infinitely many equally good solutions. This is the visual justification of the theorem on which the whole method rests.

Student tasks

  • Find the angle at which two vertices tie.
  • Say what happens when the level line is parallel to a side of the region.

Room 14 · Solve one from start to finish

The first complete practice, on a new maximization problem, with the statement always in view. Seven steps, one at a time: decide which data are the variables, write the objective function, write the three inequalities, give two points on each line — they are checked against the line, so each student can pick whichever suit them — and, with the lines drawn, find the vertices by tapping the plane and solving the system at each crossing. One of those crossings is real but falls outside the region: the room explains why it is discarded and crosses it off the list.

Student tasks

  • Model the whole problem from the statement.
  • Draw the three lines by giving two points on each.
  • Locate the vertices, solve for them and discard the crossing that is not feasible.
  • Evaluate the objective at the corners and write the solution.

Room 15 · When something goes wrong

Three badly behaved problems, in three tabs: one whose region has no ceiling and therefore no maximum, one with contradictory constraints whose region is empty, and one where the level line is parallel to a side and there are infinitely many optimal solutions. All three are interactive and come with their bars and the value of the objective, so that in each case you can check what fails.

Student tasks

  • Diagnose a problem whose region extends without bound.
  • Diagnose a problem with incompatible constraints.
  • In the unbounded case, find a value of the objective greater than a given threshold.

Room 16 · Minimizing, with «at least»

A cheap diet changes two things at once: now we minimize, and the constraints are minimums instead of maximums, so the region opens upwards instead of being enclosed. The statement and the system stay in view beside the graph, and the level sweep runs in the opposite direction. The room reasons out why a minimum exists here but a maximum does not.

Student tasks

  • Compute the cost of the diet at the optimal vertex.
  • Explain why there is a minimum but no maximum.

Room 17 · Solve a minimization problem

The second complete practice, this time minimizing cost and with constraints of both kinds. The same algorithm as in room 14 is followed — variables, objective, inequalities, lines, vertices, evaluation and answer — with the challenges numbered from start to finish and the graph appearing only when it is time to draw the lines. The table of values is kept until the end, since that is where the answer is read from.

Student tasks

  • Model a minimization problem from scratch.
  • Draw the lines and locate the vertices by solving their systems.
  • Evaluate the cost at each corner and write the final solution.

Rooms to project

The most striking ones to show and discuss in class.

★
Room 1 · The furniture workshop — It is the hook of the lab, and in five minutes it establishes the idea of a limited resource. The bars that fill up and overflow are understood without any prior explanation, and they reappear throughout the lab until they become the slack variables.
★
Room 11 · Sweeping for profit — The animated sweep that stops right at the last contact with the region is the image that best explains the graphical method. Very good for projecting and asking aloud where it will stop before letting it run.
★
Room 13 · Why always a corner? — Rotating the direction of profit and watching the winning vertex jump turns a theorem into something obvious, and the tie case — when a whole edge lights up — also answers the question of whether the solution is always unique.
★
Room 14 · Solve one from start to finish — This is the room to work through in class from start to finish: it makes students go through the whole method on a new problem. The crossing of lines that does not belong to the feasible region is exactly the mistake students make on their own in exams.