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.

478<br />

Chapter 8 NP and Computational Intractability<br />

cl can only be visited if ~<br />

cycle traverses some path I<br />

correct direction. __J<br />

Figure 8.8 The reduction from 3-SAT to Hamiltonian Cycle: part 2.<br />

the nodes immediately before and after c i in the cycle e are joined by an edge e<br />

in G; thus, if we remove ci from the cycle and insert this edge e for eachj, then<br />

ck}. This is our<br />

original subgraph, before we.added the clause nodes; as we noted above, any<br />

Hamfltonian cycle in this subgraph must traverse each P~ h~y in one direction<br />

or the other. We thus use ~ to define the following truth assignment for the<br />

B-SAT instance. If ~’ traverses Pi left to right, then we set x~ = 1; otherwise we<br />

set xi = 0. Since the larger ~ycle ~ was able to visit each clause node % at least<br />

one of the paths was traversed in the correc direction relative to the node<br />

% and so the assigranent we have defined satisfies all the clauses.<br />

8.5 Sequencing Problems<br />

Having established that the 3-SAT instance is satisfiable if and only if G<br />

has a Hamiltonian cycle, our proof is complete. ,,<br />

Proving Traveling Salesman is NP-Complete<br />

Armed with our basic hardness result for Hamiltonian Cycle, we can move on<br />

to show the hardness of Traveling Salesman.<br />

(8.18) Traveling Salesman is NP-complete.<br />

Proof. It is easy to see that Traveling Salesman is in NT: TheCertificate<br />

is a permutation of the cities, and a certifier checks that the length of the<br />

corresponding tour is at most the given bound.<br />

We now show that Hamiltonian Cycle

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

Saved successfully!

Ooh no, something went wrong!