From a Described Problem to a Model

What you will be able to do

Given a decision problem described in words, the learner can define decision variables with meanings and units, write the objective with its direction, write one constraint per stated restriction, and state which described quantities are data rather than variables.

Orientation

A paragraph describing a decision does not say which of its numbers you are allowed to change. Deciding that is the first move, and it is the one most often skipped.

Three questions produce a model: what is chosen, what counts as better, and what limits the choice. Each has a form it takes on the page, and answering them out of order is where the familiar faults come from. An objective written before the variables have meanings acquires its symbols retroactively, and by the time the units stop matching the mistake is several lines back.

The discipline is cheap and it transfers. It does not depend on the expressions being linear, so it is the same procedure whether the model that follows is a linear program, an integer program, or something this subject does not cover.

This unit assumes you can name the three parts of a constrained optimization problem.

Intuition

Three questions, three grammatical roles

The three parts of a model answer three different questions, and most modelling trouble is a sentence assigned to the wrong one.

What may I set? A decision variable is something the decision maker can walk out and change. Weekly production of a product: yes. The market price of a raw material: no, that is data. This test is worth applying before any algebra exists, because it is much harder to apply afterwards, when a symbol has already appeared in four expressions.

What counts as better? The objective needs a direction as well as an expression. The same function of the same variables describes two different problems depending on whether it is pushed up or down, so a model with the expression and no direction is not yet a model.

What am I not allowed to do? Each constraint should forbid something. The check is to name an assignment it rules out that the rest of the model would otherwise permit. "Production is nonnegative" forbids negative production, which is real work. "Total production equals the sum of the products" usually forbids nothing, because the sum is how total production was defined.

Units catch errors before reasoning does. If one side of a constraint is in tonnes and the other in machine-hours, the constraint is wrong, and noticing that requires only that the units were written down when the variables were defined.

Definition

What each part of a model is

Decision variables. The quantities the decision maker sets. Each carries a symbol, a meaning, and a unit:

x j = tonnes of product  j  produced per week , j = 1 , … , n .

The unit is part of the definition. Without it, dimensional consistency cannot be checked later, and a constraint mixing tonnes with hours looks exactly like a correct one.

Data. Every other number in the description: prices, capacities, requirements, rates. Data appears as coefficients. A quantity is data when the decision maker does not set it, whatever role it plays in the story.

Objective. A function of the variables, with a direction:

max ∑ j = 1 n c j x j or min ∑ j = 1 n c j x j .

Each coefficient c j has a unit too, and c j x j must carry the unit of the objective. Profit per tonne times tonnes gives profit; profit per tonne times hours gives nothing.

Constraints. One per restriction, each a relation between functions of the variables:

∑ j = 1 n a i j x j ≤ b i , i = 1 , … , m .

The coefficient a i j is the amount of resource i consumed per unit of activity j , and b i is what is available. Both are data.

Sign restrictions. A statement about which values a variable may take, written explicitly:

x j ≥ 0 .

This is a modelling decision, not a default. A quantity that can genuinely go either way, a net cash position, a temperature difference, must not carry it.

Procedure

Turning a description into a model

Read the description once without writing anything. The aim is to find the decision being made. A description usually contains one, stated somewhere other than the first sentence.

List the quantities, and sort them into chosen and given. For each, ask whether the decision maker sets it. The ones they set become variables; the rest are data. Disputed cases are worth settling here rather than later: a quantity promoted to a variable becomes something the solution selects, which answers a different question than the one asked.

Define each variable with a symbol, a meaning, and a unit. Write the unit in every case. It is the input to every dimensional check that follows, and it costs one word.

Write the objective, with its direction. Check that each coefficient times its variable carries the unit of the objective. A mismatch here means a variable was defined in the wrong unit, and it is cheaper to fix now than after the constraints are written in terms of it.

Go through the description one sentence at a time and classify each. A sentence either states a restriction, supplies data, or is commentary. Only the first produces a constraint.

Write one constraint per restriction, and name what it forbids. If nothing comes to mind, the sentence was data or commentary, or the restriction is already implied by another constraint. A constraint that forbids nothing costs the solver time and tells a reader the model is more careful than it is.

Decide sign restrictions deliberately. Ask of each variable whether a negative value would mean anything. If it would, do not restrict it; if it would not, say so explicitly.

Read the model back as English. Each line should map onto a sentence of the description, and each restriction in the description should map onto a line. A restriction with no line is the common failure; a line with no restriction is the other one.

Worked example

A workshop description, translated

Description. A workshop makes chairs and tables. A chair uses 2 hours of carpentry and 1 hour of finishing; a table uses 4 hours of carpentry and 1 hour of finishing. There are 80 carpentry hours and 30 finishing hours available each week. Chairs sell at a profit of £20, tables at £45. Timber costs £8 per cubic metre and is not in short supply. At least 5 chairs must be made each week to hold a standing order. Plan a week to maximise profit.

---

Step 1: find the decision. The last sentence names it: plan a week's production. What is produced is what the workshop sets.

Step 2: sort the quantities. Chairs made and tables made are chosen. Hours per item, hours available, profit per item, the timber price and the standing order quantity are all given. The timber price is data that turns out to be irrelevant and is therefore not modelled: it constrains nothing and appears in no objective term, because profit per item is already stated net.

Step 3: define the variables.

x 1 = chairs made per week , x 2 = tables made per week .

Both are counts per week.

Step 4: write the objective with its direction.

max 20 x 1 + 45 x 2 .

Pounds per chair times chairs gives pounds. The units check.

Step 5: classify each remaining sentence.

SentenceKindLine
A chair uses 2h carpentry, a table 4hdatacoefficients
80 carpentry hours availablerestrictionconstraint
A chair uses 1h finishing, a table 1hdatacoefficients
30 finishing hours availablerestrictionconstraint
Timber costs £8/m³, not scarcecommentarynone
At least 5 chairsrestrictionconstraint

Step 6: write one constraint per restriction.

2 x 1 + 4 x 2 ≤ 80 .

Forbids: any plan needing more than 80 carpentry hours. Hours per chair times chairs gives hours; the units check.

x 1 + x 2 ≤ 30 .

Forbids: any plan needing more than 30 finishing hours.

x 1 ≥ 5 .

Forbids: honouring the standing order incompletely.

Step 7: sign restrictions. Negative production means nothing here, so

x 1 , x 2 ≥ 0 .

The first constraint already forces x 1 ≥ 5 , so nonnegativity on x 1 adds nothing, but it costs nothing and stating both keeps the model readable when the standing order is later removed.

Step 8: read it back. Three restrictions in the description, three constraints. One sentence produced no line, and the reason is recorded: the timber price restricts nothing.

The complete model.

max 20 x 1 + 45 x 2 subject to 2 x 1 + 4 x 2 ≤ 80 , x 1 + x 2 ≤ 30 , x 1 ≥ 5 , x 1 , x 2 ≥ 0 .

Non-example

Four lines that are not constraints

A definition restated as a constraint. A modeller defines T as total output and writes T = x 1 + x 2 alongside the production limits. The equation is true, and it forbids nothing: T was introduced to mean that sum, so no assignment of x 1 and x 2 can violate it. It is a definition, and treating it as a restriction suggests the model constrains more than it does.

A price that nobody chooses. The description mentions a raw material at £8 per cubic metre, so the model includes p = 8 . A variable fixed to its own value is not a decision. Either the price belongs in a cost coefficient or it belongs nowhere, and writing it as a variable invites a later edit in which the price becomes a decision.

A restriction the data already enforces. A workshop with 30 finishing hours, one hour per item, is given the constraint x 1 + x 2 ≤ 500 "for safety". The finishing constraint already caps the total at 30. The safety line removes nothing from the feasible set.

A sentence about the world. "Demand for tables is seasonal." True, relevant to the business, and not a restriction on this week's plan unless it is turned into one: a maximum, a minimum, a relationship between the two products. As written there is nothing to encode, and inventing a number to make it encodable puts data into the model that the description never supplied.

What unites these is that each passes a reading test and fails a forbidding test. Checking that a proposed line rules something out is what separates the two.

Contrast

Decision or data

The same quantity can be a decision in one model and data in another, decided by who is doing the deciding. The question is never what kind of thing it is, but whether this decision maker sets it.

QuantityDecision whenData when
Selling priceThe firm sets its own priceThe price is quoted by the market
Staff hoursOvertime can be authorisedThe roster is fixed for the period
Machine capacityNew capacity can be bought this periodThe plant is what it is this week
Order quantityThe buyer is placing the orderThe order has arrived and must be met
Delivery routeThe planner chooses routesA carrier has already committed

The consequence of getting it wrong runs in one direction more often than the other. Treating data as a decision gives the model freedom the decision maker does not have, and it returns a plan that cannot be carried out: an answer that assumes a price nobody will pay, or capacity that does not exist. Treating a decision as data gives away freedom that was available, and returns a plan that is feasible but worse than necessary.

Both are wrong, and the first is harder to notice, because a model with extra freedom still reports an optimum and still looks solved.

The test: can the decision maker walk out and change this number, within the period the model covers? A capacity that could be expanded next year is data in a weekly plan and a decision in an annual one, and the same description supports both models. Which one is being built has to be stated, because the algebra does not record it.

Exercise

1. A haulier has three lorries and a list of twelve loads to move tomorrow. Fuel costs 1.60 per litre, each lorry burns 0.35 litres per kilometre, and drivers are paid by the hour under an existing contract. Which quantities are decisions and which are data? State one quantity whose classification depends on how far ahead the plan looks.

2. A model defines x i as "warehouse i " and writes ∑ i x i ≤ 3 . Say what is wrong with the variable definition, and rewrite it so the constraint means "open at most three warehouses".

3. A bakery description ends: "Flour costs 0.70 per kilogram and is delivered weekly." Give the circumstances under which this sentence produces a constraint, and the circumstances under which it produces none.

4. For each line, say what assignment it forbids, or that it forbids nothing: (a) x 1 + x 2 ≤ 40 where a separate constraint already gives x 1 ≤ 15 , x 2 ≤ 20 ; (b) x 1 ≥ 0 where x 1 counts items shipped; (c) C = 3 x 1 + 5 x 2 where C was defined as total cost.

5. A planner writes max 12 x 1 + 30 x 2 where x 1 is in units per week and x 2 is in hours of machine time sold. Both coefficients are in pounds per unit of their variable. The objective is dimensionally sound. Give a reason the model may still be wrong, and say what you would check.

6. Take the workshop model from the worked example and suppose the standing order is removed. Which lines change, and which constraint becomes the only thing keeping chair production above zero?

Next step

Practice From a Described Problem to a Model

Practice this

Results update as you type. Use the up and down arrow keys to move between results, Enter to open one, and Escape to close.

Type to search.

Settings

Appearance

Interface density

Your record

Your progress is stored in this browser and nowhere else: an identifier, the answers you have given, the mastery states and review schedule derived from them, and the lesson you last opened. Clearing it makes you a new learner on this device. It cannot be undone, and it will not affect your appearance or density settings.

Focus timer

Focus--minutes remaining

Phase

Kept in this browser only, and used to label the session in your own history.

Today

Nothing recorded yet. Finish a focus session and it will appear here.

Settings

Focus sessions between long breaks.

Sessions you are aiming for in a day.

Notifications

Your history

Sessions are stored in this browser and nowhere else. They are not evidence and never reach your mastery record.