Practice: Integer Programs

Recognition · Classification

A model decides how many delivery vans to hire and how many litres of fuel to buy. Which variables require integrality?

2 hints available, least help first.

Hint 1: Retrieval cue

Ask of each: does a fractional value describe anything real?

Hint 2: Concept cue

Half a van delivers nothing. Half a litre is fuel.

Direct application · Classification · Explanation

A hospital plans a month. It may commission any of four mobile clinics, each with a fixed monthly cost. It assigns nursing hours to whichever clinics run, and it purchases consumables by weight. It may also hire up to six agency staff.

List the variables, state which require integrality and why, classify the resulting program, and describe its feasible set.

Write your answer, then compare it with the worked solution.

2 hints available, least help first.

Hint 1: Retrieval cue

For each variable ask whether a fractional value describes something real.

Hint 2: Strategy cue

Distinguish the yes-or-no decisions from the counts and from the divisible quantities.

Compare with the worked solution

Comparing does not record a result. Judging your own written answer cannot show that you can do this without help.

Variables and restrictions.

Clinic commissioning. Four binary variables y 1 , … , y 4 ∈ { 0 , 1 } , with 1 meaning commissioned. Running three-fifths of a clinic is not a plan.

Nursing hours. Continuous, h i ≥ 0 . Hours divide, 37.5 hours is an ordinary quantity, so no integrality.

Consumables by weight. Continuous, w ≥ 0 . Weight is divisible.

Agency staff. A general integer variable a ∈ Z with 0 ≤ a ≤ 6 . Indivisible, but not binary: hiring four is meaningful, so restricting to { 0 , 1 } would forbid something the situation allows.

Classification. Binary, general integer and continuous variables together: a mixed-integer program.

The feasible set. Not a polyhedron. Take the polyhedron defined by the linear constraints, then keep only the points whose clinic and staffing coordinates are whole numbers. The result is a family of slices, for each of the 16 clinic combinations and each of the 7 staffing levels, a continuous region in the remaining coordinates. It is not convex and not connected.

What that costs. The optimum need not sit at a vertex of the underlying polyhedron, convexity arguments do not apply, and the simplex method alone will not produce an implementable answer: relaxed, it would return y 1 = 0.62 , which is not an instruction anyone can follow.

On what was left continuous. Making hours or consumables integer would look tidier and would be a modelling error. It imposes restrictions the situation does not, raises cost sharply, and may exclude the true optimum.

A complete answer does each of these:

  • identifies integer variables
  • classifies program
  • describes feasible set
  • names lost results

Comparison · Method selection

A firm hires between zero and eight forklifts. Which restriction models this correctly?

2 hints available, least help first.

Hint 1: Retrieval cue

Is this a yes-or-no decision or a count?

Hint 2: Concept cue

Integrality and bounds are independent restrictions. Which does this situation impose?

Error diagnosis · Explanation · Evaluation

An analyst writes:

Integer programs are just linear programs where the answer has to be whole. I solved

max x 1 + x 2  s.t.  2 x 1 + 3 x 2 ≤ 12 , 3 x 1 + x 2 ≤ 9 , x 1 , x 2 ≥ 0

and got ( 15 / 7 , 18 / 7 ) ≈ ( 2.14 , 2.57 ) . Rounding to nearest gives ( 2 , 3 ) , so that is the integer optimum, with value 5 .

Evaluate both the method and the answer.

Write your answer, then compare it with the worked solution.

2 hints available, least help first.

Hint 1: Retrieval cue

Substitute the proposed point into the constraints before judging it.

Hint 2: Concept cue

What does integrality do to the feasible set, and does the vertex account survive it?

Compare with the worked solution

Comparing does not record a result. Judging your own written answer cannot show that you can do this without help.

Check the proposed answer first. ( 2 , 3 ) against the first constraint: 2 ( 2 ) + 3 ( 3 ) = 4 + 9 = 13 > 12 . Infeasible. The plan violates a constraint outright, so it is not the integer optimum and not a plan at all.

The true integer optimum. Checking feasible whole-number points: ( 2 , 2 ) gives 4 + 6 = 10 ≤ 12 and 6 + 2 = 8 ≤ 9 , feasible, value 4 . ( 1 , 3 ) gives 2 + 9 = 11 ≤ 12 and 3 + 3 = 6 ≤ 9 , feasible, value 4 . ( 0 , 4 ) gives 12 ≤ 12 and 4 ≤ 9 , feasible, value 4 . ( 3 , 0 ) gives 6 ≤ 12 and 9 ≤ 9 , feasible, value 3 . The optimum is 4 , attained at three points.

The method is wrong, not merely unlucky. Rounding moves a point off the region, and nothing in the rounding step can detect that, checking feasibility afterwards is already more work than rounding claimed to save. It also fails in the other direction: a rounded point can be feasible and still beaten by a plan rounding cannot reach, because rounding only adjusts each coordinate to a neighbour.

The deeper error in the first sentence. An integer program is not a linear program whose answer must be whole. Integrality is a restriction in the program, and it changes the feasible set from a polyhedron into the whole-number points inside it, not convex, not connected, no interior. The optimum need not be at a vertex, and here it is not: ( 2 , 2 ) , ( 1 , 3 ) and ( 0 , 4 ) are interior lattice points, not corners of the polygon.

What follows for practice. The continuous answer is still useful, as a bound. It tells you no integer plan exceeds 33 / 7 ≈ 4.71 , and since we found a plan with value 4 and values are whole here, 4 is optimal. That is the correct use of the relaxation, and it is a different thing from rounding it.

A complete answer does each of these:

  • identifies integer variables
  • classifies program
  • describes feasible set
  • names lost results

Transfer · Interpretation · Evaluation

Two models describe the same factory and have the same number of variables and constraints. Model A finishes in under a second. Model B has been running for an hour and reports a range rather than a single answer.

The only structural difference is that forty of model B's variables are restricted to whole numbers.

Explain why the behaviour differs so sharply, what the reported range means, and why the difference is not a defect in the solver.

Write your answer, then compare it with the worked solution.

2 hints available, least help first.

Hint 1: Retrieval cue

What does the simplex method rely on that integrality removes?

Hint 2: Strategy cue

Ask what two numbers a solver could honestly report when it has not finished proving optimality.

Compare with the worked solution

Comparing does not record a result. Judging your own written answer cannot show that you can do this without help.

Why model A is fast. Its feasible set is a polyhedron, and the optimum of a linear objective over a polyhedron sits at a vertex. That reduces the search to a finite set of algebraically describable points, and the simplex method walks between adjacent ones improving each step. The geometry does the work.

Why model B is slow. Integrality destroys that geometry. The feasible set becomes the whole-number points inside the polyhedron, not convex, not connected, no interior. The optimum need not be at a vertex and generally is not, so the vertex reduction is unavailable and there is no local step with a direction to follow.

What replaces it. Methods that search systematically while pruning: solve the relaxation for a bound, branch on a fractional variable, and discard whole regions whose bound cannot beat the best plan found. The work is in the search tree, and forty integer variables give an enormous number of ways to fix them.

What the reported range means. Two numbers bracketing the optimum. The relaxation-based bound says no plan can be better than one end; the best integer plan found so far says the optimum is at least as good as the other. The solver has not failed. It is reporting exactly what it has proved, which is more informative than a single number with no guarantee attached.

Why it is not a defect. The difficulty is in the problem, not the software. There is no known method that solves integer programs in time comparable to linear ones, and this is believed to be intrinsic rather than a gap in current technique. A linear program with thousands of variables is routine; an integer program of the same size may be out of reach.

The practical consequence. Requiring integrality is a decision about computation as well as meaning. Impose it where a fractional value is meaningless, and nowhere else. Every unnecessary integer variable multiplies the search.

A complete answer does each of these:

  • identifies integer variables
  • classifies program
  • describes feasible set
  • names lost results
Practice data

Your practice record is stored in this browser only. Clearing it removes every answer and every scheduled review, and cannot be undone.

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.