Learn
Lesson · Linear Programming Models · What a model is

From a Situation to a Linear Program

Three questions, answered in a fixed order, turn a paragraph into a linear programme: what do I decide, what do I want, what stops me. The first answer is a list of variables with a unit on each, the second is one linear expression in those variables, and the third is one row for every limit — including the sign restrictions, which are constraints and not conventions about what letters mean.

what do I decide → variables, a unit on each C, T in units what do I want → one expression in them 3C + 5T what stops me → one row per limit C ≤ 4 2T ≤ 12 3C + 2T ≤ 18 → and the sign restrictions C, T ≥ 0
Three questions, and where each answer goes

Core ideas

What this lesson establishes

The hard part is the first question. An answer to the second one written in the first slot survives a perfectly correct solve, and the solve will not tell you.

1

A decision variable is a quantity you control

C is the number of chairs the workshop makes this week, in units. You can set it, and everything else in the paragraph either limits it or is computed from it. Two tests: could you hand the number to somebody as an instruction, and does it have a unit? The hours a chair takes are data, the hours available are data, and the chairs are the decision.

2

The objective is an expression in the decisions, not a variable of its own

Profit here is 3C + 5T, a number you read off once the decisions are fixed rather than something you choose. Giving it a letter and a row of its own adds a column the model does not need and a row that says nothing, and it hides the resource that actually binds.

3

Every limit is a row, and the sign restrictions are rows

A limit becomes one inequality carrying the same unit on both sides. C ≥ 0 is one of them: a workshop cannot make −2 chairs, and dropping the line leaves a different model with a different answer. The lab checks a typed point against the sign restrictions in the same shape as the rest for exactly that reason.

The material

The three questions, and the model they produce

What a decision variable is, what the objective may and may not be, and how a candidate point is checked.

Definition · Linear programme

A 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 paragraph

A 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 plan

At (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.

Interactive

Product mix, written from a table

Per-unit rates down the columns, availabilities down the right

Product mix, written from a tablePer-unit rates down the columns, availabilities down the right
the feasible regionits cornersthe winning corner

Method

Turning a paragraph into a programme

Four passes over the same paragraph, in this order. Doing them at once is what produces a model with profit on both sides.

1

Name the decisions and give each one a unit

Write C = chairs made this week, in units rather than C = chairs. The unit is what lets you check a row later, and a quantity you cannot put a unit on is usually not a decision.

2

Write the objective as an expression in those names

One line, with its own unit: pounds a week, litres, hours. If the expression needs a quantity that is not in the list of decisions, the list is incomplete — go back rather than inventing a variable to hold the total.

3

Write one row per limit, and check both sides for units

Each limit is one inequality. Read it across and name what the left-hand side measures and what the right-hand side measures; if they differ, the row is wrong before it is solved and no amount of solving will say so.

4

Add the sign restrictions, then test a point by hand

List C ≥ 0 beside the rest. Then pick a point you believe in and check it against every row in turn, writing the difference down. A sign error shows up here in a minute and nowhere else at all.

Decisions, objectives and rows

Score 0 / 0

The workshop, written down and then tested at two points

The three questions first, each answered in its own block, and only then the arithmetic. The check at the end is the part most readers skip and the part that finds the error.

what do I decide C = chairs made this week, in units T = tables made this week, in units what do I want maximise 3C + 5T pounds a week what stops me C ≤ 4 bench hours in the carpentry shop 2T ≤ 12 hours in the finishing shop 3C + 2T ≤ 18 hours on the assembly line C, T ≥ 0 the candidate (2, 6) carpentry 2 ≤ 4 left minus right = −2 holds finishing 12 ≤ 12 left minus right = 0 holds assembly 6 + 12 ≤ 18 left minus right = 0 holds C ≥ 0 2 holds T ≥ 0 6 holds objective 6 + 30 = 36 the candidate (4, 6) assembly 12 + 12 ≤ 18 left minus right = 6 broken objective 12 + 30 = 42, and nobody can run it

The second candidate is the one worth studying. It scores 42 against 36 and it is not a plan at all: the assembly line is over its limit by 6 hours. The difference between a better plan and an impossible one is exactly this table, and a model you cannot check by hand is a model you are trusting rather than using.

For a faded rehearsal, let the workshop make benches too. A bench takes 1 bench hour, 1 finishing hour and 2 assembly hours, and earns 4. The supplied first move is the unit: benches are counted in units made this week, so the new column enters all three rows and the objective. Write the three rows out, then check (1, 9/2, 3) against each of them and against the three sign restrictions before you look at what the lab reports — and notice that the answer is a fraction, which is a thing a workshop will have to be asked about later.

Common mistakes

1
Writing the objective into the variable slotProfit, cost, revenue and “the total” are expressions in the decisions. A variable list that opens with profit has answered the second question in the first slot, and the row that follows — P = 3C + 5T — adds a letter and no information. The test is whether the number could be handed over as an instruction: “make 2 chairs” is one, “earn 36 pounds” is not.
2
Dropping the sign restrictions because they look obviousC ≥ 0 and T ≥ 0 are two of the five rows here. Without them the region is unbounded to the south-west and the optimum moves, so they are constraints rather than a convention about what a letter may mean. Any lab verdict that surprises you is worth checking against them first.
3
Turning a datum into a decisionThe 18 assembly hours and the 3 hours a chair takes are given. Promoting an availability to a decision produces a model whose answer is “make everything”, and the row it came from has quietly become an equation about a quantity nobody controls.

Check your understanding

✓
Finish when the three questions are answered separately, in order, before any algebra.

You should be able to read a paragraph and produce the variables with their units, the objective, every row including the sign restrictions, and then a point you have checked by hand against each row in turn — naming the row that fails when one does.

Note: The third question keeps taking four shapes, and they are the four model families. “Product Mix and Packing Constraints” is usage ≤ availability; “Covering and Diet Models” is supply ≥ requirement; “Blending and Ratio Constraints” is a percentage of a total the decisions themselves make up; and “Multiperiod Planning and Balance Constraints” is one equation for each period, linking it to the period before.

Kept in this browser only, for you. Nothing is sent anywhere and nothing checks it. Carry it to another device.

Feedback and recommendations

Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.

No recommendations yet for this lesson.