1.3 A Branching Algorithm For Independent Set: Aximum Ndependent ET
1.3 A Branching Algorithm For Independent Set: Aximum Ndependent ET
Algorithm mis1(G).
Input: Graph G = (V, E).
Output: The maximum cardinality of an independent set of G.
if |V | = 0 then
return 0
choose a vertex v of minimum degree in G
return 1 + max{mis1(G \ N[y]) : y ∈ N[v]}
b e
a c d
G\N[a] G\N[b]
e
c d
G\N[e]
Fig. 1.3 Example of a minimum degree branching algorithm. We branch on vertex a. Then in one
subproblem we branch on c, and in the other on e, etc.
in a node can be obtained from its descendant branches, and this is why we use the
term branching for this type of algorithms and call the general approach Branch &
Reduce. The running time spent by the algorithm on computations corresponding
to each node is polynomial—we construct a new graph by removing some vertices,
and up to a polynomial multiplicative factor the running time of the algorithm is
upper bounded by the number of nodes in the search tree T . Thus to determine the
worst case running time of the algorithm, we have to determine the largest number
T (n) of nodes in a search tree obtained by any execution of the algorithm on an
input graph G having n vertices. To compute T (n) of a branching algorithm one
usually relies on the help of linear recurrences. We will discuss in more details how
to analyze the running time of such algorithms in Chap. 2.
Let us consider the branching algorithm mis1 for MIS of Fig. 1.2. Let G be
the input graph of a subproblem. Suppose the algorithm branches on a vertex v of
degree d(v) in G. Let v1 , v2 , . . . , vd(v) be the neighbors of v in G. Thus for solving
the subproblem G the algorithm recursively solves the subproblems G \ N[v], G \
N[v1 ], . . . , G \ N[vd(v) ] and we obtain the recurrence
d(v)
T (n) ≤ 1 + T (n − d(v) − 1) + ∑ T (n − d(vi ) − 1).
i=1
Since in step 3 the algorithm chooses a vertex v of minimum degree, we have that
for all i ∈ {1, 2, . . . , d(v)},
d(v) ≤ d(vi ),
n − d(vi ) − 1 ≤ n − d(v) − 1
d(v)
T (n) ≤ 1 + T (n − d(v) − 1) + ∑ T (n − d(v) − 1)
i=1
≤ 1 + (d(v) + 1) · T (n − d(v) − 1).
T (n) ≤ 1 + s · T (n − s) ≤ 1 + s + s2 + · · · + sn/s
1 − sn/s+1
= = O∗ (sn/s ).
1−s
For s > 0, the function f (s) = s1/s has its maximum value for s = e and for integer
s the maximum value of f (s) = s1/s is when s = 3.
10 1 Introduction
1,25
1,0
0,75
0,5
0,25
0,0
0 2 4 6 8 10 12 14 16 18 20
x
Thus we obtain
T (n) = O∗ (3n/3 ),
and hence the running time of the branching algorithm is O∗ (3n/3 ).
Branch & Reduce is one of the fundamental paradigms in the design and analy-
sis of exact exponential time algorithms. We provide a more detailed study of this
approach in Chaps 2 and 6.
Notes
As a mathematical problem, TSP was first formulated in 1930 but the history of
the problem dates back in the 1800s when Hamilton studied related problems. See
[115] for the history of the problem. The dynamic programming algorithm for TSP
is due to Bellman [16, 17] and to Held and Karp [111]. Surprisingly, for almost 50
years of developments in Algorithms, the running time O∗ (2n ) of an exact algo-
rithm for TSP has not been improved. Another interesting question is on the space
requirements of the algorithm. If the maximum distance between two cities is W ,
then by making use of inclusion-exclusion (we discuss this technique in Chap. 4), it
is possible to solve the problem in time O∗ (W 2n ) and space O∗ (W ) [127]. Recently,
Lokshtanov and Nederlof used the discrete Fourier transform to solve TSP in time
O∗ (W 2n ) and polynomial, i.e. nO(1) · (logW )O(1) space [154]. See also Chap. 10
for a O∗ (4n nO(log n) ) time and polynomial space algorithm.