l12 - Lecture 12: NP-complete graph problems David Dill...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 12: NP-complete graph problems David Dill Department of Computer Science 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Outline NP-complete problems Independent Set (IS) Node Cover (NC) Hamiltonian circuit Directed Hamiltonian Circuit Undirected Hamiltonian Circuit Traveling Salesman Problem 2
Background image of page 2
Independent Set (IS) Def In an undirected graph, G , a set of nodes I is independent if no two nodes in I are connected by an edge. Input: A graph G and and a bound 1 k ≤ | V | . Output: “Yes” iff there is an independent set of size k . Theorem IS is NP-complete. IS is in NP . Given a graph and I V , examine the edges one at a time to make sure that no edge connects two nodes in I . With any reasonable representation of the graph and I , this would be polynomial time (probably linear in the number of edges on a conventional computer). 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Reducing from CSAT To reduce CSAT (or 3SAT) to another problem, the reduction has to capture two crucial ideas: If a literal is selected, its negation is never selected. At least one literal is selected per clause. These conditions can be satisfied iff there is a satisfying truth assignment for the original CSAT problem. : Start with a truth assignment. There must be at least one true literal per clause. : If we satisfy these conditions, we can build a truth assignment by choosing x i = T if x i literal is selected, x i = F if ¬ x i is selected, and x i = whatever if neither is selected. 4
Background image of page 4
NP-hardness of IS IS is NP-hard . By reduction from 3SAT. Construction: Let φ be a 3CNF formula with m clauses. Create a node for each occurrence of a literal in each clause. Each node is labelled with the literal, the clause number, and the position of the literal within the clause (e.g. x 3 [1 , 3] represents the occurrence of x 3 , in the third position in the first clause). Main idea: I represents one literal per clause that has to be true. (There may be other true literals as well.) Idea 1: Put negation edges between literals and their negations. That prevents adding x and ¬ x to the IS. Idea 2: Put
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/12/2010 for the course CS 154 at Stanford.

Page1 / 15

l12 - Lecture 12: NP-complete graph problems David Dill...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online