Integrality constraints
• Integrality constraints are often extremely desirable
when modeling problems as linear programs.
• We have seen that if our linear program expresses a
network flow problem, we may rephrase it so that such
integrality constraints are guaranteed to be satisfied by
the solution found.
• What do we do if we want integrality constraints but our
linear program does not express a network flow
problem?
1
Mixed Integer Linear Programs
(MILP)
Find x 2 Rn minimizing or maximizing a linear
form hx,ci = i ci xi (the objective function) so
that a given set of linear non-strict inequalities
and integrality constraints xi 2 Z are satisfied.
A feasible solution to the program is a point x
satisfying the inequalities and integrality
constraints.
2
Integer Linear Programs (ILP)
Find x 2 Zn minimizing or maximizing a
linear form hx,ci = i ci xi (the objective
function) so that a given set of linear
non-strict inequalities are satisfied.
A feasible solution to the program is a
point x satisfying the inequalities.
3
4
Power of ILP
• 0-1 variables may be interpreted as Boolean
variables.
• Logical constraints on Boolean variables may be
expressed by inequalities.
• Consequence (to be seen in the course
“Combinatorial Search”): ILP is a universal
language. It can express any “simple”
search/optimization problem.
5
Traveling Salesman Problem (TSP)
• Given n cities on a map, find the shortest
tour visiting all cities and ending up where
it started.
6
7
8
Traveling Salesman Problem (TSP)
• Given n £ n distance matrix (dij) find permutation
of {0,1,2,..,n-1} minimizing
n 1
d
i 0
( i ), (( i 1) mod n )
• The special case of dij being actual distances on
a map is called the Euclidean TSP.
9
TSP as ILP, first attempt
10
TSP as ILP, correct formulation
11
TSP as ILP, compact formulation
12
NP-completeness
Mixed Integer Linear Programming
Exponential (hard).
…
TSP
Polynomial (easy)
by Local Search
…
Linear Programming
Min Cost Flow
= reduction
Max Flow
Maximum matching
Shortest paths
13
NP-completeness
…
TSP
Exponential (hard).
Mixed Integer Linear Programming
Polynomial (easy)
by Local Search
Linear Programming
Min Cost Flow
= reduction
Max Flow
Maximum matching
Shortest paths
14
…. This doesn’t mean that we should give up solving
concrete ILP or TSP instances! There is a java
program finding the solution below in less than a
minute.
15
© Copyright 2026 Paperzz