NP)
Known L1 Again, why is the reduction in this direction?
Directed Hamiltonian Cycle (DHC)
G = (V, E) - directed graph
Hamiltonian cycle: cycle passing through all nodes in V.
DHC
Recall (we did): Non-deterministic polynomial time algorithm
Satisfiability
Suppose F is an instance of Satisfiability
Construct directed graph G such that F is satisfiable iff G has a DHC.
n variables
This graph would correspond to the formula:
If F is satisfiable make circuit pass through 'true' column of each variable.
Some solutions would be {T, T, T}, {T, F, T}, {F, F, F}, {T, T, ?}, {T, ? , T}, { ? , T, F}
Consider {T, F, T} - take False literals left out of circuit.
But this only includes the literals that were true in our circuit. We need the hamiltonian circuit to include all nodes. So we need a way to include the false literals. (Remember, we are reducing Sat to DHC and a DHC must go through all nodes.)
We will gather all the false literals in the separate clauses. We need the option to bypass each literal in ci
Since not all literals can be false in a given clause --
(otherwise Hamiltonian Circuit
clause i
Here, Literal i6 is the only true literal (must have one)
So, we need a way to get in (and out) at any place in this loop so that we can capture only the false literals
This // lines shows such a path (missing some nodes - those that would be true)
Hamiltonian circuit
Hamiltonian circuit must pass through either use proper structure to be able to rebuild true and false nodes/literals from path given (i.e, to get solution back to SAT)
Ci
Hamiltonian circuit must enter and leave through adjacent And, if you thought this was confusing, see the book! (page 523)
DHC
Directed graph G= (V,E)
Costs on edges
Hamiltonian circuit of cost < M ?
Given an instance of DHC construct complete graph G-> = (V,E->)
Costs:
Hamiltonian circuit in G iff tour of cost < | V |.
Can you conclude from DHC that finding a Hamiltonian circuit in an undirected graph is, NP-complete?
Remember Node Cover
From Garey and Johnson,
An independent set in a graph G = (V, E) is a subset V'
Other sources:
in NP-complete (goodness! Wikipedia has proofs of NP-Complete!). Another (reduction from Clique), or reduction from SAT
NP-Complete. If L1
L2 and L2
NP
L2
NP-Complete
Be careful. To reduce L2
L1 would achieve nothing; it would merely show that L2 could be solved by using L1 ( a problem that can be solved no faster than any other NP-complete problem). Perhaps L2 could be solved in polynomial time - showing it could be solved using a known NP-complete problem does not say too much. But saying that I could solve L1 (a known NP-Complete problem) if I could solve L2, tells me that they are equally tough.
No H.C.
NP
DHC
2n columns (one for each literal)
r clauses
r rows

F = (x1 V ¯x¯2 V ¯x¯3)
(¯x¯1 V x2 V x3)
(x1 V x2 V ¯x¯3)
This is nice, it shows we can achieve a Satisfiablity solution with the graph.




F is Satisfiable)



once path leaves Ai, must pass through all
's before reaching Bi (we need to hit all nodes for a DHC)
So, we need to pick up the ones for the T literals
vertically or horizontally


's.
At least one
left out of 'false' path.
Traveling salesperson problem
Traveling salesperson problem
INDEPENDENT SET, VERTEX COVER and CLIQUE
Despite the fact that VERTEX COVER and CLIQUE are independently useful for proving NP-Completeness results,
they are really just different ways of looking at the same problem. To see this, it is convenient to consider
them in conjunction with a third problem, called INDEPENDENT SET.
V such that for all u, v
V', the edge {u,v} is not in E.
The INDEPENDENT SET problem asks, for a given graph G= (V, E) and a positive integer J < |V|, whether G contains
an Independent set V' having |V'| > J. The following relationships between independent sets, cliques, and vertex covers
are easy to verify.
Def: In graph theory, an independent, or stable, set in a graph G, which contains vertices V, is a set of vertices V' (a subset of V) such that for every two vertices in V', there is no edge connecting the two. In other words, each edge in the graph is incident to at most one vertex in the set. The size of an independent set is the number of vertices it contains.