CS4311: Introduction to Computation Theory hw10

CS 4311 Introduction to Computation Theory
Homework 13: Chapter 7

Due: FRIDAY, 12/15/06, beginning of class (Assigned: Friday, 12/8/06)

You are required to turn in answers to all the questions. However, only a random subset of the questions will be graded. While discussion with others is permitted and encouraged, the final work should be done individually. You are not allowed to work in groups. The answers, comments, and programs (if any) must be the original work of the author. You are allowed to build on material supplied in the class. If you use any other source than the current class notes and the textbook, specify it clearly.

1. (Exercise 7.8) Let CONNECTED = {< G > | G is a connected undirected graph}. Analyze the algorithm given on page 157 to show that this language is in P. (it is on page 146 in the first edition)

2. (Exercise 7.9) A triangle in an undirected graph is a 3-clique. Show that TRIANGLE is in P, where TRIANGLE = {< G > | G is an undirected graph that contains a triangle}.

3. (Exercise 7.6) Show that P is closed under union, concatenation, and complement.

4. (Exercise 7.7) Show that NP is closed under union and concatenation.

5. Consider the following languages:

HAMCIRCUIT = { < G > | G has a cycle that passes through all nodes in G exactly once}
TSP = { < G,k > | G is a weighted graph and there is a cycle which visits all the nodes in G exactly once without exceeding a total weight of k}.

The Hamiltonian circuit problem is similar to the Hamiltonian path problem except that we are looking for a Hamiltonian cycle (or a circuit, or a path in which the starting point is the same as the ending point). The TSP is the Traveling Salesman Problem. A weighted graph is one where each edge is labeled with a weight value. In the Traveling Salesman problem, the label shows the cost of traveling from one city to another and the salesperson is looking for a cost effective way of visiting all the cities and coming back to where he started. Prove by reduction that TSP is NP-complete, assuming that HAMCIRCUIT is NP-complete. Remember that you must provide a full NP-completeness proof.

6. (Exercise 7.20) Let G represent an undirected graph and let

SPATH = { < G,a,b,k > | G contains a simple path of length at most k from a to b}, and
LPATH = { < G,a,b,k > | G contains a simple path of length at least k from a to b}.
a. Show that SPATH is in P.
b. Show that LPATH is NP-complete. You may assume the NP-completeness of UHAMPATH, the Hamiltonian path problem for undirected graphs.