Integer Programs
What you will be able to do
Given a described situation or a stated program, the learner can say which variables require integrality and which do not, classify the program as pure integer, mixed-integer or binary, describe the feasible set integrality produces, and state which results about linear programs cease to apply.
Orientation
Adding four words to a program, "and these must be whole numbers", changes what kind of problem it is. The feasible set stops being a region and becomes a scatter of isolated points inside one.
The formulation unit established when a linear program is the wrong model, and named indivisible decisions as one of the reasons. This unit starts after that judgement has been made: integrality is required, so what exactly have you written down, and how does it behave?
The short answer is that one extra line changes the problem completely. The feasible region stops being a region. The optimum stops sitting at a corner. The method you have spent this course learning no longer applies. None of that is obvious from how small the addition looks on the page.
This unit assumes you can formulate a linear program and classify a feasible region.
Intuition
What integrality does to the feasible region
Solve a linear program and the answer comes back
The repair looks trivial. Require the variable to be a whole number.
Now look at what the feasible set became. It was a solid shape with flat faces and straight edges. It is now the scattering of dots inside that shape whose coordinates happen to be whole numbers. There is nothing between the dots. No direction to move in, no edge to slide along, no corner where the answer has to be, because the corners belong to the shape, and the answers no longer live in the shape.
Everything that made linear programs tractable was a fact about that shape. Convexity, the vertex characterisation of optima, a step that walks from one corner to an adjacent one: all of it describes the polyhedron, and the polyhedron is now scenery rather than the search space.
The consequence that matters in practice is the one people resist. An integer program is not a linear program with a rounding step bolted on the end. Rounding can leave the region altogether, and even when it does not, the best whole-number point is often nowhere near the fractional one.
So integer programs need their own methods, and those methods cost far more. A linear program with thousands of variables is routine; an integer program of the same size may be out of reach. Requiring integrality is a decision about computation as much as about meaning.
Figure
The region becomes a scatter of points
The lesson's example,
That is the whole change, and it is larger than it looks. The region has edges you can slide along and corners where an optimum has to sit. The dots have neither. There is nothing between them — no direction to move in, no edge, no corner — because the corners belong to the shape and the answers no longer live in the shape.
The red point is the continuous optimum,
What replaces it is the subject of the units that follow. This figure only establishes what was lost.
Definition
Integer, mixed-integer, and binary programs
An integer linear program is
where
Three cases. When
The feasible set. Write
the points of
What ceases to hold. The optimum need not be at a vertex of
What still holds. The objective and constraints are linear, and feasibility is still decided by substitution. If every integer variable is bounded, the feasible set is finite, so an optimum exists whenever a feasible point does.
Example
The same constraints, with and without integrality
Take
As a linear program. The binding constraints meet where
Now require
The integer optimum is
What to notice. The continuous optimum was
Worked example
Deciding which variables need integrality
Problem. A depot operator plans next week. They may open any of three regional depots, each with a weekly fixed cost. They will ship tonnes of product from whichever depots open, and they hire delivery vans by the day. Say which variables require integrality.
Goal. A variable list with a justified restriction on each, and the resulting classification.
Relevant principle. Integrality is required when a fractional value has no meaning in the situation, not when the answer is expected to come out whole.
Step 1: the depot decisions. Opening a depot is a yes-or-no choice; there is no such thing as opening two-fifths of a depot. Three binary variables
Step 2: the shipped quantities. Tonnes are divisible. Shipping
Worth pausing on. It is tempting to make these integers too, on the grounds that the answer will look tidier. That would add restrictions the situation does not impose, make the program far harder to solve, and potentially exclude the genuine optimum. Integrality costs; it should be bought only where needed.
Step 3: the vans. A van-day is indivisible, half a van does not deliver. This is a general integer variable
Step 4: classify. The program has binary variables, a general integer variable, and continuous variables together. It is a mixed-integer program.
Step 5: what follows. The feasible set is not a polyhedron. Solving the continuous version would return fractional depot decisions,
Check. Each restriction traces to a fact about the situation: depots are opened or not, tonnes divide, vans do not. No variable carries integrality because the answer was expected to be whole.
Non-example
When integrality is not what is needed
Not an integer program: a divisible quantity that happened to come out whole. A blending model returns exactly
Not an integer restriction: a bound.
Not binary: a general integer variable. Hiring vans is indivisible but not a yes-or-no choice;
Not a repair: rounding the continuous answer. Rounding
Not an integer program: a linear program the modeller intends to round. If integrality is not written into the program it is not part of the problem, whatever anyone plans to do with the output. The solver optimises what it is given.
Contrast
Why rounding a relaxed solution fails
The most common account of integer programming is that you solve the linear program and round. It is wrong in two separate ways, shown concretely below.
Rounding can be infeasible. In the example above the continuous optimum is
Rounding can be feasible and wrong. Consider
The relaxation pushes everything into
Why this keeps happening. The continuous and integer optima are answers to different questions. The constraints binding at one need not bind at the other, so there is no reason the integer optimum should be near the fractional one. In larger problems they can be far apart.
What the relaxation is actually for. Not the answer. A bound, and a starting point for methods that search properly. That is the subject of its own unit, and the distinction between a bound and an answer is the thing to carry there.
Exercise
1. A bakery decides how many ovens to install, how many kilograms of flour to buy weekly, and whether to lease a delivery vehicle. Classify each variable and say what kind of program results.
2. For
3. Explain why adding integrality to a variable measuring litres of liquid is usually a modelling error rather than a precaution.
4. A colleague says the feasible set of an integer program is a polyhedron with some points removed, so convexity still applies to what is left. What is wrong with that?
5. Give a situation needing a general integer variable that is not binary, and say what writing it as binary would forbid.
What to carry forward
An integer program is a linear program with some variables restricted to whole numbers. The restriction is part of the program, not a plan for the answer.
Pure integer when every variable carries it, mixed-integer when only some do, the usual case, and binary when the integer variables are confined to zero and one.
The feasible set becomes the whole-number points inside the polyhedron: not convex, not connected, no interior. With bounded integer variables it is finite, so an optimum exists whenever a feasible point does.
What is lost is the geometry. The optimum need not be at a vertex and generally is not, convexity arguments do not apply, and there is no local step from one feasible point to a neighbour. The simplex method solves the relaxation, which is a different problem.
What is kept is linearity of the objective and constraints, and feasibility by substitution.
Require integrality where a fractional value is meaningless, and nowhere else. It is expensive, an integer program can be out of reach at a size where a linear program is routine, and requiring it of a divisible quantity buys nothing while potentially excluding the genuine optimum.