Ch.11
P, NP and Decision Problems
Problem Examples Continued (again)

First, don't forget that to show a problem L2 is NP-Complete, you need to do two things
  1. show that the problem is in NP (L2 NP)
  2. show that a known NP-Complete problem can be reduced to this problem

Known L1 NP-Complete.       If L1 L2     and L2 NP       L2 NP-Complete

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.

    No H.C.

DHC NP

Recall (we did): Non-deterministic polynomial time algorithm

Satisfiability DHC

Suppose F is an instance of Satisfiability

Construct directed graph G such that F is satisfiable iff G has a DHC.

n variables 2n columns (one for each literal)
r clauses r rows

This graph would correspond to the formula:
F = (x1 V ¯x¯2 V ¯x¯3) (¯x¯1 V x2 V x3) (x1 V x2 V ¯x¯3)

If F is satisfiable make circuit pass through 'true' column of each variable.
This is nice, it shows we can achieve a Satisfiablity solution with the graph.

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   F is Satisfiable)

                            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 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

Hamiltonian circuit must pass through either vertically or horizontally

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 's.
At least one left out of 'false' path.

And, if you thought this was confusing, see the book! (page 523)

Traveling salesperson problem

DHC Traveling salesperson problem

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?

INDEPENDENT SET, VERTEX COVER and CLIQUE

Remember Node Cover

From Garey and Johnson,

Other sources:
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.

in NP-complete (goodness! Wikipedia has proofs of NP-Complete!). Another (reduction from Clique), or reduction from SAT