<<

Journal of Computer and System Sciences  SS1432

journal of computer and system sciences 53, 180193 (1996) article no. 0060

View metadata, citation and similarTaking papers at core..uk It to the Limit: On Infinite Variants brought to you by CORE of NP-Complete Problems provided by Elsevier - Publisher Connector

Tirza Hirst and David Harel*

Department of Applied Mathematics H Computer Science, The Weizmann Institute of Science, Rehovot 76100, Israel

Received November 1, 1993

We first a general way of obtaining infinite versions We define infinite, recursive versions of NP optimization problems. of NP maximization and minimization problems. If P is the For example, MAX CLIQUE becomes the question of whether a recursive problem that asks for a maximum by graph contains an infinite clique. The present paper was motivated by trying to understand what makes some NP problems highly max |[wÄ : A<,(wÄ , S)]|, undecidable in the infinite case, while others remain on low levels of S the arithmetical hierarchy. We prove two results; one enables using knowledge about the infinite case to yield implications to the finite where ,(wÄ , S) is first-order and A is a finite structure (say, case, and the other enables implications in the other direction. a graph), we define P as the problem that asks whether Moreover, taken together, the two results provide a method for proving there is an S, such that the set [wÄ : A <,(w, S)] is infinite, (finitary) problems to be outside the syntactic class MAX NP, and, where A is an infinite recursive structure. Thus, for example, hence, outside MAX SNP too, by showing that their infinite versions are 1 Max Clique becomes the question of whether a recursive 71-complete. We illustrate the technique with many examples, resulting 1 in a large number of new 71 -complete problems. ] 1996 Academic graph contains an infinite clique. Often, the infinitary Press, Inc. problem becomes trivial; the generalization of Max Sat, for instance, becomes the following problem: Given an infinite set of clauses C, does there exist some assignment S that satisfies an infinite subset of C? The answer is always in the 1. INTRODUCTION affirmative, when we consider only satisfiable clauses. In this paper we prove two results. One enables using An infinite recursive graph can be thought of simply as a information about the infinite case to yield implications to recursive binary relation over some recursive countable the finite case, and the other enables implications in the setthe natural numbers, for instance. Since recursive other direction. Moreover, taken together, the two results graphs can be represented by the Turing machines that provide a method for proving (finitary) problems to be out- recognize their edge sets, one can investigate the complexity side the syntactic class Max NP, and, hence, outside Max of problems concerning them. Indeed, a significant amount SNP too,2 while at the same time showing infinitary of work has been carried out in recent years regarding such 1 Max Max problems to be 71 -hard. The classes NP and problems. Beigel and Gasarch [BG1, BG2] have shown SNP have been the subject of recent renewed interest, that many problems on recursive graphs reside on low levels following the developments that show that, whereas of the arithmetical hierarchy. For example, determining problems in Max NP are approximable in polynomial time whether a recursive graph is 3-colorable is 6 0 -complete. On 1 to within some constant, the ones that are hard for Max the other hand, in [H2] it was shown that determining SNP have no polynomial-time approximation scheme whether a recursive graph has a Hamiltonian path is outside [ALMSS, AS]. These latter sets are closed under special the arithmetical hierarchy, and is, in fact, 71 -complete.1 1 approximation-preserving transformations and are, thus, The present work was motivated by trying to understand different from the syntactic sets we refer to here. In fact, our what makes some NP-complete problems on graphs highly results appear to have no direct relevance to issues of undecidable in the infinite case, while others remain on low approximability. levels of the arithmetical hierarchy. Our first result, proved in Section 3, is that the infinite version of any problem in Max NP is arithmetical; specifi- Max 0 Max * E-mail: [tirza, harel]Äwisdom.weizmann.ac.IL. cally, if P # NP then P # 6 2 . Moreover, if P # 1 A similar result for perfect matching in recursive graphs can be established using a proof technique appearing in [AMS]. 2 These classes, which appear in [PY, PR, KT], are defined in Section 2.

0022-0000Â96 18.00 180 Copyright  1996 by Academic Press, Inc. All rights of reproduction in any form reserved.

File: 571J 143201 . By:BV . Date:25:09:96 . Time:14:41 LOP8M. V8.0. Page 01:01 Codes: 6866 Signs: 4588 . Length: 60 pic 11 pts, 257 mm INFINITE VARIANTS OF NP-COMPLETE PROBLEMS 181

NP then every instance of P has either an infinite solution for quantifier-free . Max Sat is the canonical example of a or a maximal finite solution (i.e., no instance of P has a problem in Max NP. They also considered the subclass solution of size k, for arbitrarily large k, without having an Max SNP of Max NP, consisting of those maximization infinite one too). We like to view this fact in its dual problems that are defined by quantifier-free formulas, i.e, formulation: The finitary version of any problem whose the optimum of such problems can be defined by 0 Max infinite version is higher than 6 2 must be outside NP, and, hence, outside Max SNP too. The same is true for max |[xÄ : A<(xÄ , S)]| problems that have an instance containing no infinite solu- S tion, but containing a solution of size k, for arbitrarily large k. For the second result, proved in Section 4, we define for quantifier-free . Max 3SAT is easily seen to be in Max a special kind of monotonic transformation between NP SNP. Actually, Papadimitriou and Yannakakis [PY] optimization problems, which we call an M-reduction. The meant that the classes Max NP and Max SNP contain also idea is, essentially, that (in a maximization problem) enriching their closures under -reductions, which preserve polyno- the structure in one problem enriches it in the other, as well mial-time approximation schems. We do not. Kolaitis and Max Max Max as making the objective functions grow. We prove that M- Thakur use the names 70 and 71 , for SNP reductions between conventional finitary problems become and Max NP, and they too talk about the ``pure'' syntactic 1 71 -reductions when ``lifted up'' to the infinite case. This classes. To avoid confusion, we shall follow this terminology 1 enables one to prove 71 -hardness of infinitary problems by in the rest of the paper. examining, and sometimes modifying, reductions between More recently, in a paper by Panconesi and Ranjan their finitary versions. [PR], Kozen showed that Max Clique does not belong to Max Max Indeed, in Section 5 we use our second result to prove the 71 . 61 was introduced in [PR] as the class of 1 71 -hardness of many additional problems. Moreover, by maximization problems whose optimum can be defined by our first result, the finitary versions of these must all be out- side Max NP. Here is a partial list of the problems for which max |[wÄ : A<(\xÄ ) (wÄ , xÄ , S)]| these two properties are established: Max Clique, Max S Ind Set, Max Ham Path, Max Subgraph, Max Common Subsequence, Max Color, Max Exact Cover By Pairs, for quantifier-free . Max Tiling. Kolaitis and Thakur [KT] then took a broader view. They examined the class of all maximization problems 2. BACKGROUND AND PRELIMINARIES whose optimum is definable using first-order formulas, i.e., by Our approach to optimization problems is to focus on max |[wÄ : A<(wÄ , S)]|, their descriptive complexity, via logical definability, an idea S that started with Fagin's [F] characterization of NP in terms of definability in second-order logic on finite struc- where (wÄ , S) is an arbitrary first-order formula. They first tures. (The following paragraphs are adapted from [KT].) showed that this class coincides with the collection of poly- An existential second-order formula is an expression of the nomially bounded NP-maximization problems on finite form (_S) ,(S), where S is a sequence of second-order structures, i.e., those problems whose optimum value is variables that can contain relations (predicates), and ,(S)is bounded by a polynomial in the input size. They then a first-order formula over some vocabulary _. The formula proceeded to show that these problems form a proper is finitary, so the number of variables in S, xÄ , and yÄ is some hierarchy, with exactly four levels: fixed finite constant. Fagin's theorem [F] asserts that a collection C of finite structures over some vocabulary _ is Max 7 /Max 7 /Max 6 /Max 6 = . Max 6 . NP-computable if and only if there is a quantifier-free 0 1 1 2 i i2 formula (xÄ , yÄ , S ) over _, such that for any finite structure Max Max Max A we have Here, 61 is defined just like 71 (i.e., NP), Max but with a universal quantifier, and 62 uses a universal A # C  A<(_S)(\xÄ )(_yÄ ) (xÄ , yÄ , S ). followed by an existential quantifier, and corresponds to Fagin's general result stated above. The three containments Papadimitriou and Yannakakis [PY] introduced the class are strict: It is shown in [KT] that Max Connected Max Component Max Max Max NP of maximization problems, whose optimum can be is in 62 but not in 61 , while Clique Max Max defined by is in 61 but not in 71 (the latter fact was mentioned above and appears in [PR]), and Max Sat is in max |[xÄ : A<(_yÄ )  ( xÄ , yÄ , S ) ] |, Max Max S 71 but not in 70 (this is from [PY]).

File: 571J 143202 . By:BV . Date:25:09:96 . Time:14:41 LOP8M. V8.0. Page 01:01 Codes: 6141 Signs: 4750 . Length: 56 pic 0 pts, 236 mm 182 HIRST AND HAREL

Definition 1 [PR]. An Npo problem is a F= Proposition 1[KT]. F is a polynomially bounded NP Max (IF , SF , mF , opt), where maximization problem iff F # 62 . Definition v IF is the space of input instances, which are finite struc- 3 [PR]. A problem F # RMAX(k) if its tures over some vocabulary _ and is recognizable in time optimization function can be expressed as that is polynomial in the number of elements of the domain.

S (I) is the space of feasible solutions on input I # . optF (I)=max[|S|:(\yÄ ) , ( I , S , yÄ ) ] , v F IF S The only requirement on SF is that there exists a polyno- mial q and a polynomial time computable predicate p, both where , is a quantifier-free CNF formula with all the depending only on F, such that \I # I , S (I)= F F occurrences of S in , being negative, S is a single predicate [S:|S|q(|I|)7p(I, S)]. appearing at most k times in each clause, and |S| denotes v mF: IF_7*ÄN, the objective function, is a polyno- |[xÄ : S(xÄ )]|. mial time . mF (I, S) is defined only Definition 4. Let A =(D , R1, ..., R1 ), A =(D , when S # SF (I). l 1 1 m 2 2 R2, ..., R2 ) be (possibly infinite) structures over the same v opt # [max, min] indicates whether F is a maximiza- 1 m similarity type: [P1, ..., Pm]. We say that A1 is a substructure tion or minimization problem. 1 of A2 , denoted A1A2 ,ifD1 D2and Ri ,1im, is the 2 v The following decision problem is in NP: Given I # IF restriction of Ri to D1 . (If the elements of the domain are and an integer k, is there a feasible solution S # SF (I), such ordered, then D1 has to be a prefix of D2 .) that m (I, S)k when opt=max (or m (I, S)k, when F F Npo opt=min)? We now restrict the class of problems somewhat. Definition 5. Npm is the class of Npo problems Note. We turn some minimization problems into maxi- F=( , S , m , opt), for which opt=max, contains finite mization problems by considering the complements of the IF F F IF structures over a vocabulary _, and the objective function is solutions. For example, Min Vertex Cover will be the given by problem of finding the maximal set of vertices in a graph such that the is a vertex cover. This does not contradict the fact that minimization problems can be very (\I # IF)(\S # SF (I)) (mF(I, S)=|[xÄ : F(I, S, xÄ )]|), different from maximization ones (see [KT]).

where F is a 62 -formula. We require that F satisfies the The above definition is broad enough to encompass most following additional condition: If for some infinite structure known optimization problems arising in the theory of NP- I and for some S and xÄ , F (I , S, xÄ ) is true, then there exists completeness. We now restrict attention to polynomially a finite substructure I of I containing xÄ , such that for each bounded NP optimization problems [BJY, LM], in which II$I , F(I$, S$, xÄ ) is also true, where S$ is the restriction the value of the objective function for every feasible solution of S to the domain of I$. is bounded by a polynomial in the length of the corresponding instance. Note that the addition does not sacrifice generality in the case of 7 , 7 , and 6 , since such formulas satisfy the Definition Max Max Max 0 1 1 2 [PY, PR, KT]. 70 ( 71 , 61 , condition anyway. Max Npo 62 , respectively) is the class of problems F, such We, now ``lift up'' NP maximization problems, resulting in that versions that apply to infinite recursive structures. We do this simply by requiring an infinite solution instead of a maximal optF (I)=max |[xÄ : ,F(I, S, xÄ )]| S one. Minimization problems can be similarly generalized; by requiring that the complement of the solution should be (optF (I)=max |[xÄ :(_yÄ ) , F ( I , S , xÄ , yÄ ) ] |, infinite. S

optF (I)=max |[xÄ :(\yÄ ) , F ( I , S , xÄ , yÄ ) ] |, Definition 6. Let F=(I , S , m )beanNpm prob- S F F F lem. Define F , the infinitary version of F, as follows: optF (I)=max |[xÄ :(\yÄ )(_zÄ ) , F ( I , S , xÄ , yÄ , zÄ ) ] |, F =(IF , SF , mF ), where S v IF is the space of input instances, which are infinite respectively), recursive structures over the vocabulary _. v S F (I ) is the space of feasible solutions on input where ,F is quantifier-free. I # IF .

File: 571J 143203 . By:BV . Date:25:09:96 . Time:14:41 LOP8M. V8.0. Page 01:01 Codes: 5972 Signs: 3959 . Length: 56 pic 0 pts, 236 mm INFINITE VARIANTS OF NP-COMPLETE PROBLEMS 183

v mF : IF _S F Ä N _ [ ] is the objective function says that it suffices to check whether there are infinitely and satisfies many clauses that are satisfiable, by possibly different assignments. Here, of course, the answer is always true. (\I # IF )(\S # S F (I )) (mF (I , S) Lemma . Max where I 1 Let F # 71 , optF ( )= =|[xÄ : F(I , S, xÄ )]|) maxS |[xÄ :(_yÄ ) , ( xÄ , yÄ , I , S ) ] |, for quantifier free ,. Then, for each instance I , where F is the 62 -formula of F.

v The decision problem is: Given I # IF , does there F (I )=true exist S # S F (I ) such that mF (I , S)= ? Put another way, iff |[xÄ :(_S)(_yÄ ) , ( xÄ , yÄ , I , S ) ] |= .

true F (I )= iff _S(|[xÄ : F(I , S, xÄ )]= ). Proof. Let I be a recursive infinite structure, which is an instance of F . According to Definition 6, Due to the condition in Definition 5 of an Npm, F does not depend on the 6 -formula representing mF . Otherwise, 2 if some finite problem F could be defined by two different F (I )=true formulas  and  satisfying the condition, which yield 1 2 iff (_S)(|[xÄ :(_yÄ),(xÄ, yÄ , I , S ) ] |= ). different infinite problems, we could construct a finite struc- ture for which 1 and 2 determine different solutions. The ``only-if'' direction is clear, since we are simply pushing 3. FROM THE INFINITE TO THE FINITE the existential quantifier into the set. For the ``if'' direction, we have to show that if there are Proposition . Npm 1 2 If F # then F # 71 . infinitely many xÄ 's for which there is an S, etc., then there is a single S for which there are infinitely many xÄ 's, etc. Let Proof. Let F=(I , S , m )#Npm. We have to express F F F us consider the sequence consisting of the following for- F by an existential second-order formula over some recur- mulas in some order: ,(xÄ , yÄ , I , S ) for i, j1, where sive predicate. (The formula need not necessarily be over F's i j [xÄ , xÄ , ...] and [yÄ , yÄ , ...] are all the feasible values of xÄ vocabulary.) 1 2 1 2 and yÄ . We may view , as a Boolean formula with ``variables'' F can be described as of the form S(zÄ ), where zÄ is a projection of xÄ and yÄ . The formula also contains terms of the form I (wÄ ) (with (wÄ )a (_S)(\xÄ )(_xÄ )(xÄ

(N(y, c)7cS(y))]|= , where S is a second-order variable appears in only finitely many ,i 's, we proceed as variable that ranges over truth assignments, and P and N follows. First, assign the values of S1 (the satisfying assign- true are two recursive binary predicates; P( y, c)= iff ment of ,1)to,1's variables. Next, repeatedly choose a new variable y appears unnegated in clause c, and N( y, c)= ,i containing only new variables, and satisfy it by using the true iff variable y appears negated in clause c. The lemma values of Si . Continuing this process yields an infinite set

File: 571J 143204 . By:BV . Date:25:09:96 . Time:14:41 LOP8M. V8.0. Page 01:01 Codes: 6502 Signs: 4638 . Length: 56 pic 0 pts, 236 mm 184 HIRST AND HAREL

from among the ,i 's, that are all satisfied by the single graph containing isolated cliques of size n, for each n. Also, assignment S obtained by collecting the values used at each for Hamiltonicity and for Eulerian paths, consider the stage. K following graph: Theorem . Max 1 If F # 71 then vÂwwvÂwwvÂwwvÂwwv }}} 0 1. F # 6 2 . 12345 2. For each recursive structure I # , IF Max By Corollary 2, these are outside 71 . F (I )=true iff (\n)(_S)(m (I , S)n). We note that the problems that appeared in [PY] as F Max Max Independent examples for 70 and 71 , such as Max Set-B and Max Sat (for which the given clauses are Proof. Let F be a problem in 71 , such that satisfiable), become trivial in the infinite case: There is always an infinite solution. The reason is that in these optF (I)=max |[xÄ :(_yÄ ) , ( xÄ , yÄ , I , S ) ] |, S problems the appropriate ,'s are always satisfiable, and, hence, one can always find an assignment that satisfies for quantifier-free ,. According to Lemma 1, for each I , infinitely many ,'s. However, there are problems in these classes whose infinite variants are nontrivial. Here is an F (I )=true iff [xÄ :(_S)(_yÄ ) ,(xÄ , yÄ , I , S ) ] |= . example: Max Ind Set-B- . It follows that we can express the problem F as 2 Given a graph with degree bounded by B and m

File: 571J 143205 . By:BV . Date:25:09:96 . Time:14:41 LOP8M. V8.0. Page 01:01 Codes: 6254 Signs: 4347 . Length: 56 pic 0 pts, 236 mm INFINITE VARIANTS OF NP-COMPLETE PROBLEMS 185

Max Clique Max Ind Section 5 are taken from [GJ], and are already monotonic For example, let us show that BM there. These are usually the simpler ones. Among the others, Set. The instances (i.e., the I's) for these two problems are some are monotonic modifications of reductions from graphs, the feasible solutions are all the cliques or independent [GJ], but others required more work on our part. We also sets in the graph, and the objective function yields the size have a few monotonic reductions from polynomial-time of the solution. problems, for which [GJ] is irrelevant. Let G=(V, E) be an instance of Max Clique. Define g=(t , t , t ) to be: Definition 7. Let A and B be sets of structures. 1 2 3 A function f: A Ä B is monotonic if \A, B # A (AB O v t1(G)=G =(V, E ). f(A)f(B)). (Here,  denotes the substructure relation- v If Q # S(G), then let t2(G, Q)=Q# S(G ). ship of Definition 4.) v If Q # S(G ), then let t3(G , Q)=Q# S(G). Definition . Npm 8 Given two problems: F=(IF, v t1 is monotonic. Let G1=(V1, E1), G2=(V2, E2), SF, mF), G=(IG, SG, mG). An M-reduction g from F to G where V1=[v1, ..., vk], V2=[v1, ..., vk , ..., vn], and such

(denoted F BM G) is a tuple g=(t1, t2, t3): that G1

3. t1 is monotonic, in the sense of Definition 7. and, hence, t1(G1)t1(G2). 4. t and t are partially monotonic; i.e., \I , I # I 2 3 1 2 F Clearly, the other requirements are satisfied too. Theorem 2. Let F and G be two Npm problems, with (I1i and Y /Y /Y }}} 2 ij j=1 j j+1 1 2 3 restriction of I to [1, 2, ..., i]. By Definition 4 we have (the containments, denoted by /, are strict.) The same is I1I2}}}I . Since t1 is monotonic, required for the other direction. t (I )t (I )}}}. Note. All the problems appearing in Section 5 satisfy 1 1 1 2 Define f(I )=i=1t1(Ii). (This is well defined even if there \I1 , I2 # IF \S1 # SF (I1) \S2 # SF is no order on the domain, because of the monotonicity of t1 .) f(I ) is recursive since in order to check if a tuple u (I1I2 7 S1S2) is in some relation # f (I ) it suffices to check if u is in [xÄ  I S xÄ ] [xÄ  I S xÄ ] O : ( 1, 1, ) : ( 2, 2, ) . the appropriate relation in t1(Ii), for large enough i, that contains the elements in u. Moreover, the reductions we show there satisfy We now show that I has an infinite solution iff f(I ) has one. Assume that S # S F (I ), and

\I # IF \S # SF (I ) _k \I # IF \S # SF (I ) 1 1 1 2 2 2 mF (I , S)=|[xÄ : F(I , S, xÄ )]|=|[xÄ 1, xÄ 2, ...]|= . ((I1I2 7S1S2 7(mF(I1, S1)+k)

File: 571J 143206 . By:BV . Date:25:09:96 . Time:14:41 LOP8M. V8.0. Page 01:01 Codes: 6780 Signs: 3986 . Length: 56 pic 0 pts, 236 mm 186 HIRST AND HAREL

Define S =j=1t2(Aj, Sj). Consider now the sets: The maximization version is

[Bj=[yÄ :G(t1(Aj), t2(Aj, Sj), yÄ )]]j=1. max |[x: x # Y7\y, z # Y (y{zO(y, z)#E)]|. Y V Due to Condition 5 of the monotonicity of g, there are Max Clique infinitely many yÄ 's that are contained in infinitely many Bj 's. . I is a recursive graph G.

Since G is a 62 -formula, these yÄ 's must satisfy Q. Does G contain an infinite clique? G( f(I ), S , yÄ ). Hence, mG ( f(I ), S )= . 3. Max Ind Set. I is an undirected graph G=(V, E). The other direction is similar, but uses t3 instead of t2 . K Max We already know that there are problems in 61 S(G)=[Y: Y V, \y, z # Y (y, z) Â E] whose infinite versions are 71 -complete, e.g., Hamiltonicity 1 m(G, Y)=|Y| [H2]. We can also show that there are problems in its subclass RMAX(2) that have the same property, e.g., Max max |[x: x # Y7\y, z # Y (y, z) Â E]|. Clique. Y V

Corollary . Npm Max Max Ind Set 4 Let F # . If F is hard for 61 (or . I is a recursive graph G. even for RMAX(2)) with respect to M-reductions, then F is Q. Does G contain an infinite independent set? 1 71 -complete. 4. Min Vertex Cover. I is a graph G=(V, E). For example, Panconesi and Ranjan [PR], proved the Max Max 4 61 completeness of NSF with respect to S(G)=[Y V: \(u, v)#E (u#V&Y or v # V&Y)] approximation-preserving reductions. Since the reduction Max 1 =[Y V: \u, v # Y (u, v) Â E] they used is also an M-reduction, NSF is 71 - complete. m(G, Y)=|Y|.

5. APPLICATIONS (This problem is identical to Max Ind Set.) Min Vertex Cover . I is a recursive graph G. We start by listing several problems in Npm: Q. Is there a vertex-cover of G whose complement is 1. Max Path in Trees. I is a tree T=(N, P, 0), where 0 infinite? is the root. N=[0, 00, 01, 000, 001, 010, 011, 02, ..., d]. 5. Max Set Packing. I is a collection C of finite sets, represented by pairs (i, j), where the set i contains j. S(T)=[pÄ : pÄ is a path in T]

m1(T, pÄ )=|pÄ | S(C)=[Y C: \A, B # Y (A{BOA&B=<)]

|pÄ | if p1=0 m(C, Y)=|Y|. m 2 ( T , pÄ )= {0 if p1 {0 Max Set Packing . I is a recursive collection of max | [l:1l|pÄ |, \i, pi # N, p1=0, pÄ infinite sets C. Q. Does C contains infinitely many disjoint sets? \i,1i<|pÄ |, (pi, pi+1)#P]|. Min Set Cover 6. . I is a set A=[a1, ..., an] and a set C Max Path in Trees . I is a recursive tree T. of subsets of A. Q. Does T contain an infinite path? This is the non-well-foundedness of recursive trees with S(A, C)=[Y C: \a # A _S # C&Y such that a # S] 1 possibly infinite out-degreethe quintessential 71 -com- plete problem [R]. m((A, C), Y)=|Y|. 2. Max Clique. I is an undirected graph, G=(V, E). Min Set Cover . I is a recursive set A, and a recursive S(G)=[Y: Y V, \y, z # Y (y{zO(y, z)#E)] collection C of subsets of A. Q. Is there a set-covering of A from C, whose complement m(G,Y)=|Y|. is infinite?

4 Max Subgraph Max NSF is the problem of finding the maximum number of satisfiable 7. . I is a pair of graphs, G=(V1, E1) formulas in a given set of CNF formulas. and H=(V2, E2), with V2=[v1, ..., vn].

File: 571J 143207 . By:BV . Date:25:09:96 . Time:14:41 LOP8M. V8.0. Page 01:01 Codes: 5532 Signs: 2844 . Length: 56 pic 0 pts, 236 mm INFINITE VARIANTS OF NP-COMPLETE PROBLEMS 187

S(G, H)=[Y: Y V1_V2, \(u, v), (x, y)#Y(u{x Q. Is there an infinite subset C$ofCthat is an exact cover of X? 7v{y7(u,x)#E1 (v, y)#E2)] 11. Max Ham Path. I is a directed graph G=(V, E), m((G, H), Y)=k iff v , ..., v appear in Y, but v 1 k k+1 V=[v1, ..., vn]. does not appear in Y. S(G)=[yÄ :\i,1i<|yÄ |, yi # V7(yi, yi+1)#E Max Subgraph . I is a pair of recursive graphs, 7\i, j,1i, j|yÄ |, i{jOyi {yj] H and G. m(G, yÄ )=k iff v , v , ..., v # yÄ and v  yÄ . Q. Is H a subgraph of G? 1 2 k k+1 The finite problem is defined so as to yield the desired max | [k: \i,1ik,vi #yÄ 7 \ i ,1i<|yÄ |, (yi, yi+1)#E yÄ V infinite one. Note that if we were to define m((G, H), Y) simply to be |Y|, then Max Subgraph would become the 7\i, j,1i, j|yÄ |, (i{jOyi {yj)]|. problem of finding a common infinite subgraph of H and G. Max Ham Path . I is a recursive graph G. 8. Max Color. I is a graph G =(V,E) with V= Q. Does G contain a Hamiltonian path? [v , ..., v ], and a set C=[c , ..., c ] of colors. 1 n 0 m Max Planar Ham Path and Max Undirected Planar Ham Path are the problems of detecting the existence of a S(G, C)=[yÄ :\i,1i|yÄ |, y # C i Hamiltonian path in directed and undirected planar graphs,

7\i, j|yÄ |((vi,vj)#EOyi{yj)] respectively. Max Sat 12. 2. I is a set of variables U=[_1, c_1, _2, m((G, C), yÄ )=k iff c0 appears k times in yÄ . c_2, ..., _m , c_m] and a collection of clauses represented max |[k: yk=c0 7\i, j|yÄ |((vi,vj)#EOyi{yj)]|. by triples C=[(i, j, _): _#U appears in location j in yÄ C clause I]. Max Color . I is a recursive graph G, and a recursive S(U, C)=[yÄ :\i,1i|yÄ |, _j (i, j, y )#C set of colors. i

Q. Is there a coloring of G in which the first color, c0 , 7\i, j (yi{cyj)] appears infinitely often? m((U, C), yÄ )=|yÄ | 9. Largest Common Subsequence (LCS). I is a finite max| [l:1l|yÄ |, \i,1i|yÄ |, _j (i, j, yi)#C alphabet 7 and a finite set R of strings from 7*: yÄ \ c S(7, R)=[x: \w # R, x is a subsequence of w] 7 i, j (yi{ yj)]|. m((7, R), x)=|x|. (Note. This is not the same as Max Sat from [PY], whose infinite version, as mentioned in Section 1, is trivial.) (Note. ab is a subsequence of cacbc.) Max Sat2 . I is a recursive set of variables, and a LCS . I is an infinite alphabet 7 and an infinite recur- recursive collection C of clauses represented by triples. sive set R of infinite strings over 7|. (Instances can be Q. Is there a truth assignment that satisfies all the clauses represented by triples (i, j, a), where the jth character of the in C? ith string is a. This case is a natural generalization of triple 13. Max Tiling. I is a grid D of size n_n, and a set of representation in the finitary case.) tiles T=[t1, ..., tm]. (We assume the reader is familiar with Q. Is there a common infinite subsequence of all the the rules of tiling problems. See, e.g., [H1].) strings in R? 10. Max Exact Cover by Pairs (Max 2XC; this is S(D, T)=[Y: Y is a legal tiling of some portion of D Perfect Matching essentially ). I is a set X=[x1, ..., x2q], with tiles from T] and a collection C of unordered pairs from X. m((D, T), Y)=k iff Y contains a tiling of a full S(X, C)=[Y: Y C, \c, d # Y (c&d=<)] k_k subgrid of D. m((X, C), Y)=k iff x , ..., x appear (in some pairs) in Y, 1 k Max Tiling . I is a recursive set of tiles T. but xk+1 does not appear in Y. Q. Can T tile the positive quadrant of the infinite integer grid? Max 2XC . I is an infinite set X, and an infinite recur- We now prove that the infinitary versions of these 1 sive collection C of pairs from X. problems are all 71 -complete. From Theorem 1 it will then

File: 571J 143208 . By:BV . Date:25:09:96 . Time:14:41 LOP8M. V8.0. Page 01:01 Codes: 5961 Signs: 3356 . Length: 56 pic 0 pts, 236 mm 188 HIRST AND HAREL

For each Y # S(G), let t2(Y)=[Sj: vj # Y] # S(t1(G)).

For each Z # S(t1(G)), let t3(Z)=[vj: Sj # Z] # S(G). K Proposition . Max Clique Max Subgraph 7 BM . Proof. Let G=(V, E) with |V|=n be an instance of Max Clique . Define g=(t1, t2, t3) as follows: t1(G)= (G, Q), where Q is a clique with n vertices [u1, ..., un].

For each Y=[y1, ..., yk] # S(G), let t2(Y)=[yi,ui): 1ik]. For each Z # S(t1(G)), let t3(Z)=[yi: for each

1 ji,(yj,uj)#Z]. K Proposition . Max Ind Set Max Color 8 BM .

Proof. Let G=(V, E), with V=[v1, ..., vn],bean Max Ind Set instance of . Define g=(t1, t2, t3) as follows: FIG. 1. Scheme of the M-reductions. t1(G)=(G, C), where C=[c0, ..., cn]. follow that the finitary versions must be outside Max 7 .By 1 For each Y # S(G), let t2(Y)=yÄ , where 1 Proposition 2 it suffices to show 71 -hardness, for which we shall exhibit appropriate M-reductions between finitary ver- c0 if vi # Y sions, and employ Theorem 2. yi= {ci if vi  Y. Max Path in Trees 1 First note that is 71 -complete. This is simply Kleene's result (see [R, p. 396]). We now prove all For each yÄ # S ( t 1 ( G )), let t3( yÄ )=[vi:1in, yi=c0]. K 1 the others 71 -hard by exhibiting M-reductions. See Fig. 1. Proposition Min Vertex Cover 9 (Based on [M]). BM Proposition . Max Path in Trees Max Clique 3 BM . LCS. Max Path in Proof. Let T=(N, P, O) be an instance of Proof. Let G=(V, E), where V=[v1, ..., vn] and E= Trees Min Vertex Cover , with m1 as the objective function. [e1, ..., er], be an instance of . Define Define a monotonic reduction g=(t1, t2, t3), as follows: g=(t1, t2, t3) as follows: t1(G)=R, a set of r+1 sequences tl (T)=G=(N, E), where E contains all the edges of T (but over V. R consists of the sequence (v1v2 }}}vn), and for undirected), and edges between node and all its ancestors: each ei=(vj, vm)#E, where j

For each pÄ = (p1, ..., pk) # S(T), let t2( pÄ )=[p1, ..., pk] si=(v1v2 }}}vj&1vj+1 }}}vmv1v2 }}}vm&1vm+1 }}}vn). # S(t1(T)). For each Q # S(t1(T)), let t3(Q)=[q: q # Q] that are ordered according to their distance from the For each Y # S(G), let t (Y)=yÄ , where yÄ is a sequence of the root. K 2 vertices in Y, in ascending order. Now, yÄ # S ( t 1 ( G )) is a Proposition . Max Clique Max Ind Set 4 BM . common sequence, because for each ei=(vj, vm)#E(j

Proof. Let T=(N, P, 0), where N=[0, d1 , d2 , ..., dn], t1(G)=C=[S1, ..., Sn], Max Path in Trees be an instance of , with m2 as the

where Si=[(i, j): (vi, vj)#E]. objective function. Define a monotonic reduction g=(t1, t2, t3), as t1(T)= Max Set Packing Min Set Cover This is for . For let t1(G) G=(X, C), where X=[0, d 1 , d1 , d 2 , d2 , ..., d n , dn], and be C and A=[(i, j): (vi, vj)#E]. C=[(u, v^ ): (u, v)#P]_[(u, u^ ): u{0].

File: 571J 143209 . By:XX . Date:17:09:96 . Time:14:11 LOP8M. V8.0. Page 01:01 Codes: 5800 Signs: 3423 . Length: 56 pic 0 pts, 236 mm INFINITE VARIANTS OF NP-COMPLETE PROBLEMS 189

For each pÄ = (p1, ..., pk) # S(T), let v Instead of the nodes matching all the elements in X,we

insert in the first line only nodes matching elements in S1 . B if p1=0 t2( pÄ )= Each line i will contain nodes matching all the elements that {< if p1 {0, are represented in line i&1, and those that are represented where by fi .

v Every line will appear twice, so that we return to fi+1 B=[( p1 , p^ 2), (p2 , p^ 3 ), ..., ( pk&1, p^ k ) ] from the same side we entered. _ [ ( u , u^ ): uÂpÄ 7 u

Sk were not previously chosen, and passing the last line is v The nodes fi and the two nodes to the right remain the possible only if all the elements in X were already chosen. same. The edges between them are now undirected. We incorporate the following changes in order to make v The following structure, taken from [GJT], replaces the reduction monotonic: each node in the lines of G:

v Instead of one node fi for each set Si , we order the sets in S with repetitions as follows:

S1 , S1 , S2 , S1 , S2 , S1 , S2 , S3 , S1 , S2 , S3 , S1 , S2 , S3 , ....

We then associate a node fi with each element in this sequence. The size of the sequence is O(n3). In this manner one can choose the sets in such a way that the elements

[a1, a2, ..., at] will be covered in order. We also change the internal structure of the nodes (Fig. 8 of [GJS, p. 257]) so This structure forces the path that enters at node a (respec- as to allow a set fi to be chosen only if all the elements that tively, b, c, d), to exit from node b (respectively, a, d, c). are smaller than those in fi were already covered. v Each fi is connected to node a of the leftmost structure 5 A graph is highly recursive if it is recursive, its degree at each node is in its appropriate line and to node d of the rightmost struc- finite, and the function listing a node's neighbors is recursive too. ture in the same line, in order to force the path from left to

File: 571J 143210 . By:XX . Date:17:09:96 . Time:14:12 LOP8M. V8.0. Page 01:01 Codes: 6321 Signs: 4536 . Length: 56 pic 0 pts, 236 mm 190 HIRST AND HAREL

FIGURE 2 right to be along the top portions, and the path from right v The ``copy structure'' (appearing in Fig. 8A of [GJS, to left to be along the bottom portions. p. 257]) is replaced by the following structure: The ``update structure'' (appearing in Fig. 8B of [GJS, v The second line of each fi is connected to the previous v p. 257]) is replaced by the following structure: line and to fi+1, such that the path along this line will be along the top portions in both directions. (Recall that the second line corresponding to each fi is used in order to direct the path to exit from the same side it entered the first line.)

If the path passes from left to right (through the top portions) then this structure is just a ``copy structure.''

File: 571J 143211 . By:XX . Date:17:09:96 . Time:14:14 LOP8M. V8.0. Page 01:01 Codes: 1628 Signs: 752 . Length: 56 pic 0 pts, 236 mm INFINITE VARIANTS OF NP-COMPLETE PROBLEMS 191

Proposition . Max Max Tiling Otherwise (the path passes through the bottom portions) 15 2XC BM . the structure updates, i.e., it requires that the upper ``node'' Proof. Let X=[1, ..., n], and let C be a set of unordered (which is now a structure) was visited already (it means that pairs from X. We construct, monotonically, a tiling problem the appropriate element was not chosen already), and it on the n_n grid, such that there is an exact cover for leaves the bottom node-structure nonvisited, in order to [1, 2, ..., k] in C iff the initial k_k subgrid can be tiled. indicate that this element is chosen. Define g=(t1, t2, t3) as follows: t1(X, C)=T, where T v As before, we allow a set fi to be chosen only if all the contains tiles with indexes (encoding colors) of the form: elements that are smaller than those in fi were already covered. For the appropriate smaller elements we use the j+1 following structure: ii+1 j

This forces each of them to be inserted only in a unique square (i, j). In addition to these indexes, the tiles will con- tain more symbols as

++

for 1i, jn, i{1 (i.e., all the squares, except for the first column). Thus, they will actually appear as:

j+1 + ii+1 + j A part of such a graph thus looks like Fig. 2. We also add symbols of the form Proposition . Max Max Sat 14 2XC BM 2. && Proof. Let X=[d1, d2, ..., dn] be a set, and B be a set of unordered pairs from X. Define g=(t1, t2, t3)as for 1i

t1(X,B)=U=[(x, y), c(x, y), where (x, y)#B]. b We view U as a set of variables, and by the unorderedness ++ we take (x, y) and ( y, x) to be equal. The sequence of b clauses C is obtained by juxtaposing, in the order listed, the clauses in the following set: for 1b, i, jn, j{b, i{1 (i.e., all squares except the bth row and the first column). C=[C1, C1$ , C2 , C2$ , ..., Cn , Cn$], b where, for each 1in, && b Ci=  (di,x) (d i , x)#B for 1bn,1i

_[c(di,x)6c(y,x)|y{diand (di , x)#Ci a

The clause Ci forces a choice of some pair containing di , and the set of clauses Ci$ , forbids double choices of an element. for i=j=a (this will be a candidate for square (a, a)). Now, for each Y # S(X, B) which is a cover for

[d1, ..., dk], we let t2(Y)=yÄ , where yÄ contains the variables &+ satisfying the clauses in [C1, C1$ , ..., Ck , Ck$]. For each b yÄ # S(t1(X, B)), we let t3( yÄ ) contain those pairs (di , dj) that denote the variables satisfying clauses [C1, C2, ..., Ck]. K for i=a, j=b (a candidate for square (a, b)).

File: 571J 143212 . By:XX . Date:17:09:96 . Time:14:14 LOP8M. V8.0. Page 01:01 Codes: 5254 Signs: 2569 . Length: 56 pic 0 pts, 236 mm 192 HIRST AND HAREL

For each Y C which is an exact cover for [1, ..., k], isomorphism. Here is a brief summary of our findings for t2(Y) is the following tiling: for each (a, b)#C, where a

&+ [AMS] R. Aharoni, M. Magidor, and R. A. Shore, On the strength of Konig's duality theorem, J. Combin. Theory Ser. B 54, No. 2 (1992), 257290. The reduction is monotonic, since an addition of sets to C [ALMSS] S. Arora, C. Lund, R. Motwani, M. Sudan, and M. Szegedy, Proof verification and hardness of approximation problems, in will cause only the addition of tiles to T. K ``Proceedings, 33rd IEEE Conf. on Found. of Comput. Sci.,'' Example. C=[(1, 3), (2, 4), (1, 4)], D=[1, 2, 3, 4]. Pittsburgh, PA, 1992. [AS] S. Arora and S. Safra, Probabilistic checking of proofs, in The tiling is: ``Proceedings, 33rd IEEE Conf. on Found. of Comput. Sci.,'' Pittsburgh, PA, 1992. [BG1] R. Beigel and W. I. Gasarch, On the complexity of finding the chromatic number of a recursive graph, I, II, Ann. Pure Appl. Logic 45 (1989), 138, 227247. [BG2] R. Beigel and W. I. Gasarch, unpublished results, 19861990. [BJY] D. Bruschi, D. Joseph, and P. Young, ``A Structural Overview of NP Optimization Problems,'' Technical Report 861, Department of Computer Science, University of Wisconsin, Madison, 1989. [F] R. Fagin, Generalized first-order spectra and polynomial-time recognizable sets, in ``Complexity of Computations'' (R. Karp, Ed.), SIAM-AMS Proceedings, Vol. 7, SIAM, Philadelphia, . 4373, 1974. [GJ] M. R. Garey and D. S. Johnson, ``Computers and Intrac- tability: A Guide to the Theory of NP-Completeness,'' Freeman, San Francisco, 1979. [GJS] M. R. Garey, D. S. Johnson, and L. Stockmeyer, Some simplified NP-complete graph Problem, Theor. Comput. Sci. 1 (1976), 237267. [GJT] M. R. Garey, D. S. Johnson, and R. E. Tarjan, The planar Hamiltonian circuit problem is NP-complete, SIAM J. Comput. 5, No. 4 (1976), 704714.

Note. Two additional graph problems of interest, that 6 ``Proceedings, 8th IEEE Structure in Complexity Theory Conf.,'' have not been dealt with in [BG2], are planarity and graph pp. 292304, IEEE Press, New York, 1993.

File: 571J 143213 . By:XX . Date:17:09:96 . Time:14:15 LOP8M. V8.0. Page 01:01 Codes: 5203 Signs: 3439 . Length: 56 pic 0 pts, 236 mm INFINITE VARIANTS OF NP-COMPLETE PROBLEMS 193

[H1] D. Harel, Effective transformations on infinite trees, with [LM] M. E. Leggett and J. Moore, Optimization problems and the applications to high undecidability, domains, and fairness, poly-nomial time hierarchy, Theor. Comput. Sci. 15 (1981), J. Assoc. Comput. Mach. 33 (1986), 224248. 279289. [H2] D. Harel, Hamiltonian paths in infinite graphs, Israel J. Math. [M] D. Maier, The Complexity of problems on subsequences and 76 (1991), 317336; preliminary version in ``Proceedings, 23rd supersequences, J. Assoc. Comput. Mach. 25 (1978), 322336. ACM Symp. on Theory of Computing,'' pp. 220229, ACM [Mo] A. S. Morozov, Functional trees and automorphisms of Press, New York, 1991. models, Algebra and Logic 32 (1993), 2838. [K] R. M. Karp, Reducibility among combinatorial problems, in [PR] A. Panconesi and D. Ranjan, Quantifiers and approximation, ``Complexity of Computer Computations'' (R. E. Miller and Theor. Comput. Sci. 107 (1993), 145163. J. W. Thatcher, Eds.), pp. 85103, Plenum, New York, 1972. [PY] C. H. Papadimitriou and M. Yannakakis, Optimization, [KT] P. G. Kolaitis and M. N. Thakur, Logical definability of NP approximation, and complexity classes, J. Comput. System Sci. optimization problems, in ``6th IEEE Conf. on Structure in 43 (1991), 425440. Complexity Theory, 1991,'' pp. 353366. Inform. and Comput., to [R] H. Rogers, ``Theory of Recursive Functions and Effective appear. Computability,'' McGrawHill, New York, 1967.

File: 571J 143214 . By:BV . Date:25:09:96 . Time:14:37 LOP8M. V8.0. Page 01:01 Codes: 2348 Signs: 1586 . Length: 56 pic 0 pts, 236 mm