Back to the on-screen lesson ·

What optimization is, and when it is worth doing

Prescriptive against descriptive and predictive, the three parts of a model, and the problems a model earns nothing on.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you will be able to tell a decision problem from a description or a forecast, name the three parts of any optimization model — decision variables, objective, constraints — and write them down for a problem stated in words. You will also be able to say what the four possible replies from a solver mean, and to recognise the problems where building a model earns nothing because the alternatives do not interact.

2. What you already have

You have maximised and minimised functions with calculus, and you have solved systems of linear equations with matrices. Both come back immediately. What is new is not a technique but a habit: writing down what is being decided, what is being judged and what is not allowed, before reaching for a method — and then asking what the method you reach for is actually entitled to claim.

3. Words you will need

Decision variable: a quantity you choose. Written $x$, $y$, and given a unit — items made this week, not items.

Objective: the single number being maximised or minimised, written as an expression in the decision variables.

Constraint: a rule any answer must satisfy, written as an equation or an inequality in the same variables.

Feasible: satisfying every constraint. A point is feasible or it is not; there is no partly.

Optimal: feasible, and no feasible point is better. Two words, and the first is the one that gets dropped.

Infeasible: no point satisfies every constraint at once.

Unbounded: feasible points exist and the objective improves along the region for ever.

4. Prescriptive, not descriptive

Three questions can be asked of the same data, and they are not the same question.

QuestionWhat it answersWhat comes back
DescriptiveWhat happened?a summary
PredictiveWhat is likely to happen?a forecast
PrescriptiveWhat should we do?a decision

Mathematical optimization answers the third. Given a set of available alternatives and a criterion, it selects the best element of that set. Prediction and optimization work together and are constantly confused: a forecast supplies the numbers a model is built on, and the model chooses the action. Machine learning finds patterns in data; optimization decides what to do given the rules. Neither substitutes for the other.

The three parts. Every model has the same three, and naming them is most of the work:

When it is not worth doing. A model earns its cost only when the alternatives interact: when improving one thing spends something another needs. Where the best answer can be read off a sorted list, a model adds machinery and returns what you already knew. And a model is never finished: the costs, capacities and demands it rests on drift, so it is re-solved rather than solved.

Another way: picture

A shaded region on a pair of axes, with a straight line sliding across it. The region is what the constraints allow; the line is one value of the objective. Slide the line as far as it will go while it still touches the region: where it last touches is the decision optimization returns.

Another way: steps

Faced with a decision problem, ask four questions in this order:

  1. What am I choosing? Name the decision variables, with their units.
  2. What is being judged? One number, maximised or minimised. If there are two, unit 5 is where that is dealt with; do not average them yet.
  3. What is not allowed? Write each rule as an equation or an inequality in those variables.
  4. Would a list do? If the alternatives do not interact, stop. There is no model here worth building.

5. Four things a model can turn out to be

A solver does not always hand back an answer, and the other three replies are as informative as the first.

ReplyWhat it meansWhat to do
Optimala feasible point, and none betterread the decision off it
Infeasibleno point satisfies every constraintone constraint too many, or one written wrongly
Unboundedthe objective improves for evera constraint is missing
Many optimaan entire face is optimalthe objective is parallel to a binding constraint; choose among them on other grounds

Infeasible and unbounded are almost always statements about the model rather than the world. A real workshop cannot make infinite profit, so an unbounded model has forgotten to say that something runs out.

6. Where this goes wrong

Optimising a proxy. The objective is the thing that gets maximised, whether or not it is the thing you wanted. A delivery model told to minimise distance will happily produce a route nobody can drive inside a shift.

Treating a forecast as a fact. The demand in the model is a number; the demand in the world is a distribution. Unit 5 is about what to do with that, but the habit of remembering which is which starts here.

Building a model for an obvious answer. If there is no interaction between the choices, there is nothing to optimise. Sorting a list is not a worse method than a solver; it is the right one.

Solving it once. The data drifts. A model is a thing you run again, and a recommendation from six months ago is a recommendation about six months ago.

7. "The model told us to" is not a reason

A model returns the best element of the set you gave it, judged by the criterion you wrote. It has no opinion about whether the set was the right set or the criterion the right criterion, and it cannot tell you that a constraint everybody in the building knows about was never written down. Every answer this course produces is conditional on a formulation, and the formulation is the part a person is responsible for. That is why unit 1 is six lessons of modelling before any method appears.

8. A workshop, in three parts

  1. Deciding: how many of product one ($x$) and product two ($y$) to make this week. Those are the decision variables, in units of items.

    Name what is being chosen first.

  2. Judging: profit, $5x + 4y$ — one number, to be maximised. Not profit and speed; one.

    One objective.

  3. Not allowed: machine time $6x + 4y \le 24$, finishing time $x + 2y \le 6$, and $x, y \ge 0$. The last is a constraint too, and forgetting it is how a model comes back recommending negative production.

    Every rule, including the obvious ones.

9. The same data, three questions

  1. Which supplier did we spend most with last quarter? — descriptive. It is a query over what happened; no decision is being made.

    A summary.

  2. How much will we need next quarter? — predictive. The answer is a forecast, and it will be wrong by some amount nobody can remove.

    A forecast, feeding the model.

  3. Given that forecast, how should we split the order across suppliers? — prescriptive, and the only one of the three that is an optimization problem. It has a decision, a criterion, and constraints that make the choices interact.

    A decision.

10. Your turn: is this a problem for a model?

  1. A hospital rosters forty nurses across twenty-one shifts, with skill requirements per shift, maximum consecutive nights, and leave already booked. Ask first: do the choices interact?

    Start with interaction, not with size.

  2. They do, in both directions: putting a nurse on Tuesday night uses them up for Wednesday morning, and the skill requirement on one shift changes who is available for every other.

  3. Your turn: work this step out. Its working is at the end of the packet.

    So yes — and note that the size is not what makes it so. Four nurses over three shifts with the same rules is the same problem and still needs a model; forty over twenty-one merely makes it impossible to do by eye.

11. Guided practice

A depot has drivers, deliveries, and last week's records. Match each question to the kind of answer it asks for.

Descriptive: reports what happenedPredictive: forecasts what is likelyPrescriptive: chooses an action under constraints
How many vans went out last week?
How many deliveries are likely tomorrow?
How many vans should leave tomorrow with six drivers?

12. Guided practice

A depot must decide how many vans to send out tomorrow with $8$ drivers. Put the four questions of formulating that decision into the order they can be answered in.

Number the steps in order (write the number in the box):

13. Practice

Which of these is worth building an optimization model for?

14. Practice

A workshop earns $4$ on each unit of the first product and $3$ on each unit of the second. Work out the profit of each of these three plans.

units of $x$units of $y$profit
Both products42
First only40
Second only02

15. Practice

A solver reports that the model has an unbounded objective. What has it found?

16. Somewhere new

The workshop above finds a way to make $1$ more of the first product without giving up any of the second. What would the profit become?

Answer:

17. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

18. Test question

Which of these is worth building an optimization model for?

19. What you can do now

You can separate prescriptive questions from descriptive and predictive ones, name the three parts of a model, and say what infeasible and unbounded tell you about a formulation. Next: writing those three parts down properly, on a production problem.

Working for the steps left to you

10. Your turn: is this a problem for a model?, step 3