04.09.2013 Views

Algorithm Design

Algorithm Design

Algorithm Design

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

556<br />

Chapter 10 Extending the Limits of Tractability<br />

(10.2) If G = (V, E) has n nodes and a vertex cover of size k, then G has at<br />

most k(n - 1) k IVI edges, then it has no k-node vertex cover<br />

Else let e=(u,u) be au edge of G<br />

Kecursively check if either of G-{u} or G-{u}<br />

has a vertex cover of size k-I<br />

If neither of them does, then G has no k-node vertex cover<br />

10.1 Finding Small Vertex Covers<br />

Else, one of them (say, G-{u}) has a (k- l)-node vertex cover T<br />

In this case, TU[u} is a k-node vertex cover of G<br />

Endif<br />

Endif<br />

~ Analyzing the <strong>Algorithm</strong><br />

Now we bound the running time of this algorithm. Intuitively, we are searching<br />

a "tree of possibilities"; we can picture the recursive execution of the algorithm<br />

as giving rise to a tree, in which each node corresponds to a different recursive<br />

call. A node corresponding to a recursive call with parameter k has, as children,<br />

two nodes corresponding to recursive calls with parameter k - 1. Thus the tree<br />

has a total of at most 2 k+l nodes. In each recursive call, we spend O(kn) time.<br />

Thus, we can prove the following.<br />

(10.4) The running time o[ the Vertex Cover <strong>Algorithm</strong> on an n-node graph,<br />

with parameter k, is O(2 k . kn).<br />

We could also prove this by a recurrence as follows. If T(n, k) denotes the<br />

running time on an n-node graph with parameter k, then T(., .) satisfies the<br />

following recurrence, for some absolute constant c:<br />

T(n, 1) _< cn,<br />

T(n, k) < 2T(n, k - 1) + ckn.<br />

By induction on k _> 1, it is easy to prove that T(n, k) < c. 2kkn. Indeed, if this<br />

is true for k - 1, then<br />

T(n, k) < 2T(n - 1, k - 1) + ckn<br />

< 2c. 2/~-1(k - 1)n + ckn<br />

= c. 2kkn -- c. 2kn + ckn<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!