Unit 02 β€” Integer Linear Programming

When fractional answers are meaningless. Pure, mixed and binary ILP, the logical constraints that make binary models powerful, and the seven formulation patterns the paper draws from.

SESSIONS: 2 TEXTBOOK: ANDERSON & SWEENEY β€” CH. 7, SEC. 7.1–7.2, pp. 321–328 SCOPE: FORMULATION ONLY β€” NO BRANCH & BOUND Full PPT: ILP deck 11 Class notes 10
β—† What the papers ask from this unit

One 5-mark question, in both papers, with an identical shape: a project-selection table plus one logical restriction ("C and E cannot be undertaken together" / "B and D cannot be executed together"), and the instruction "Formulate an ILP model". You are never asked to solve it. Final Q4B QP p. 4, Re-Exam Q4A QP p. 3. Both solved β†’

1. What Is Integer Linear Programming? Core syllabus concept

1Understand the Concept

Ordinary LP lets decision variables take any real value that satisfies the constraints. In many real situations a fractional answer is nonsense Deck p. 2:

  • You cannot make 2.5 cars.
  • A project is either selected (1) or not selected (0) β€” there is no 0.4 of a project.
  • You cannot assign 0.3 of a worker to a job.

In those cases you add an integrality restriction and the model becomes an Integer Linear Programming problem. Everything else β€” objective function, constraints, non-negativity β€” is written exactly as in Unit 1. ILP is LP plus one extra line.

Link back to Unit 1: this is the divisibility assumption failing. That single sentence is a good opening line for any "what is ILP / why do we need it" answer.

2The three types β€” know which one you are writing

TypeRestrictionTypical exampleLast line of your answer
Pure ILP All decision variables must be integers. Number of buses, number of workers per shift. X₁, Xβ‚‚, X₃ β‰₯ 0 and are integers
Mixed ILP (MILP) Some variables integer, others continuous. Integer number of machines + continuous production quantity. X₁, Xβ‚‚ β‰₯ 0 and X₁ is an integer
Binary / 0–1 ILP Variables may only be 0 or 1. Selecting projects, opening a warehouse, yes/no decisions. Xα΅’ are binary (0, 1)
⚠ The one line that carries the marks

An ILP answer that is identical to an LP answer earns LP marks. The integrality/binary statement is the whole point of the question β€” write it as its own labelled line at the end, never buried in the non-negativity line.

Sources
Primary QT Complete Study Notes β€” ILP types p. 30
Lecture Integer Linear Programming deck pp. 1–3 Β· Class notes Note 2 pp. 19–21

2. Logical Constraints β€” the Binary Toolkit Core syllabus concept

1Understand the Concept

Binary variables are powerful because ordinary algebra can express logical conditions. Every exam ILP question hides one of these. Learn the table and you can translate any English restriction into a constraint on sight.

English in the questionConstraint to writeWhy it works
"C and E cannot be undertaken together" (mutually exclusive) X_C + X_E ≀ 1 Both = 1 would give 2 > 1. Allows neither, or exactly one.
"Exactly one of P3 or P4 must be chosen, but not both" X₃ + Xβ‚„ = 1 Forces the sum to exactly one β€” one is chosen, one is not.
"P1 must be done if P2 is selected" (contingent / prerequisite) Xβ‚‚ ≀ X₁ If Xβ‚‚ = 1 then X₁ must be 1. If Xβ‚‚ = 0, X₁ is free.
"At least 3 projects should be chosen" X₁ + Xβ‚‚ + X₃ + Xβ‚„ β‰₯ 3 Direct count.
"At most 2 projects may be chosen" X₁ + Xβ‚‚ + X₃ + Xβ‚„ ≀ 2 Direct count, other direction.
"A warehouse can supply up to 80 units only if it is opened" (linking / fixed-charge) X_{i1} + X_{i2} + X_{i3} βˆ’ 80Yα΅’ = 0 If Yα΅’ = 0 the whole shipment is forced to zero; if Yα΅’ = 1 capacity is 80.
"Tables must be produced in multiples of 10" Define X̄₁ = 10X₁ and require X₁ integer Batching β€” the class notes' Mixed ILP example Note 2 p. 20.
Tip for the exam: when a question says two things "cannot be done together", the marker is looking for X_i + X_j ≀ 1 as a separate, labelled constraint. Write "Incompatibility constraint:" beside it so it cannot be missed.

Practice G1–G5 β€” prerequisite, batching, fixed-charge, either-or β†’

Sources
Lecture ILP deck β€” problems #5, #6, #7 with logical constraints pp. 7–11
Class Binary and linking constraints worked in class pp. 5–8

3. The Seven Formulation Patterns Core syllabus concept

Every ILP question in the notes and the papers is one of these seven. Read them as a catalogue β€” recognise the pattern, then write the matching template.

1Pattern A β€” simple production ILP (Pure)

Toy company Deck p. 4

Dolls give β‚Ή3 profit and need 1 hour labour; cars give β‚Ή4 and need 2 hours. 6 labour hours available. Formulate an ILP.

Let X₁ = number of dolls, Xβ‚‚ = number of cars Max Z = 3X₁ + 4Xβ‚‚ s.t. X₁ + 2Xβ‚‚ ≀ 6 (labour hours) X₁, Xβ‚‚ β‰₯ 0 and integers

2Pattern B β€” project selection under a budget (Binary)

Three projects, β‚Ή70 lakh budget Deck p. 5
Let Xα΅’ = 1 if project i is chosen, 0 otherwise Max Z = 60X₁ + 55Xβ‚‚ + 30X₃ s.t. 50X₁ + 40Xβ‚‚ + 30X₃ ≀ 70 (budget, β‚Ή lakh) X₁, Xβ‚‚, X₃ are binary (0, 1)

3Pattern C β€” shift / workforce allocation (Pure)

Factory with three shifts Deck p. 6 Β· worked in class Class notes p. 2

At least 5 workers in morning, 3 in afternoon, 4 at night. A worker works exactly one shift. 10 workers available. Productivity 8, 6, 7 units respectively.

Let X₁, Xβ‚‚, X₃ = number of workers in morning / afternoon / night Max Z = 8X₁ + 6Xβ‚‚ + 7X₃ s.t. X₁ β‰₯ 5 (morning minimum) Xβ‚‚ β‰₯ 3 (afternoon minimum) X₃ β‰₯ 4 (night minimum) X₁ + Xβ‚‚ + X₃ ≀ 10 (total workers available) X₁, Xβ‚‚, X₃ β‰₯ 0 and integers

Note the class notes write the total as = 10 rather than ≀ 10, on the reading that every available worker is assigned. Either is defensible provided you state your assumption β€” the paper's instruction "assume suitable data if necessary" explicitly permits this.

4Pattern D β€” cutting stock / trim loss (Pure)

Paper mill, 5 m rolls Deck p. 7

Orders: 10 rolls of 1 m, 8 rolls of 2 m, 6 rolls of 3 m. Minimise the number of big rolls used. The trick is that the decision variable is the cutting pattern, not the product.

Feasible cutting patterns for a 5 m roll: P1 = five 1 m P2 = three 1 m + one 2 m P3 = two 2 m + one 1 m P4 = two 1 m + one 3 m P5 = one 2 m + one 3 m Let Xβ±Ό = number of big rolls cut using pattern Pβ±Ό Min Z = X₁ + Xβ‚‚ + X₃ + Xβ‚„ + Xβ‚… s.t. 5X₁ + 3Xβ‚‚ + 1X₃ + 2Xβ‚„ β‰₯ 10 (1 m rolls required) 1Xβ‚‚ + 2X₃ + 1Xβ‚… β‰₯ 8 (2 m rolls required) 1Xβ‚„ + 1Xβ‚… β‰₯ 6 (3 m rolls required) X₁ … Xβ‚… β‰₯ 0 and integers

5Pattern E β€” multi-resource project selection with a minimum (Binary)

β‚Ή200 lakh, 50 manpower, at least 2 projects Deck p. 8
Let Xα΅’ = 1 if project i is selected, 0 otherwise Max Z = 100X₁ + 80Xβ‚‚ + 95X₃ + 65Xβ‚„ s.t. 80X₁ + 60Xβ‚‚ + 70X₃ + 50Xβ‚„ ≀ 200 (budget, β‚Ή lakh) 20X₁ + 15Xβ‚‚ + 25X₃ + 10Xβ‚„ ≀ 50 (manpower) X₁ + Xβ‚‚ + X₃ + Xβ‚„ β‰₯ 2 (at least two projects) Xα΅’ are binary (0, 1)

6Pattern F β€” fixed-charge / facility location (Mixed binary)

Warehouses in three cities Deck p. 9 Β· worked in class Class notes p. 5

Fixed costs A = 100, B = 120, C = 150 (β‚Ή lakh). Each warehouse supplies up to 80 units only if opened. Demands R₁ = 50, Rβ‚‚ = 60, R₃ = 40.

Let Xα΅’β±Ό = quantity shipped from warehouse i to region j Let Yα΅’ = 1 if warehouse i is opened, 0 otherwise Min Z = 100Y₁ + 120Yβ‚‚ + 150Y₃ + 4X₁₁ + 6X₁₂ + 8X₁₃ + 5X₂₁ + 4Xβ‚‚β‚‚ + 7X₂₃ + 6X₃₁ + 5X₃₂ + 3X₃₃ Demand: X₁₁ + X₂₁ + X₃₁ = 50 X₁₂ + Xβ‚‚β‚‚ + X₃₂ = 60 X₁₃ + X₂₃ + X₃₃ = 40 Linking: X₁₁ + X₁₂ + X₁₃ βˆ’ 80Y₁ = 0 X₂₁ + Xβ‚‚β‚‚ + X₂₃ βˆ’ 80Yβ‚‚ = 0 X₃₁ + X₃₂ + X₃₃ βˆ’ 80Y₃ = 0 Xα΅’β±Ό β‰₯ 0 and integer; Y₁, Yβ‚‚, Y₃ are binary (0, 1)

This is the hardest pattern in the unit β€” it mixes a transportation structure (Unit 3) with binary open/close decisions. The linking constraint is what makes it work: it is impossible to ship from a warehouse you did not open.

7Pattern G β€” projects with logical dependencies (Binary)

Four projects with four logical rules Deck p. 10
Max Z = 60X₁ + 80Xβ‚‚ + 100X₃ + 120Xβ‚„ s.t. 30X₁ + 40Xβ‚‚ + 50X₃ + 60Xβ‚„ ≀ 100 (budget, β‚Ή lakh) Xβ‚‚ ≀ X₁ (P1 must be done if P2 is selected) X₃ + Xβ‚„ = 1 (either P3 or P4, but not both) Xβ‚‚ + X₃ ≀ 1 (at most one of P2, P3) X₁ + Xβ‚‚ + X₃ + Xβ‚„ β‰₯ 3 (at least three projects) Xα΅’ are binary (0, 1)

The deck prints the budget line as = 100; a budget is a ceiling, so ≀ 100 is the defensible reading and is what you should write. Flag the assumption in one line if you do.

⚠ ILP β€” where marks are lost
  • Omitting the integrality/binary line. The single most costly omission in this unit.
  • Defining Xα΅’ as a quantity when it should be a yes/no. If the question says "which projects should be selected", Xα΅’ is binary β€” not "number of projects".
  • Forgetting to write out what the binary means. "Let Xα΅’ = 1 if project i is selected, else 0" is a marked line.
  • Missing the logical constraint entirely. It is deliberately buried in one sentence near the end of the question stem. Read the last two lines of every ILP question twice.

Practice G2 β€” mixed ILP with batch production β†’

Sources
Primary QT Complete Study Notes β€” ILP worked formulations pp. 30–33
Lecture Integer Linear Programming deck β€” problems #1–#7 pp. 4–11
Class Handwritten ILP notes β€” shift, cutting stock, warehouse pp. 1–10 Β· Types of ILP Note 2 pp. 19–21
Exam Final Q4B p. 4 Β· Re-Exam Q4A p. 3