Integer Programming
Formally, a integer programming problem can be defined as follows: Input:
- A set of linear constraints, .
- A linear objective function, . Output: A solution such that:
- satisfies the constraints
- is maximal
Example: Maximal Matchings
Given the situation below:
We want to maximise the number of connections in the graph.
- For each edge between worker and task , let be some numerical value. We also add the constraint for all edges .
- Construct a constraint for each worker .
- Construct a constraint for each task .
- Add an objective to maximise the number of connections:
- An optimal solution to the resulting integer program corresponds to the maximal matching of workers to tasks.
Integer Programming is NP-hard
Theorem: SAT is polynomially reducible to the Integer Programming problem. Proof: Given a formula in CNF:
- We want to construct an integer program such that:
- For each propositional variable , let and be numerical variables.
- Convert each clause into a linear constraint:
- For each propositional variable, add the following constraint:
&= 1 \ x_r + x_{\neg r} &= 1 \ x_s + x_{\neg s} &= 1 \end{aligned}$$
- We can easily verify that: Hence .
Branch-and-Bound
Branch-and-Bound (Algorithm)
:
Link to original
- Find a solution to the linear relaxation of .
- If : Return solution
- Otherwise choose a non-integer on which we branch.
- Let
- Let
- If : Return solution
- Else return solution
Likely will not come up on an exam.
Or otherwise, we would be provided with a calculator. You can use https://www.zweigmedia.com/utilities/lpg/ to calculate these.
An example is shown below:

Other Variants of Linear Programming
- Mixed Integer Linear Programming (MLP): Hybrid of an integer program and a classic linear program Some variables are required to be integers but not all
- Zero-one integer programming A restriction of Integer Programming where all variables can either be zero or one