Starting from:
$30

$24

Homework 5


    1. (7 points) Let X and Y be two decision problems. Suppose we know that X reduces to Y in polynomial time. Which of the following statements are true? Explain

        a. If Y is NP-complete then so is X.

        b. If X is NP-complete then so is Y.

        c. If Y is NP-complete and X is in NP then X is NP-complete.

        d. If X is NP-complete and Y is in NP then Y is NP-complete.

        e. If X is in P, then Y is in P.

        f. If Y is in P, then X is in P.

        g. X and Y can't both be in NP.


    2. (8 points) A Hamiltonian path in a graph is a simple path that visits every vertex exactly once. Show

that HAM-PATH = { (G, u, v ): there is a Hamiltonian path from u to v in G } is NP-complete. You may use the fact that HAM-CYCLE is NP-complete.


    3. (15 points) K-COLOR. Given a graph G = (V,E), a k-coloring is a function c: V -> {1, 2, … , k} such that c(u) c(v) for every edge (u,v) E. In other words the number 1, 2, .., k represent the k colors and adjacent vertices must have different colors. The decision problems K-COLOR asks if a graph can be colored with at most K colors.

        a. The 2-COLOR decision problem is in P. Describe an efficient algorithm to determine if a graph has a 2-coloring. What is the running time of your algorithm?


        b. The 3-COLOR decision problem is NP-complete by using a reduction from SAT. Use the fact that 3-COLOR is NP-complete to prove that 4-COLOR is NP-complete.

More products