P-COMPLETE PROBLEMS and APPROXIMATE SOLUTIONS Sartaj
Total Page:16
File Type:pdf, Size:1020Kb
P-COMPLETE PROBLEMS AND APPROXIMATE SOLUTIONS Sartaj Sahni and Teofilo Gonzales Computer Science Department University of Minnesota Minneapolis, Minnesota ABSTRACT recognition problems and in order to speak of approximate solutions we shall have to convert We study the class of P-Complete problems and show them to optimisation problems. Thus, the clique the following: problem of [4 J will become the max clique prob lem) and i) for any constant e > 0 there is a P-complete b) are there P-Complete problems for which one can problem for which an e-approximate solution can obtain solutions arbitrarily close to the be found in linear time optimal in polynomial time (the algorithms of [7] ii) there exist P-Complete problems for which lin can get to within 11k of the optimal in O(nk) ear time approximate solutions that get closer time, here we present problems for which one can and closer to the optimal (with increasing get to within 11k in O(n) time, where n is the problem size) can be found space to describe the problem) , remain open. iii) there exist P-Complete problems for which the In this paper, we shall attempt to answer these approximation problems are also P-Complete. questions. The following problems known to be NP-Complete (see KEY WORDS Karp [4 J) shall be used in the reductions: P-Complete, approximation algorithm, polynomial i) Partition: Given s integers (c ,c , •••,c ) is l 2 s complexity, k-Partition, k-MaxCut, traveling salesman, there a subset I�{1,2, •••,s} such cycle covers. that E c = E c h h heI htI 1. INTRODUCTION ii) Cut: Given an undirected graph G(N,A) , Our notion of P-Complete corresponds to the one weighting function w : A + Z, positive used in [6] . This can easily be seen to be equivalent integer W, is there a set SeN such that to that of Cook [2]. A problem, L , will be said to E w{u,v} > W be P-Complete iff the following holds: L can be - {u,v}eA solved in polynomial deterministic time iff the class ues of nondeterministic polynomial time languages is the vts same as deterministic polynomial time languages (i.e. P = NP). Knuth [5] suggests the terminology iii) Sum of Subsets: Given n+l positive integers NP-Complete. However, his notion of "completeness" is (r ,r , •••r ,m) , is there a that of Karp [4]. Since the equivalence or non l 2 n equivalence of the two notions is not known, we will subset of the r. 's that sums � use the term NP-Complete for problems that can be to m. shown complete with Karp's definition and P-Complete The problems we shall use to answer the questions for those which require the definition of [6]. The posed earlier are: reader unfamiliar with P-Complete problems is referred a) k-Partition: Given n integers r ,r , •••r and to [4] and [6]. All problems that are NP-Complet e l 2 n (i.e. complete under Karp's definitions) are also an integer k � 2, are there P-Complete [2 and 6]. The reverse is unknown. Since disjoint subsets I ,I , •.•,I l 2 k it appears that P � NP, the P-Complete k such that 0 I {1,2, •••n} and problems probably have no polynomial solution. Many i i=l of these problems, especially the optimisation problems, are of practical significance. Often. as in the case of the Knapsack problem [7], approximate solutions (i.e. feasible solutions that are guaranteed to be 'reasonably' close to the optimal) would be (The Partition problem i) above acceptable so long as they can be obtained 'quickly' is then just the 2-Partition (e. g. by an O(nk) algorithm for small k) . Johnson problem.) [3] and Sahni [7] have studied some P-Complete prob lems with respect to obtaining 'good' (i.e. poly b) k-Cut: Given and undirected graph G = (N,A), nomial) approximate algorithms. (For·our purposes, integer k � 2, weighting function an algorithm for a maximization problem WillA e said w: A + Z, positive integer W, are to be f(n) -approximate (f.(n) < 1) iff F* - F < f(n) there disjoint sets S ,S "."S such - 2 k F* t k l I that S = Nand l: w(u,v) � W. 0 i for all n (F* is the maximum value of the objective i=l {u,v}gA function and F the approximation to the maximum, we ueS i assume F*>O» . For a more formal definition see [7].) ueS However, interesting questions like: j a) are there polynomial time approximation algor ;i.�j ithms for all P-Complete problems (note that the (The Cut problem ii) above is just the problems in [4J are stated as language 2-Cut problem. ) 28 b' ) Find disjoint sets, S 1 � i � k, i Partition a f/kl -Partition. We prove this only for k 2. From the partition problem (c .c •••• •c ). that s, = N l: > n 2 s such L!:J l and w{u,v} s 3. construct the following r /� lpartition proble� i=l {u,v}EA S c, -< - UES r, l 1 i < i l VES, r,l p s + 1 < i < n J ifj n = 2(s-2) P l:c./2 (if l:c, odd then there is no partition) is maximised. l l Clearly, the partition problem has "a solution iff the n c) [ /J -Partition: same as a) except that the r/� -Partition problem has one. number f disjoint subsets is ..p n n nowin/kl , k � 2. f /kl -Partition a r /f] - MaxCut. The proof for this n is similar to that for k-Partition k-Cut II follows d) f /J Cut: same as b) except the nu�e� of from I and the techniques of [5]. n � disjoint subsets is now I /kl , k 2. • We note that the proofs used in Lemma 1 are minor d') ;/kl -Maxcut: same as b') with k replaced by extensions of the ones used in Karp [4] . The (n-k) Partition and (n-k)-MaxCut problems are polynomial. We next prese� an approximation algorithm for the n 2. COMPLETENESS PROOFS AND APPROXIMATIONS k-MaxCut and al /kl-MaxCut problems. Consider the algorithm MAXCUT below: (Intuitively. this algorithm We begin by showing that problems a-d of the intro begins by placing one vertex of G into each of the ,Q, duction are P-Complete. sets S, 1 < i < ,Q,; The remaining n-,Q, vertices are examin�d o�e at a time. Examination of a vertex, j, involves determining the set S, 1 < i <,Q, for which Lemma 2.1 l (I) The following problems are NP-COMPLETE l: w{m,j} is minimal. Vertex j is then inserted/ mES, a) k-Partition l b) k-Cut assigned to this set.) c) Inlkl-Partition Algorithm MAXCUT (,Q"G) d) jU/kl -Cut ,Q,•• • number of disjoint sets. S, • into comment. l (II) k-MaxCut and fn/kl -MaxCut are P-Complete. which the vertices, N = (1,2, .••• n), of the graph Proof G(N,A) are to be partitioned.SOL ••• the value of the We have to show that i) if P=NP then a)-d) can be vertex partitioning obtained,w{i.j} ••• weight of the solved in polynomial time and ii) if a)-d) can be edge {i.j} . SET(i) ••• the set to which vertex i solved in polynomial time then the class of P-Complete has been assigned (SET(i) = 0 for all vertices not yet problems is polynomial solvable (this can be shown by assigned to a set). WT(i) ••• used to compute reducing any known P-Complete problem to a)-d». l: w{m.j} , 1 � i � ,Q, i) is trivial. so we shall only show ii). mES ii) Partition a k-Partition. For any Partition i probleIl (c ,c •••• c ) define a k-Partition problem This algorithm assumes that the graph G(N,A) is pre� l 2 s sented as n lists v .v , ••• ,v . Each list v, contains (r ,r ,r l 2 l l 2,,··· s+k_2) where all the edges, {i,j}EA , that �re adjacent to vertex i. 1 < i < S No assumption is made on the order in which these edges appear in the list. end comment s + 1 < i < s + k - 2 � > [InitialiseJ If,Q, n --then do (we may assume that l:c, is even as otherwise the - partition problem cleafly has no solution). Now, SOL + l: w{i,j} l:r = kp and the k-Partition problem has a solution i {i,j}EA iff the corresponding Partition problem has one. S + {i} 1< i< n k-Partition g k-Cut i •. .• + !3 If the given k-Partition problem is (r , r ) S,l n+l < i <,Q, l n define the corresponding k-MaxCut problem to be Stop •••• • G = (N,A) with N = (1,2 n) end; A = {{i.j} liEN. jEN, if;t w({i,j}) = r, r, otherwise Set S, + i I < i < ,Q, l J l (k-l) 2 + 0 and W = (l:r,) WT(i) 1 < i �,Q" 2k l SET (i) + i 1 < i < ,Q, < < (Note, we may again assume k divides l:r,l .) SET (i) + 0 .Q, + 1 i n + l: Clearly, there is a k-Cut > W iff (r ,r •• .•,r ) has SOL w{i,j} l 2 n a k-partition. {i.j}EA l�i<j�,Q, j + ,Q, + 1 lThe k-MaxCut problem is a generalisation of the � [process edge list of vertex jJ 'grouping of ordering data' problem studied in [1).