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}, anda. Show that SPATH is in P.
LPATH = { < G,a,b,k > | G contains a simple path of length at least k from a to b}.