Definition · Linear programmeA linear programme is a list of decision variables, an objective that is a linear expression in them to be maximised or minimised, and finitely many constraints, each a linear equation or inequality in the same variables. The sign restrictions C ≥ 0 are constraints like any other.
Linear means every variable appears multiplied by a constant and then added: 3C + 5T is linear, and 3CT, C² and C/T are not. That is the whole of the class. Much of this course is spent recognising when a requirement has left it — and rather more of it on the requirements that look as though they have and have not.
The three questions are worth writing as three separate lists before any algebra. What do I decide, what do I want, what stops me. They are asked in that order because the second and third are both expressions in the answer to the first, so there is nothing to write until the first is settled.
Example · A workshop, as a paragraphA workshop makes chairs and tables. A chair takes 1 bench hour in the carpentry shop and 3 hours on the assembly line; a table takes 2 hours in the finishing shop and 2 hours on the assembly line. The week has 4 bench hours, 12 finishing hours and 18 assembly hours in it. A chair earns 3 pounds and a table 5. What should the workshop make?
The decisions are the chairs and the tables, C and T, both counted in units made this week. Nothing else in that paragraph is a decision: the rates are properties of the products and the availabilities are properties of the week.
maximise 3C + 5T pounds a week
subject to C ≤ 4 bench hours, carpentry
2T ≤ 12 finishing hours
3C + 2T ≤ 18 assembly hours
C, T ≥ 0
Read one row across and check its units. In the carpentry row the coefficient is 1 bench hour for each chair, so the left-hand side is bench hours; the right-hand side is 4 bench hours. Both sides agree, which is the cheapest available check that a row is about what you think it is about.
The answer to the second question, written in the first slot
The commonest broken model on this course introduces P for profit, adds the row P = 3C + 5T, and maximises P. Nothing is gained. P is determined by C and T, so the new column carries no freedom and the new row carries no information; the model has one more variable and one more equation and exactly the same optimum.
The related move is to write a target as a constraint: 3C + 5T ≥ 500. That is a legal row, and it is a different question — it asks whether 500 can be reached, not what the best achievable profit is. A reader who adds it to the model above and then maximises the same expression has written the objective twice and constrained nothing that matters.
Checking a candidate point
A model is worth solving once you can test a point in it by hand. Take a point, substitute it into each row separately, and record the left-hand value, the right-hand value and the difference. A point that fails should fail with the name of a row attached to it; “the solver rejected it” is not a diagnosis.
Example · Two points, one of them not a planAt (2, 6) the three rows read 2 ≤ 4, 12 ≤ 12 and 18 ≤ 18, both sign restrictions hold, and the objective is 36. At (4, 6) the objective is 42, which is larger, and the assembly row reads 24 ≤ 18: over by 6 hours. The second point is not a worse plan, it is not a plan.
That is also why C ≥ 0 is a constraint rather than a convention. Drop the two sign restrictions from the workshop and the region runs away to the south-west, where the model cheerfully unmakes tables to free assembly hours for chairs. The rows are not decoration; they are two of the five things a point has to satisfy.