CombinatorialOptimization
CombinatorialOptimization
1.4 Knapsack
1.1 Spanning trees
Given n ∈ N, positive integers ai , bi (profit and
Here we are given a finite connected undirected weight of item i, for i = 1, . . . , n), and B (the
graph (V, E) (so V is the set of vertices and E
the set of edges) and weights on the edges, i.e.,
knapsack’s
P P I ⊆ {1, . . . , n}
capacity), find a subset
with i∈I bi ≤ B, such that i∈I ai is as large
c(e) ∈ R for all e ∈ E. The task is to find a set as possible.
P⊆ E such that (V, T ) is a (spanning) tree and
T
e∈T c(e) is minimum. (Recall that a tree is a
connected graph without cycles.) 1.5 Traveling salesman
The figure below shows on the left a set V of
Given a finite set X with metric d, find a bijection
eight points in the Euclidean plane. Assuming
π : {1, . . . , n} → X such that the length of the
that (V, E) is the complete graph on these points
corresponding tour,
and c is the Euclidean distances, the right-hand
side shows an optimal solution. n−1
X
d(π(i), π(i + 1)) + d(π(n), π(1)),
i=1
is as small as possible.
1
2
2 General Formulation and Goals However, for NP-hard problems (like the last
three examples in our list), this is impossible un-
2.1 Instances and solutions less P=NP, and consequently one is satisfied with
less (see Section 5).
These problems have many common features.
In each case, there are infinitely many in-
stances, each of which can be described (up to 2.3 Other Goals
renaming) by a finite set of bits, and in some cases Besides developing algorithms and proving their
a finite set of real numbers. correctness and efficiency, combinatorial opti-
For each instance, there is a set of feasible so- mization (and related areas) also comprises other
lutions. This set is finite in most cases. In the work:
maximum flow problem it is actually infinite, but
even here one can restrict w.l.o.g. to a finite set • analyze combinatorial structures, such as
of solutions; see below. graphs, matroids, polyhedra, hypergraphs;
Given an instance and a feasible solution, we • establish relations between different combi-
can easily compute its value. natorial optimization problems: reductions,
For example, in the matching problem, the in- equivalence, bounds, relaxations;
stances are the finite undirected graphs; for each
instance G the set of feasible solutions are the • prove properties of optimal (or near-optimal)
matchings in G; and for each matching, its value solutions;
is simply its cardinality. • study the complexity of problems and estab-
Even if the number of feasible solutions is fi- lish hardness results;
nite, it cannot be bounded by a polynomial in the
instance size (the number of bits that is needed • implement algorithms and analyze their
to describe the instance). For example, there practical performance;
are nn−2 trees (V, T ) with V = {1, . . . , n} (this
• apply combinatorial optimization problems
is Cayley’s formula). Similarly, the number of
to real-world problems.
matchings on n vertices, subsets of an n-element
set, and permutations on n elements, grow expo-
nentially in n. One cannot enumerate all of them 3 Greedy algorithm
in reasonable time except for very small n.
Whenever an instance contains real numbers, The spanning tree problem has a very simple so-
we assume that we can do elementary operations lution: the greedy algorithm does the job. We can
with them, or we actually assume them to be ra- start with the empty set and successively pick a
tionals with binary encoding. cheapest edge that does not create a cycle, until
our subgraph is connected. Formally:
shown on the right, is optimal, as is proved by the NP-complete to decide whether in a given di-
s-t-cut δ + ({s, a, c}) = {(a, b), (c, t)} of capacity 8. rected graph with vertices s and t there is a path
P from s to t and a path Q from t to s such that
a b a b P and Q are edge-disjoint.
4 3 4 3
s 1 1 2 s 1 0 3 4.3 LP duality
3 c t 4 c t The maximum flow problem (and also gener-
5 5
alizations like minimum-cost flows and multi-
The above relation also shows that for finding commodity flows) can be formulated as linear pro-
an s-t-cut with minimum capacity, it suffices to grams in a straightforward way.
solve the maximum flow problem. This can also Most other combinatorial optimization prob-
be used to compute a minimum cut in an undi- lems involve binary decisions and can be for-
rected graph or to compute the connectivity of a mulated naturally as (mixed-)integer linear pro-
given graph. grams. We give an example for the matching
Any s-t-flow can be decomposed into flows on s- problem.
t-paths, and possibly on cycles (but cyclic flow is The matching problem can be written as inte-
redundant as it does not contribute to the value). ger linear program
This decomposition can be done greedily, and
max 1>x : Ax ≤ 1, xe ∈ {0, 1} ∀e ∈ E
then the list of paths is sufficient to recover the
flow. This shows that one can restrict to a fi- where A is the vertex-edge-incidence matrix of
nite number of feasible solutions without loss of the given graph G = (V, E), 1 = (1, 1, . . . , 1)>
generality. denotes an appropriatePall-one vector (so 1>x is
just an abbreviation of e∈E xe ), and ≤ is meant
4.2 Disjoint paths component-wise. The feasible solutions to this
If all capacities are integral (i.e., are integers), one integer linear program are exactly the incidence
can find a maximum flow by always augmenting vectors of matchings in G.
by 1 along an augmenting path, until none ex- Solving integer linear programs is NP-hard in
ists anymore. This is not a polynomial-time algo- general (cf. Section 5.2), but linear programs
rithm (because the number of iterations can grow (without integrality constraints) can be solved in
exponentially in the instance size), but it shows polynomial time (−→ Continuous Optimization).
that in this case there is always an optimal flow This is one reason why it is often useful to con-
that is integral. An integral flow can be decom- sider the linear relaxation, which here is:
posed into integral flows on paths (and possibly
max 1>x : Ax ≤ 1, x ≥ 0 ,
cycles).
Hence, in the special case of unit capacities, an where 0 and 1 denote appropriate all-zero and
integral flow can be regarded as a set of pairwise all-one vectors, respectively. Now the entries of x
edge-disjoint s-t-paths. Therefore, the max-flow can be any real numbers between 0 and 1.
min-cut theorem implies the following theorem, The dual LP is:
due to Karl Menger:
Let (V, E) be a directed graph and s, t ∈ V . min y>1 : y>A ≥ 1, y ≥ 0 .
Then the maximum number of paths from s to
t that are pairwise edge-disjoint equals the mini- By weak duality, every dual feasible vector y
mum number of edges in an s-t-cut. yields an upper bound on the optimum. (Indeed,
Other versions of Menger’s theorem exist, for if x is the incidence vector of a matching M and
instance, for undirected graphs and for (inter- y ≥ 0 with y>A ≥ 1, then |M | = 1>x ≤ y>Ax ≤
nally) vertex-disjoint paths. y>1.)
In general, finding disjoint paths with pre- If G is bipartite, it turns out that these two
scribed endpoints is difficult: For example, it is LPs actually have integral optimal solutions. The
5
minimal integral feasible solutions of the dual LP • run fast and produce good results in practice
are exactly the incidence vectors of vertex covers although there is no proof (heuristics).
(sets X ⊆ V such that every edge has at least one
endpoint in X). 5.1 Approximation algorithms
In other words, in any bipartite graph G, the
maximum size of a matching equals the minimum From a theoretical point of view, the notion of
size of a vertex cover. This is a theorem of Dénes approximation algorithms has proved to be most
Kőnig. It can also be deduced from the max-flow fruitful. For example, for the knapsack problem
min-cut theorem. (cf. Section 1.4) there is an algorithm that for any
For general graphs, this is not the case, as for given instance and any given number > 0 com-
example the triangle (complete graph on three putes a solution at most 1 + times worse than
vertices) shows. Nevertheless, the convex hull of the optimum, and whose running time is propor-
2
incidence vectors of matchings in general graphs tional to n . For the traveling salesman problem
can also be described well: it is (cf. Section 1.5 and −→ Traveling Salesman Prob-
n o lem), there is a 32 -approximation algorithm.
x : Ax ≤ 1, x ≥ 0, xe ≤ |A|
X
2 ∀A ⊆ V , For set covering (cf, Section 1.6) there is no
e∈E[A] constant factor approximation algorithm unless
P=NP. But consider the special case where we
where E[A] denotes the set of edges whose end- ask for a minimum vertex cover in a given graph
points both belong to A. This was shown by Jack G: here U is the edge set of G and Si = δ(vi ) for
Edmonds (1965), who also found a polynomial- i = 1, . . . , n, where V = {v1 , . . . , vn } is the vertex
time algorithm. In contrast, the problem of find- set of G.
ing a minimum vertex cover in a given graph is Here we can use the above-mentioned fact that
NP-hard. the size of any matching in G is a lower bound.
Indeed, take any (inclusion-wise) maximal match-
5 Dealing with NP-Hard Problems ing M (e.g., found by the greedy algorithm), then
the 2|M | endpoints of the edges in M form a ver-
The other three problems mentioned above (see tex cover. As |M | is a lower bound on the opti-
Sections 1.4, 1.5, and 1.6) are NP-hard: they have mum, this is a simple 2-approximation algorithm.
a polynomial-time algorithm if and only if P=NP.
Since most researchers believe that P6=NP, they 5.2 Integer linear optimization
gave up looking for polynomial-time algorithms
for NP-hard problems. Weaker goals strive for Most classical combinatorial optimization prob-
algorithms that, for instance, lems can be formulated as integer linear programs
min c>x : Ax ≤ b, x ∈ Zn .
• solve interesting special cases in polynomial
time;
This includes all problems discussed in this chap-
• run in exponential time but faster than triv- ter, except the maximum flow problem, which is
ial enumeration; in fact a linear program (−→ Continuous Opti-
mization). Often the variables are restricted to 0
• always compute a feasible solution whose or 1. Sometimes, some variables are continuous,
value is at most k times worse than the opti- and others are discrete:
mum (so-called k-approximation algorithms;
min c>x : Ax + By ≤ d, x ∈ Rm , y ∈ Zn .
see Section 5.1);
• are efficient or compute good solutions for Such problems are called mixed-integer linear
most instances, in some probabilistic model; programs.
Discrete optimization comprises combinatorial
• are randomized (use random bits in their optimization but also general (mixed-)integer op-
computation) and have a good expected be- timization problems with no special combinato-
haviour; or rial structure.
6
For general (mixed-)integer linear optimiza- parts of a decision tree because lower and up-
tion, all known algorithms have exponential per bounds tell us that the unvisited parts can-
worst-case running time. The most successful al- not contain a better solution. How well this works
gorithms in practice use a combination of cutting mainly depends on how good the available bounds
planes and branch-and-bound (see Sections 6.2 are.
and 6.7). These are implemented in advanced
commercial software. Since many practical prob-
lems (including almost all classical combinato- 6.3 Reducing or decomposing the
rial optimization problems) can be described as instance
(mixed-)integer linear programs, such software
Often, an instance can be pre-processed by re-
is routinely used in practice to solve small and
moving irrelevant parts. In other cases, one can
medium-size instances of such problems. How-
compute a smaller instance or an instance with a
ever, combinatorial algorithms that exploit the
certain structure, whose solution implies a solu-
specific structure of the given problem are nor-
tion of the original instance.
mally superior, and often the only choice for very
large instances. Another well-known technique is divide-and-
conquer. In some problems, instances can be
decomposed/partitioned into smaller instances,
6 Techniques whose solutions can then be combined in some
way.
Since good algorithms have to exploit the struc-
ture of the problem, every problem requires differ-
ent techniques. Some techniques are quite general 6.4 Combinatorial or algebraic
and can be applied for a large variety of problems, structures
but in many cases they will not work well. Never-
theless we list the most important techniques that If the instances have a certain structure (like pla-
have been applied successfully to several combi- narity or certain connectivity or sparsity prop-
natorial optimization problems. erties of graphs, cross-free set families, matroid
structures, submodular functions, etc.), this must
usually be exploited.
6.1 Reductions Also, optimal solutions (of relaxations or the
Reducing an unknown problem to a known (and original problem) often have a useful structure.
solved) problem is the most important technique Sometimes (e.g., by sparsification or uncrossing
of course. To prove hardness, one proceeds the techniques) such a structure can be obtained even
other way round: we reduce a problem that we if it is not there originally.
know to be hard to a new problem (that then also Many algorithms compute and use a combi-
must be hard). If reductions work in both ways, natorial structure as a main tool. This is often
problems can actually regarded to be equivalent. a graph structure, but sometimes an algebraic
view can reveal certain properties. For instance,
the Laplacian matrix of a graph has many use-
6.2 Enumeration techniques ful properties. Sometimes simple properties, like
parity, can be extremely useful and elegant.
Some problems can be solved by skillful enumera-
tion. Dynamic programming is such a technique.
It works if optimal solutions arise from optimal 6.5 Primal-dual relations
solutions to “smaller” problems by simple opera-
tions. Dijkstra’s shortest path algorithm is a good We discussed LP duality, a key tool for many al-
example. Many algorithms on trees use dynamic gorithms, above. Lagrangian duality can also be
programming. useful for nonlinear problems. Sometimes other
Another well-known enumeration technique is kinds of duality, like planar duality or dual ma-
branch-and-bound. Here one enumerates only troids are very useful.
7