Integer Programming

Work in progress. This note is still being written and incomplete.

An integer programming problem (IPP) is a linear program with the added restriction that some or all decision variables must be integers.

  • Pure integer programming
    Every decision variable must be an integer.
  • Mixed integer linear programming (MILP)
    Only some decision variables must be integers.
  • Binary (0-1) integer programming
    Every decision variable is restricted to {0,1}\{0, 1\}.

Solving an IPP

The LP relaxation (dropping the integer restriction) is solved first, since it gives an upper bound (maximization) on the IPP’s optimal value. If the relaxation’s optimal solution happens to be integral, it’s also optimal for the IPP.

Rounding the LP relaxation’s solution to the nearest integer doesn’t reliably give a feasible or optimal IPP solution. Dedicated methods are needed:

  • Branch and bound
  • Gomory’s cutting plane method

Branch and Bound

Searches the IPP’s feasible integer solutions by treating the LP relaxation as a search tree, splitting (branching) a fractional solution into 2 stricter subproblems and discarding (bounding) subproblems that can’t beat the best integer solution found so far.

A subproblem is the IPP’s LP relaxation with extra \le or \ge bound constraints on individual variables, added by earlier branching steps. The search starts with 1 subproblem: the LP relaxation with no added bounds.

Steps

  • Solve the LP relaxation of the current subproblem.
  • If the solution is integral, it’s a candidate solution. Update the best solution found so far if it’s better.
  • If the subproblem’s relaxed objective value is worse than the best solution found so far, discard it (bound). The relaxation’s value is an upper bound (maximization) on any integer solution inside the subproblem, so none of them can beat the best solution either.
  • Otherwise, pick any variable xjx_j whose value kk in the relaxed solution isn’t an integer, e.g. xj=2.7x_j = 2.7. Branch on it: make 2 copies of the current subproblem, keep every constraint the same in both, then add xjkx_j \le \lfloor k \rfloor (here xj2x_j \le 2) to 1 copy and xjkx_j \ge \lceil k \rceil (here xj3x_j \ge 3) to the other. No integer lies strictly between k\lfloor k \rfloor and k\lceil k \rceil, so every integer point feasible in the parent subproblem stays feasible in 1 of the 2 children, just not xj=kx_j = k itself.
  • Repeat on each open subproblem until none remain.

The best solution found when the search ends is the IPP’s optimal solution. An infeasible subproblem (empty feasible region) is discarded without branching.

Gomory’s Cutting Plane Method

Solves a pure IPP by adding constraints (cuts) to the LP relaxation’s optimal tableau that exclude the fractional solution without excluding any feasible integer solution.

Fractional Cut

For a basic variable xix_i with a fractional value in the optimal tableau’s row:

xi+jaijxj=bix_i + \sum_j a_{ij} x_j = b_i

Split each coefficient into integer and fractional parts, aij=aij+fija_{ij} = \lfloor a_{ij} \rfloor + f_{ij} and bi=bi+fib_i = \lfloor b_i \rfloor + f_i (with 0fij,fi<10 \le f_{ij}, f_i < 1). The Gomory constraint is:

jfijxjfi\sum_j f_{ij} x_j \ge f_i

Steps

  • Solve the LP relaxation with simplex.
  • If every basic variable is integral, stop. The solution is optimal for the IPP.
  • Otherwise, pick a row with a fractional basic variable and derive its Gomory constraint.
  • Add the constraint (as a new row with a surplus variable) to the tableau and resolve with the dual simplex method, since the new RHS is negative.
  • Repeat until every basic variable is integral.

Worked Example

Maximize Z=2x1+3x2Z = 2x_1 + 3x_2 subject to x1+x25x_1 + x_2 \le 5, 2x272x_2 \le 7, x1,x20x_1, x_2 \ge 0 and integer.

LP relaxation optimum: x1=1.5x_1 = 1.5, x2=3.5x_2 = 3.5, Z=13.5Z = 13.5.

Via Branch and Bound

  • Branch on x1x_1 into x11x_1 \le 1 and x12x_1 \ge 2.
  • x11x_1 \le 1: LP optimum (1,3.5)(1, 3.5), Z=12.5Z = 12.5. Branch on x2x_2 into x23x_2 \le 3 and x24x_2 \ge 4.
    • x23x_2 \le 3: LP optimum (1,3)(1, 3), integral, Z=11Z = 11. Best solution so far.
    • x24x_2 \ge 4: infeasible, since 2x272x_2 \le 7 forces x23.5x_2 \le 3.5. Discard.
  • x12x_1 \ge 2: LP optimum (2,3)(2, 3), integral, Z=13Z = 13. Better than the best solution so far. New best.
  • The x11x_1 \le 1 branch’s bound (12.5) is below the best solution (13). No open subproblems remain.

Optimal solution: x1=2x_1 = 2, x2=3x_2 = 3, Z=13Z = 13.

Branch and bound search tree for the worked example The LP relaxation branches on x1 into x1 ≤ 1 and x1 ≥ 2. The x1 ≥ 2 branch is already integral and becomes the best solution. The x1 ≤ 1 branch branches again on x2, giving one integral but worse solution and one infeasible subproblem. x1 ≤ 1 x1 ≥ 2 x2 ≤ 3 x2 ≥ 4 LP relaxation x1 = 1.5, x2 = 3.5 Z = 13.5 x1 = 1, x2 = 3.5 Z = 12.5 fractional, branch again x1 = 2, x2 = 3 Z = 13 integral, best solution x1 = 1, x2 = 3 Z = 11 integral, beaten by 13 infeasible discarded

Via Gomory’s Cutting Plane Method

Standard form: x1+x2+s1=5x_1 + x_2 + s_1 = 5, x2+0.5s2=3.5x_2 + 0.5s_2 = 3.5.

Optimal tableau rows, basis x1,x2x_1, x_2:

x1+s10.5s2=1.5x_1 + s_1 - 0.5s_2 = 1.5 x2+0.5s2=3.5x_2 + 0.5s_2 = 3.5

The x1x_1 row has b1=1.5b_1 = 1.5, so f1=0.5f_1 = 0.5. Its coefficients split as f1,s1=0f_{1,s_1} = 0 (since 11 is already an integer) and f1,s2=0.5f_{1,s_2} = 0.5 (since 0.5=0.5+0.5-0.5 = \lfloor -0.5 \rfloor + 0.5).

Gomory constraint: 0.5s20.50.5s_2 \ge 0.5, i.e. s21s_2 \ge 1.

1 /

entering column leaving row pivot element updated this step

0.5s2+G=0.5-0.5s_2 + G = -0.5 added as a new row. The tableau is still optimal (zz row non-negative) but infeasible (b=0.5b = -0.5), so GG leaves. Its only negative entry is under s2s_2, so s2s_2 enters. Pivot on 0.5-0.5.

Every RHS is 0\ge 0 and x1x_1, x2x_2, s2s_2 are all integral. Optimal at x1=2x_1 = 2, x2=3x_2 = 3, Z=13Z = 13.

Optimal solution: x1=2x_1 = 2, x2=3x_2 = 3, Z=13Z = 13. Matches branch and bound.

Written by September 16, 2026 4 min read
Was this helpful?