Some NP-Complete Problems
Total Page:16
File Type:pdf, Size:1020Kb
Appendix A Some NP-Complete Problems To ask the hard question is simple. But what does it mean? What are we going to do? W.H. Auden In this appendix we present a brief list of NP-complete problems; we restrict ourselves to problems which either were mentioned before or are closely re- lated to subjects treated in the book. A much more extensive list can be found in Garey and Johnson [GarJo79]. Chinese postman (cf. Sect. 14.5) Let G =(V,A,E) be a mixed graph, where A is the set of directed edges and E the set of undirected edges of G. Moreover, let w be a nonnegative length function on A ∪ E,andc be a positive number. Does there exist a cycle of length at most c in G which contains each edge at least once and which uses the edges in A according to their given orientation? This problem was shown to be NP-complete by Papadimitriou [Pap76], even when G is a planar graph with maximal degree 3 and w(e) = 1 for all edges e. However, it is polynomial for graphs and digraphs; that is, if either A = ∅ or E = ∅. See Theorem 14.5.4 and Exercise 14.5.6. Chromatic index (cf. Sect. 9.3) Let G be a graph. Is it possible to color the edges of G with k colors, that is, does χ(G) ≤ k hold? Holyer [Hol81] proved that this problem is NP-complete for each k ≥ 3; this holds even for the special case where k =3 and G is 3-regular. Chromatic number (cf. Sect. 9.1) Let G be a graph. Is it possible to color the vertices of G with k colors, that is, does χ(G) ≤ k hold? Karp [Kar72] proved that this problem is NP-complete for each k ≥ 3. Even the special case where k =3 and G is a planar graph with maximal degree 4 remains NP-complete; see [GarJS76]. Assuming P = NP, there is D. Jungnickel, Graphs, Networks and Algorithms, 527 Algorithms and Computation in Mathematics 5, DOI 10.1007/978-3-642-32278-5, © Springer-Verlag Berlin Heidelberg 2013 528 A Some NP-Complete Problems not even a polynomial approximative algorithm which always needs fewer than 2χ(G) colors; see [GarJo76]. For perfect graphs, the chromatic number can be computed in polynomial time; see [GroLS93]. As noted in Lemma 9.2.1, the clique number ω(G) is a (trivial) lower bound for χ(G). However, it is (for general graphs) NP-complete to decide if one has equality, even if some colouring of G with χ(G) colours is given; this is equivalent to the result of [BusPa06] on the clique partition and independence numbers, using Lemma 9.2.1. Clique (cf. Exercise 2.8.4) Let G =(V,E) be a graph and c ≤|V | a positive integer. Does G contain a clique consisting of c vertices? This problem is NP-complete by a result of Karp [Kar72]; thus deter- mining the clique number ω(G) is an NP-hard problem. Also, the related question of whether G contains a clique with at least r|V | vertices, where 0 <r<1, is NP-complete for fixed r. Assuming P = NP, there is not even a polynomial ε-approximative algorithm for determining a maximal clique; see [AroSa02]. However, the problem can be solved in polynomial time for perfect (in particular, for bipartite) graphs; see [GroLS93]. Clique Partition (cf. Sect. 9.2) Let G =(V,E)beagraphandc ≤|V | a positive integer. Does V admit a partition into at most c cliques? This problem is NP-complete by a result of Karp [Kar72]. Thus deter- mining the clique partition number θ(G) is an NP-hard problem, but the problem can be solved in polynomial time for perfect (in particular, for bi- partite) graphs; see [GroLS93]. As noted in Lemma 9.2.1, the independence number α(G) is a (trivial) lower bound for θ(G). However, it is (for general graphs) NP-complete to decide if one has equality, even if some minimum clique partition is given; see [BusPa06]. Diameter (cf. Sect. 3.9) Let G =(V,E) be a connected graph, and let c ≤|V | be a positive integer. Recall that the diameter of G can be determined efficiently; see Sect. 3.9. However, the following two related problems are NP-complete; see [ChvTh78] and [GarJo79]. (1) Does there exist a strongly connected orientation H of G with diameter at most c? Note that Robbins’ theorem allows us to check efficiently whether a strongly connected orientation exists (and to find such an orientation, if possible); see Sect. 1.6. (2) Let C be a given set of at most |E| nonnegative integers. Does there exist a mapping w : E → C such that G has weighted diameter at most c, that is, such that any two vertices u, v have distance d(u, v) ≤ c in the network (G, w)? This problem remains NP-complete even for C = {0, 1}. A Some NP-Complete Problems 529 Discrete metric realization (cf. Sect. 3.2) Let D =(dxy)beann×n matrix with integer entries representing distances in a finite metric space. Is there a network (G, w) of total length ≤ k realizing D? Winkler [Win88] proved that this problem—and also the analogous real problem—is NP-complete. Disjoint connecting paths (cf. Sect. 7.1) Let G be a graph, k an integer, and (s1,t1),...,(sk,tk) pairs of vertices (usually called terminals). Are there disjoint paths P1,P2,...,Pk such that Pi connects si with ti? Here disjoint may be interpreted as either edge disjoint and vertex disjoint. In both cases, this problem is NP-complete as stated (that is, if k is included in the input), even when G is assumed to be planar; these results are due to Karp [Kar75] and Lynch [Lyn75]. However, the problem becomes polynomial for every fixed k, a result first proved in the framework of the fundamental theory of graph minors due to Robertson and Seymour [RobSe95]. Recently, a quadratic time algorithm was given by Kawarabayashi, Kobayashi and Reed [KawKR12]; this paper also contains a good discussion of the problem, in- cluding many further references. Disjoint paths (cf. Sect. 7.1) Let G =(V,E)beagraph,s and t be two vertices of G,andk and c be two positive integers. Does G contain k vertex disjoint paths of length at most c from s to t? Itai, Pearl and Shiloach [ItaPS82] proved that this problem is NP-complete for each fixed k ≥ 5 (whereas it is polynomial for fixed k ≤ 4). Similar results hold for edge disjoint paths from s to t, and for the analogous problems where each path should contain precisely c edges. In contrast, the maximal number of (edge or vertex) disjoint paths from s to t can be determined efficiently using network flow methods if no restrictions are added; see Sect. 7.1. Dominating set (cf. Sect. 2.8) Let G =(V,E)beagraphandk a positive integer. Does G admit a domi- nating set D with |D|≤k? The variant where D is required to be connected is likewise NP-complete, see Exercise 2.8.7. Graph partitioning (cf. Sect. 9.2) Let G =(V,E)beagraphandc a positive integer. The question of whether G can be partitioned into at most c subgraphs of a given type is NP-complete for many classes of subgraphs: for triangles and, more generally, for subgraphs with a given isomorphism type, for Hamiltonian subgraphs, for forests, for cliques, and for matchings. We refer the reader to [GarJo79, §A1.1] and the references given there. 530 A Some NP-Complete Problems In particular, determining the clique partition number θ(G)isanNP- hard problem in general. For perfect graphs, this problem can be solved in polynomial time; see [GroLS93]. Hamiltonian cycle (cf. Sects. 1.4 and 2.8) Let G =(V,E) be a graph. Does G contain a Hamiltonian cycle? Karp [Kar72] proved that this problem is NP-complete; it remains NP- complete even if we know a Hamiltonian path of G [PapSt77]; see Theo- rem 15.7.3. The special cases for bipartite graphs and for planar, 3-connected, 3-regular graphs are still NP-complete; see [Kri75]and[GarJT76]. The anal- ogous problem for directed Hamiltonian cycles in digraphs likewise is NP- complete [Kar72]; see Exercise 2.7.6. Hamiltonian path (cf. Exercise 2.7.7) Does the graph G =(V,E) contain a Hamiltonian path? This problem and the analogous directed problem are NP-complete, even if the start and end vertices of the Hamiltonian path are fixed; see [GarJo79]. Independent set (cf. Exercise 2.8.4) Let G =(V,E) be a graph and c ≤|V | a positive integer. Does G contain an independent set with c elements? Note that the independent sets of G are precisely the cliques of the complementary graph G. This problem is therefore NP-complete in general, but polynomial for perfect graphs (see Clique and Vertex cover). The independent set problem remains NP-complete when restricted to 3- regular planar graphs; see [GarJS76]. Induced subgraph Let G =(V,E) be a graph and c a positive integer. The problem of whether G contains an induced subgraph on c vertices that belongs to a prescribed class of graphs is often NP-complete: for cliques and independent sets (see Clique and Independent set), and also for planar subgraphs, for bipartite subgraphs, for subforests, etc. We refer to [GarJo79, § A1.2] and the references given there.