Various NPC Problems




CS255

Chris Pollett

Apr 24, 2019

Outline

Introduction

Reductions We Will Show

Graph of NP-reductions

CLIQUE

Theorem. CLIQUE is `NP`-complete.

Proof. First CLIQUE is in `NP` because we can just guess a set of more than `k` vertices and check for each possible edge between these vertices. Next we show how to reduce 3SAT to CLIQUE. Let
`F = C_1^^C_2... ^^ C_k`
be an instance of 3SAT. For each `C_r= (l_1^r vv l_2^r vv l_3^r )`, we put a triple of vertices into our graph `G`, `v_1^r, v_2^r, v_3^r`. We put an edge between vertices `v_i^r` and `v_j^s` if they are in different triples and their corresponding literals are not negations of each other. Let `(G, k)` be the output instance of CLIQUE. Notice if there is a satisfying assignment to `F` then if we look at the corresponding vertices `v_j^r` of at least one satisfied literal/clause, it will be a CLIQUE of size `k` in `G`. As there are no edges between vertices coming from the same clause, any CLIQUE of size `k` has to have at least one vertex `v_j^r` for each `1 le r le k`. Choosing an assignment so that the corresponding literals for each `v_j^r` evaluates to true gives a satisfying assignment. So the reduction works.

CLIQUE Example

Example Clique Reduction Graph

VERTEX-COVER

Theorem. VERTEX-COVER is `NP`-complete.

Proof. To see it is in `NP` notice if we guess a set of `k` edges we can check if it is a vertex cover in polynomial time. To see it is `NP`-complete we reduce CLIQUE to this problem. Let `bar(G)` denote the complement of a graph `G= langle V, E rangle`, that is, the graph with the same vertices, but with edges `{i, j}` iff `{i, j}` is not an edge of `G`. Then notice `G` has a clique of size `k` iff `bar(G)` has a vertex cover of size `|V| - k`.

In-Class Exercise

Hamiltonian Cycles

Theorem. HAM-CYCLE is `NP`-complete.

Proof. First, given a permutation of the vertices, we can in polynomial time verify whether or not it is a Hamiltonian cycle. So HAM-CYCLE is in `NP`. To see it is `NP`-complete, we show VERTEX-COVER `le_p` HAM-CYCLE. Given a graph `G` and an integer `k`, we need to make a new graph `G'` which has a Hamiltonian cycle iff the original had a vertex cover of size `k`...

More NP-Completeness Proof of HAM-CYCLE

We will make use of the following widget `W_(uv)` to build a new graph `G'` from `G`:

The Hamiltonian Cycle Widget

The middle path in our example paths above will be used if `u` and `v` are both in cover of `G`.

For each edge `{u, v}` in the original graph, the graph `G'` contains one copy of the widget `W_(uv)` (i.e, `W_(uv)` and `W_(vu)` are the same widget) and we denote the edges of the widget by `[u, v, i]` or `[v, u, i]` according to if they are on the left or right side. Only the tops and bottoms of widgets will be connected to the rest of the graph `G'`. In our construction, a cycle must visit each widget, and there are exactly three different ways (as shown above) one could visit all the vertices of the widget: start on the left side, the right side, or do the two sides separately. In addition to the vertices of the widgets, we will have selector vertices, `s_1,..., s_k`. The edges chosen in these selector vertices will correspond to the `k` vertices of the vertex cover in `G`. We also have two additional types of edges besides those in the widgets that we describe on the next slide.

Connecting Widgets and Selector Vertices/Edges

Conclusion HAM-CYCLE is NP-Complete

HAM-CYCLE Reduction Example

Example CLIQUE to HAM-CYLE reduction