12.07.2015 Views

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Sec. 17.5 Exercises 58917.3 Use a reduction <strong>to</strong> prove that multiplying two upper triangular n × n matricesis just as expensive (asymp<strong>to</strong>tically) as multiplying two arbitrary n × nmatrices.17.4 (a) Explain why computing the fac<strong>to</strong>rial of n by multiplying all valuesfrom 1 <strong>to</strong> n <strong>to</strong>gether is an exponential time algorithm.(b) Explain why computing an approximation <strong>to</strong> the fac<strong>to</strong>rial of n by makinguse of Stirling’s formula (see Section 2.2) is a polynomial timealgorithm.17.5 Consider this algorithm for solving the K-CLIQUE problem. First, generateall subsets of the vertices containing exactly k vertices. There are O(n k ) suchsubsets al<strong>to</strong>gether. Then, check whether any subgraphs induced by thesesubsets is complete. If this algorithm ran in polynomial time, what wouldbe its significance? Why is this not a polynomial-time algorithm for the K-CLIQUE problem?17.6 Write the 3 SAT expression obtained from the reduction of SAT <strong>to</strong> 3 SATdescribed in Section 17.2.1 for the expression(a + b + c + d) · (d) · (b + c) · (a + b) · (a + c) · (b).Is this expression satisfiable?17.7 Draw the graph obtained by the reduction of SAT <strong>to</strong> the K-CLIQUE problemgiven in Section 17.2.1 for the expression(a + b + c) · (a + b + c) · (a + b + c) · (a + b + c).Is this expression satisfiable?17.8 A Hamil<strong>to</strong>nian cycle in graph G is a cycle that visits every vertex in thegraph exactly once before returning <strong>to</strong> the start vertex. The problem HAMIL-TONIAN CYCLE asks whether graph G does in fact contain a Hamil<strong>to</strong>niancycle. Assuming that HAMILTONIAN CYCLE is N P-complete, prove thatthe decision-problem form of TRAVELING SALESMAN is N P-complete.17.9 Use the assumption that VERTEX COVER is N P-complete <strong>to</strong> prove that K-CLIQUE is also N P-complete by finding a polynomial time reduction fromVERTEX COVER <strong>to</strong> K-CLIQUE.17.10 We define the problem INDEPENDENT SET as follows.

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

Saved successfully!

Ooh no, something went wrong!