Practice Discrete Math

Algorithms / Integer Programs

Least You Need to Know: Integer Programs, Binary Variables, and LP Relaxation Bounds

Integer-programming questions are mostly about modeling discrete choices cleanly. Binary variables encode include/exclude decisions, linear constraints express feasibility, and LP relaxations often provide lower or upper bounds that help with approximation or branch-and-bound reasoning.

The least you need to know

Key notation

x_i in {0,1} binary decision variable
LP relaxation replace integrality constraints by real intervals such as `0 <= x_i <= 1`
integrality gap worst-case ratio between integer optimum and relaxed optimum

Tiny worked example

  • In **Set Cover**, let `x_i = 1` if set `i` is chosen and `0` otherwise.
  • For each element `e`, add a constraint that the chosen sets covering `e` have total at least `1`.
  • Minimizing the weighted sum of chosen sets gives an integer program.
  • Replacing `x_i in {0,1}` by `0 <= x_i <= 1` yields the LP relaxation.

Common mistakes

How to recognize this kind of problem

Start practice