CS 361: Algorithms and Data Structures
Homework 8 (Extra Credit)
Due date: Friday 12/14 by 12pm (i.e. Section B's final exam time)



This is an optional homework assignment that counts as extra credit towards the "Homework Assignment" portion of your grade. You don't need to do every problem. I will give credit for however many problems you finish. Assignments will be collected at the start of the final exam. Please bring a hardcopy to turn in -- either hand-written or typed.

Comprehension Questions
  1. State precisely how you would prove that a problem is in the set NP.
  2. State precisely how you would prove that a problem is in the set NP-Complete.
NP and NP-Completeness

The following questions ask you to prove that certain problems are in the set NP or NP-Complete. If you have not answered the two questions above, I strongly recommend you do so first. If you can't answer the questions above, then you won't be able to do the questions below!

  1. Suppose we have a graph G= (V, E). A hamiltonian path is a path that visits every vertex in the graph exactly once. Now consider the following decision problem,

    HAMILTONIAN-PATH: Given a graph G and two vertices u and v, determine if there is a hamiltonian path from u to v.

    Show that HAMILTONIAN-PATH is in the set NP.

  2. We say two graphs G and G' are isomorphic if we can relabel the vertices of G to be the vertices of G' and, after relabeling, the edges of G are equivalent the edges of G'. In other words, two graphs are isomorphic if they are essentially the same graph with perhaps different labelings of the nodes. As an example, consider the two graphs below:

    G = (V, E) where V = (1, 2, 3, 4) and E = {(1, 4), (2, 3), (3, 3), (1, 3)}
    G' = (V', E') where V' = (A, B, C, D) and E' = {(A, D), (B, C), (C, C), (A, C)}

    Notice that G and G' are the exact same graph. The only difference is that the vertices are labeled with numbers in G and letters in G'. Other than this relabeling however, G and G' are the same. Now consider the following problem,

    GRAPH-ISOMORPHISM: Given two graphs G and G', determine if G and G' are isomorphic.

    Show that GRAPH-ISOMORPHISM is in the set NP.

  3. Given a graph G, an independent set is a subset S of V such that no two nodes in S are connected by an edge. Consider the following decision problem,

    INDEPENDENT-SET: Given a graph G and an integer k, does G contain an independent set of size k?

    Show that the problem INDEPENDENT-SET is NP-Complete by doing a reduction from 3-CNF-SAT. This means you can assume that 3-CNF-SAT is NP-Complete. (Hint: this proof is similar in spirit to the reduction we did in class from 3-CNF-SAT to CLIQUE).

  4. Now that you have shown INDEPENDENT-SET is NP-Complete, show that VERTEX-COVER is NP-Complete by doing a reduction from INDEPENDENT-SET.
    The VERTEX-COVER problem was on a quiz but I will restate it here: Given a graph G and an integer k, does there exist a set S of k nodes that "covers" the graph -- i.e., for every edge (u,v) either u or v (or both) are in S?


Last modified: Fri Jan 24 10:58:47 PST 2014