G 2(X) X SOLVABILITY OF GRAPH INEQUALITIES. 1. A simple graph inequality. Consider the diagram in Figure 1.

Similar documents
DECOMPOSING 4-REGULAR GRAPHS INTO TRIANGLE-FREE 2-FACTORS

NP and NP-Completeness

Lecture 1. 1 Overview. 2 Maximum Flow. COMPSCI 532: Design and Analysis of Algorithms August 26, 2015

THE MINIMUM MATCHING ENERGY OF BICYCLIC GRAPHS WITH GIVEN GIRTH

Lecture Notes 4. Issued 8 March 2018

An Explicit Lower Bound of 5n o(n) for Boolean Circuits

arxiv: v1 [cs.dm] 21 Oct 2017

Optimization Problems in Multiple Subtree Graphs

1 Computational Problems

Lecture 14 - P v.s. NP 1

Planar Ramsey Numbers for Small Graphs

Lecture 2: Connecting the Three Models

Notes for Lecture Notes 2

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Turing Machines Part III

Chromatic characterization of biclique cover. Denis Cornaz. Jean Fonlupt. Equipe Combinatoire, UFR 921, Universite Pierre et Marie Curie, 4 place

The Budgeted Minimum Cost Flow Problem with Unit Upgrading Cost

Theory of Computation

Chapter 4: Computation tree logic

CS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT

arxiv: v1 [math.co] 28 Oct 2016

On diamond-free subposets of the Boolean lattice

CS 6505, Complexity and Algorithms Week 7: NP Completeness

Integer Parameter Synthesis for Real-time Systems

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

6.1 The Pumping Lemma for CFLs 6.2 Intersections and Complements of CFLs

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza

Introduction to Turing Machines. Reading: Chapters 8 & 9

A spectral Turán theorem

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

4 CONNECTED PROJECTIVE-PLANAR GRAPHS ARE HAMILTONIAN. Robin Thomas* Xingxing Yu**

arxiv: v1 [math.co] 10 Jun 2018

Paths and cycles in extended and decomposable digraphs

ACYCLIC WEAK CONVEX DOMINATION IN GRAPHS

3515ICT: Theory of Computation. Regular languages

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

Announcements. Friday Four Square! Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Did you lose a phone in my office?

arxiv: v3 [math.co] 20 Sep 2016

Peter Wood. Department of Computer Science and Information Systems Birkbeck, University of London Automata and Formal Languages

Introduction to Complexity Theory. Bernhard Häupler. May 2, 2006

The optimal pebbling number of the complete m-ary tree

3130CIT Theory of Computation

Long Monochromatic Cycles in Edge-Colored Complete Graphs

Computational Models: Class 3

Parikh s theorem. Håkan Lindqvist

Lecture 6: Graphical Models

Design and Analysis of Algorithms

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1

Geometric Steiner Trees

A MODEL-THEORETIC PROOF OF HILBERT S NULLSTELLENSATZ

arxiv: v1 [math.co] 13 May 2016

The Evolution of Grötzsch s Theorem

arxiv: v1 [cs.ds] 2 Oct 2018

arxiv: v1 [math.co] 25 Apr 2016

The Complexity of Maximum. Matroid-Greedoid Intersection and. Weighted Greedoid Maximization

Linear Temporal Logic and Büchi Automata

Berge Trigraphs. Maria Chudnovsky 1 Princeton University, Princeton NJ March 15, 2004; revised December 2, Research Fellow.

Tree-width and planar minors

NP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch]

CPSC 421: Tutorial #1

arxiv: v1 [math.gt] 2 Nov 2010

Section 14.1 Computability then else

The efficiency of identifying timed automata and the power of clocks

CSCI3390-Lecture 18: Why is the P =?NP Problem Such a Big Deal?

Perfect matchings in highly cyclically connected regular graphs

Theory of Computation

Finish K-Complexity, Start Time Complexity

Lecture J. 10 Counting subgraphs Kirchhoff s Matrix-Tree Theorem.

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions

Tuples of Disjoint NP-Sets

Computational Models - Lecture 3

Automata, Logic and Games: Theory and Application

Chords in Graphs. Department of Mathematics Texas State University-San Marcos San Marcos, TX Haidong Wu

CS 275 Automata and Formal Language Theory

On the intersection of infinite matroids

Non-emptiness Testing for TMs

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65

Balanced Partitions of Vector Sequences

COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II , Max 80, Time 2 hr. Name Entry No. Group

VC-DENSITY FOR TREES

arxiv: v2 [math.co] 19 Jun 2018

ECS 120 Lesson 20 The Post Correspondence Problem

Primitive recursive functions: decidability problems

Approximation Algorithms

An algorithm to increase the node-connectivity of a digraph by one

CS6901: review of Theory of Computation and Algorithms

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Informal Statement Calculus

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete

Lecture 8: Construction of Expanders

CS3719 Theory of Computation and Algorithms

20.1 2SAT. CS125 Lecture 20 Fall 2016

Finding Paths in Grids with Forbidden Transitions

Patterns of Non-Simple Continued Fractions

Decentralized Control of Discrete Event Systems with Bounded or Unbounded Delay Communication

Math 144 Activity #9 Introduction to Vectors

Graph coloring, perfect graphs

Space and Nondeterminism

Transcription:

SOLVABILITY OF GRAPH INEQUALITIES MARCUS SCHAEFER AND DANIEL ŠTEFANKOVIČ Abstract. We inestigate a new type of graph inequality (in the tradition of Cetkoić and Simić [Contributions to Graph Theory and Its Applications, Technische Hochschule Ilmenau, Ilmenau, Germany, 977, pp. 40 56] and Capobianco [Ann. New York Acad. Sci., 39 (979), pp. 4 8]) which is based on the subgraph relation and which allows as terms fixed graphs, graph ariables with specified ertices, and the operation of identifying ertices. We present a simple graph inequality that does not hae a solution and show that the solability of inequalities with only one graph ariable and one specified ertex can be decided (in nondeterministic exponential time). The solability of graph inequalities oer directed graphs, howeer, turns out to be undecidable.. A simple graph inequality. Consider the diagram in Figure. G () G 2() Fig.. A graph inequality G () G 2 (). Is there a solution to this inequality? More precisely, is there an undirected graph with a ertex such that if we construct a graph G 2 () by taking two copies of and connecting their ertices by an edge, and a graph G () by adding two new ertices to and connecting them with, then G () occurs as a subgraph of G 2 ()? A moment s reflection will show that the answer is yes: Take to be a path of length two together with an isolated ertex. What happens if we restrict ourseles to connected graphs? Again the answer is yes: Take a rooted infinite ternary tree and connect its root by an edge to a new ertex. What about finite and connected School of CTI, DePaul Uniersity, 243 S. Wabash Ae., Chicago, IL 60604 (mschaefer@ cs.depaul.edu). Department of Computer Science, Uniersity of Chicago, 00 East 58th St., Chicago, IL 60637 (stefanko@cs.uchicago.edu).

graphs? the patient reader will ask. The answer in this case is no, there is no finite, connected graph fulfilling the inequality in Figure, and this is the main result of this section. Theorem.. There is no connected, finite solution of the Figure inequality. A simpler ersion of this theorem (for finite trees) was used in the first author s thesis [Sch99, Sch0] to determine the computational complexity of the arrowing relation in graph Ramsey theory: deciding F (T,K n ) is complete for the second leel of the polynomial-time hierarchy (where F is a finite graph, T is a finite tree of size at least two, and K n is the complete graph on n ertices). Graph equations (more so than graph inequalities) hae been studied for a while, and there are two surey papers dating back to the late 970s [CS77, CS79, Cap79]. The equalities and inequalities considered in these papers are more general in that they allow arbitrary operations on graphs such as complementation, tensor products, and squaring. Capobianco, Losi, and Riley, for example, showed that there are no (nontriial) trees whose square is the same as their complement [CLR89]. The more general question of which graphs fulfill G 2 = G is still open [BST94], but it is known that the equation has infinitely many solutions [CK95]. We conclude this section with a proof of Theorem.. Section 2 contains a generalization of this result: The solability of graph inequalities with only one ariable haing one specified ertex can be decided. In section 3 we show that a natural generalization of graph inequalities leads to an undecidable solability problem. Section 4 contains stronger results for graph inequalities oer directed graphs: While the solability of directed graph inequalities with only one ariable and one specified ertex remains decidable, we can show that the solability of directed graph inequalities is undecidable (een with at most three ariables and two specified ertices for each ariable). Before we begin the proof we introduce some standard notation [Die97]. We write G =(V,E) for a graph G with ertex set V = V (G) and an edge set E = E(G). The edge between ertices u, V is written as (u, ). The order of a graph is defined as V (G), and the size G is defined as E(G). A graph is finite if it has finite order and connected if there is a path between any two of its ertices. Proof of Theorem.. Let be a minimal solution of the inequality. Denote the copies of in G 2 () by i, i =, 2. An element of is either its edge or ertex. Gien an element x of, we denote the corresponding element of i by x i. Let φ be the embedding of G () intog 2 (). Clearly (, 2 ) Im φ, since otherwise G () would map into or 2. Assume that there is an edge e such that neither e nor e 2 is in Im φ. Let Y be the connected component of {e} containing. From the connectedness of G () it follows that Im φ G 2 (Y ). Now the restriction of φ to G (Y ) is an embedding of G (Y )intog 2 (Y ), contradicting the minimality of. Thus for eery e either e or e 2 is in Im φ. Note that this implies that for eery ertex u either u or u 2 is in Im φ. Let Y i be the subgraph of corresponding to Im φ i (as a subgraph of i ). Then for each e either e Y or e Y 2. We know that () (2) (3) Y Y 2 =, V (Y ) + V (Y 2 ) = V (Im φ) = V (G ()) = V () +2, E(Y ) + E(Y 2 ) = E(Im φ) = E(G ()) = E() +. The first equality in (3) follows from the fact that (, 2 ) Im φ, but (, 2 ) Im φ

Im φ = u Y Y u u 2 2 Imφ 2 = Y 2 Y 2 G () Im o Fig. 2. Im φ and G (). ( 2 ). From (), (2), (3) we conclude that V (Y Y 2 ) = 2 and E(Y Y 2 ) =, which implies that the intersection of Y and Y 2 is a single edge f. We know that V (Y ) V (Y 2 ), and hence f =(, u) for some u V (). Figure 2 illustrates the situation. Let a i be the number of ertices from V (Y i ) \{u, } which hae degree in. Let b beifu has degree in and 0 otherwise. The number of ertices of degree ing () isa + a 2 + b + 2. The number of ertices of degree in Im φ is at most a + a 2 + b +. Hence Im φ and G () are not isomorphic, a contradiction. 2. Decidability of graph inequalities. We could now start considering all kinds of diagrams inoling graphs, ertices, edges, and the subgraph relationship. How hard is it to settle these questions? In this section we will show that the solability of graph inequalities of the type presented in the preious section, i.e., haing only one graph ariable with one specified ertex, is decidable. This will follow from an (exponential) upper bound on the size of a minimal solution (if there is one). This result will be complemented by the undecidability result of the next section. Let us formalize the question. A graph ariable with a set of specified ertices,..., m represents an unknown finite, connected graph whose ertex set includes ertices,..., m. Gien seeral graph ariables,..., n and a graph G, we can construct a graph term G(,..., n ) (called gterm) by taking seeral copies of each i and identifying some specified ertices of the copies with some ertices of G. Since we are working with connected graphs we require G(,..., n ) to be connected (for any assignment of connected graphs to,..., n ). Note that G itself does not hae to be connected and that if G(,..., n ) is connected for some assignment of connected graphs to,..., n, then it is connected for all assignments. Gien two such gterms G (,..., n ), G 2 (,..., n ), we can ask whether there exists an assignment of connected finite graphs to the ariables,..., n such that G (,..., n ) is a subgraph of G 2 (,..., n ). We call a question of this type a graph inequality. For the rest of this section we will consider the simplest possible case of a graph inequality: only one ariable,, with one specified ertex. Let G () be a gterm

G () H G () 2 F [] i i 2 [2] i [ ] () 2 (2) k (k) Fig. 3. Inequality G () G 2 (). consisting of a connected graph H and a copy of attached with to each ertex of a multisubset I = {i,...,i l } of ertices of H. Similarly construct G 2 () from a connected graph F and a multisubset J = {,..., k } of ertices of F. The copy of in G 2 () attached to r ( r k) is called (r), and the copy of in G () attached to i r ( r l) is called [r]. If there is only one copy of in G (), we call it. Theorem 2.. If the inequality in Figure 3 has a solution, then it has a solution of size at most F ( + k) H. The upper bound on the size of a minimal solution is exponential in the size of the equality; hence to decide solability we ust hae to test all graphs up to that size, something which can be done in nondeterministic exponential time (NEP). Corollary 2.2. The solability of graph inequalities of the type in Figure 3 can be decided in NEP. We do not know the precise computational complexity of the decision problem. It is at least NP-hard, since we can ask whether a graph contains a clique. At the core of the proof are Lemmas 2.5 and 2.7, which show that for a minimal solution to the graph inequality (if it exists) we can assume that all of the ertices of I are mapped to ertices of F. This reduces the problem to a simpler ariant (namely, the images of ertices from I are prescribed) dealt with by Lemma 2.4 (based on the representation result of Lemma 2.3). First we characterize solutions of inequalities (with prescribed mapping) where on the left-hand side there is only one copy of and has to map to a ertex w of F on the right-hand side. If w J, then any connected graph is a solution. Now assume w J. Let Σ be the alphabet consisting of the numbers,...,k. For each word α from Σ take a copy F (α) of F. For eery α Σ and a Σ identify w (αa) and a (α). The resulting infinite graph is called F (see Figure 5). Lemma 2.3. Assume that w J = {,..., k }. Then the solutions of the inequality in Figure 4 are precisely the subgraphs of F with = w () such that (4) for any edge e in F, any α Σ, a Σ, if the edge e (aα) is in, then e (α) is in. Proof. If is a subgraph of F satisfying condition (4), then is a solution of the inequality ia mapping φ: φ(x () )=x,

w F () 2 k (2) (k) Fig. 4. Inequality G 2 (), w. () w F () () () = = w () (k) k w () = () w F () F (k) (k) = (kk) k w () (k) (k) =w =w k (k) Fig. 5. F. φ(x (aα) )=x (α) (a). If is a solution of the inequality ia mapping φ : G 2 (), then define Y () = φ (F ), Y (aα) = φ (Y (α) (a) ), where Y (α) (a) is the copy of Y (α) in (a) in G 2 (). If e is an edge of with distance d from, then it must map either to F or to some edge f in some (r) which has strictly smaller distance from (r) than d. Edges adacent to must be mapped to F, and hence they are in Y (). By induction it follows that = Y (α). α Σ Clearly Y (α) is a subgraph of F ia φ α + for any α Σ. The element of Y (α) corresponding to x F is called x (α). By induction it follows that w (αa) = a (α) for any α Σ, a Σ. From the definition of Y s, if e (aα) is in, then the edge e (α) is also in for any α Σ,a Σ. Hence is a subgraph of F satisfying (4).

Soling systems of simple graph inequalities is useful in soling more complicated inequalities. Lemma 2.4. If a system of inequalities with prescribed mappings (5) (6) H, h ;...; H m, h m, F (), w ;...; F n (), w n has a solution, then it has a solution of size at most F ( + k ) M, where k is the number of copies of in F and M := max{ H,..., H m }, assuming that the graphs H,...,H m are connected. Proof. Let be a minimal solution of the system. Let e be an edge of whose distance d from is maximal. Assume that d>m. If we remoe the edge e, then = {e} still satisfies inequalities (5), because no edge of any H i ( i m) can map to e. If satisfies the inequality in Figure 4 for F = F i ( i n), then by Lemma 2.3 it is a subgraph of F with = w () and it satisfies condition (4). Let e = f (α). Clearly is also a subgraph of F and the condition is still satisfied, because dist(, f (aα) ) > dist(, f (α) ) and hence f (aα) for any a Σ. Therefore satisfies inequalities (6), a contradiction to the minimality of. Thus dist(, e) M. The size of the subgraph of F consisting of edges within distance M from is bounded by F ( + k ) M. Now we return to the inequality in Figure 3. Lemma 2.5. If there is more than one copy of on the left side of the inequality in Figure 3, then eery i r = [r] ( r l) must map to a ertex of F. Proof. Suppose, for example, that i maps into some (r) { r }. Let P be a path from i to i 2. Graphs [] and [2] P share only ertex i. Hence the image of at least one of them does not contain r and since r is a cutertex of G 2, that image must be contained in (r) { r }, which is impossible, since there are more ertices in or in 2 P than in (r) { r }. Lemma 2.6. If is a solution of the inequality in Figure 3 ia mapping ψ : G () G 2 (), then there exists a mapping φ : G () G 2 () such that φ(i) = ψ(i) and as many copies of in i as possible are mapped to copies of in φ(i) for eery i I. Proof. Consider a bipartite graph B with partitions I and J, where i r is connected to s if and only if ψ(i r )= s. Without loss of generality assume that {(i r, r ); r t} is a maximal matching of B. We need to show that there exists φ such that [r] maps to (r) for r t. Let Y,...,Y q be the connected components of {}. Let φ be a mapping such that t q φ(y [r] ) Y (7) (r) is maximal. If for some r,, r= = φ ( Y ) [r] Y (r), then clearly φ(y [r] ) Y (r) = ; otherwise φ(y [r] ) would hae to contain r. Now we will be mapped to Y(r) and φ (Y (r)) will be ). This increases the alue of (7), a contradiction. Hence φ maps can change φ in such a way that Y [r] mapped to φ(y [r] [r] to (r) ( r t).

8K H F () 2 k (2) (k) Fig. 6. We proe an analogue of Lemma 2.5 for inequalities where occurs only once on the left-hand side of the inequality in Figure 3. Lemma 2.7. If the inequality in Figure 6 has a solution, then it has a solution ia a mapping φ which maps = i to a ertex of F. Proof. Suppose that there is no solution of the inequality in Figure 6 such that maps to a ertex of F, but there is a solution in which maps into a ertex of () { }. Then clearly the inequality in Figure 7 with the additional condition that must map to some u () has a solution (see Figure 7). H F = () u 2 k () K 8 Fig. 7. If u =, then by Lemma 2.6 there is φ such that is mapped to (). Therefore we can replace K s in the inequality in Figure 7 by K H s, since only H is mapped to G 2 () (). This, howeer, implies that = K H is a solution of the inequality in Figure 6 in which maps to a ertex of F, a contradiction. Thus u for eery solution of the inequality in Figure 7. Let be a minimal solution of this inequality. Graphs H and share only ; moreoer is a cutertex of G 2 and hence either H or must be mapped inside () { }. Since the latter is not possible, H must be mapped inside () { }.

8K 8K () H Y () q () q F Y q Z () Z 2 k Fig. 8. Now let Y = φ ( ) ( () and Z = φ G 2 () ( () { }) ). The common ertex of Y and Z is called q = φ ( ). The inequality in Figure 7 implies the inequalities in Figure 8. The second inequality follows directly from the definition. To see the first inequality, note that the graph on the left-hand side is a subgraph of () with q mapping to (), and that by definition of Y and Z the right-hand side contains () with () of () mapping to of Y. If in the first inequality was mapped outside of Y (), then the shortest path from q to would hae to map to a longer path, which is not possible. Hence maps inside Y (). Combining the two inequalities in Figure 8, we get that Y satisfies the inequality in Figure 7. This contradicts the minimality of. We can now complete the proof of Theorem 2. by showing a bound on the size of a minimal solution (if there is one) of graph inequalities with one ariable and one specified ertex. Proof of Theorem 2.. From Lemmas 2.5 and 2.7 it follows that we need to consider only solutions in which eery i r ( r l) maps to a ertex of F. For each such mapping φ, using Lemma 2.6, we can assume that if i I maps to a ertex J, then as many copies of in i as possible map to copies of in. Let (8) G () G 2(), = i φ (i ),...,i l φ (i l ) be the inequality with prescribed mappings obtained by remoing those [r] s and (r) s which are already taken care of by Lemma 2.6. Notice that now no i r, ( r l ) maps to a s ( s k ). Let be a solution of (8) with mapping ψ. If ψ ( [r]) (s), then some ertex from [r] {i r} must map to s. Since s is a cutertex, no other part of G ( ) can map to (s). If for each [r], r l, and H we take the set of obects (edges and (s) s) to which it is mapped, then these sets are disoint. There are only finitely many partitions of the obects of G 2() intol + disoint sets. For each such partition we get a system of inequalities with prescribed mappings as in Lemma 2.4, which has a solution of size at most F ( + k) H (if it has one). Note that by using preious lemmas we can easily proe Theorem.. If there was a solution of the inequality in Figure, then by Lemma 2.7 there is a solution

such that from G () maps to one of the s in G 2 (). By looking at the degrees of s we see that this is not possible. We conclude this section with a technical result that allows us to combine seeral inequalities with prescribed mappings. This lemma will be needed in the next section. Lemma 2.8. For any system of inequalities with prescribed mappings H, h ;...; H m, h m, F (), w ;...; F n (), w n, there is a single inequality which has the same set of solution as the system. Proof. Consider the inequality in Figure 9. H H m a 0 a t/2 a t- a t b 0 b t/2 F () F () n b t- b t Fig. 9. By Lemma 2.5, a 0 and a t hae to map to F. Clearly the a 0,a t path of H in G () has to map to a path in F in G 2 (). If t>2(m + n + max{f,...,f n }), then the only path of length t in F is the b 0,b t path. It follows that a i maps to b i (0 i t) because a t cannot map to a. Hence is a solution of the inequality in Figure 9 if and only if it is a solution of the system. 3. Undecidability of graph inequalities. The result of the last section might suggest that there is a general method to decide the solability of graph inequalities. While we hae to leae this question open for the time being, we do want to sketch a proof that a natural generalization of the problem turns out to be undecidable. We consider a logical language whose atoms are graph inequalities as aboe, i.e., diagrams inoling graphs with labeled ertices, additional edges and ertices, and one occurrence of the subgraph relationship. We then build more complex formulas by allowing logical operators (and) and (not) and quantifiers oer graphs (and labeled ertices). We will not formally describe the semantics of this language since it is straightforward; the only point worth mentioning is that we assume ertices with different labels in the same graph to be different. We will next show that formulas of this type are not decidable. More precisely we will show that this is een the case if we restrict the quantifiers in the formulas to be only existential or bounded (i.e., of the form ( F G) or( F G)). Since formulas inoling only bounded quantifiers are decidable (the bounds hae to be explicit graphs; hence we can try all possible combinations), this is a reasonably sharp result on the complexity of graph inequalities. The main open problem of interest, of course, is whether the problem is undecidable in case we allow only existential quantifiers (and no bounded quantifiers at all). We will mention some interesting related problems in the conclusion. Theorem 3.. The solability of graph diagrams with Boolean operators, existential quantifiers, and bounded quantifiers is not decidable.

w Fig. 0. Representing the word 230. Proof. We will show the undecidability of the solability problem by reducing the word problem for semi-thue systems to it (see, for example, [HU79]). Oer an alphabet A, a semi-thue system is a set of productions x y (x, y A ), meaning that x can be transformed into y. The word problem for a semi-thue system is to decide whether, gien two words x and y, there is a series of productions which, when applied to substrings of the words, transforms x into y. We will represent the letters of the alphabet as paths of different lengths. A word will be coded as a path to which are attached further paths coding the letters of the word. A sequence of words will be coded in a similar way. We will then hae to find a way to erify that such a sequence results from legal applications of the productions. Fix a semi-thue system (x i y i ) i n oer some alphabet A, and suppose we are gien two words x and y. The following diagram gies an example of how we represent words, in this case the word 230 (Figure 0). The initial ertex w is used to link the word up in a sequence of words. In the manner depicted by the diagram we associate graphs i,y i,, and Y with the words x i,y i,x, and y. Assume that for all A G the following diagram (Figure ) is true. A G Fig.. Forcing a tree. Then G does not contain any cycles and therefore is a tree. Furthermore, by excluding K,4 we can easily assure that G has maximal degree at most 3. We now set up G to code the initial and final words. We do this by saying that there is an A G which fulfills the diagram in Figure 2. Note that for the diagram to be true w has to be mapped to u and w Y to (G is a tree). Hence G will contain a path from u to. For each ertex w on that path let G w be the graph attached to the path (if none, then G w is ust w). With the preious diagram we hae ensured that G w codes x and G wy codes y. Now we hae to erify only that the transitions between words as coded by G are legal according to the system of productions gien. We do this by saying that for any A, B, C, D G for which the diagram in Figure 3 is true, there are S, E, B,C G for which the diagram in Figure 4 is true, and such that B = i and C = Y i for some i n. It is straightforward to check that in this manner we hae encoded the original

w w Y A = Y u G Fig. 2. Forcing x and y. u A B C = u G 2 2 D Fig. 3. Transition from B to C. B = S B E and C = S C E Fig. 4. Application of production B to C. word problem: There is a G fulfilling all these conditions if and only if there is a solution to the word problem. Hence the word problem can be written as a graph inequality with one existential quantifier and some bounded quantifiers. 4. Directed graph inequalities. So far we hae considered only undirected graphs. What happens if we change the unierse of graph inequalities to directed (or colored) graphs? Call these ariants directed (or colored) graph inequalities, respectiely.

In the case of one ariable with one specified ertex we can obtain the same result as in Theorem 2.. As a matter of fact, the lemmas and proofs needed for that theorem can be used without modification. Theorem 4.. For directed (or colored) graphs, if the inequality in Figure 3 has a solution, then it has a solution of size at most F ( + k) H. As aboe, this implies that the problem is decidable in NEP. The complexity of the undecidability proof in section 3 stemmed from the difficulty of coding the alphabet: We had to use special deices to code letters and then use bounded quantifiers to erify that the coding was correct. Allowing the edges in the graph to be directed, howeer, makes these constructions unnecessary. Theorem 4.2. The solability of directed (colored) graph inequalities is undecidable. The problem remains undecidable een if we limit it to three ariables with two specified ertices each. We consider only directed graphs, since the treatment for graphs with two colors is identical. Proof. We will translate Post s correspondence problem (PCP) into a directed graph inequality. Since the former problem is known to be Turing-complete [HU79], this shows the undecidability of directed graph inequalities. PCP asks whether, gien a list of pairs of words (p i,q i ) i n, there is a list of indices i,...,i m such that p i p im = q i q im. PCP can be translated into a question about context-free grammars as follows: Consider two grammars (i) S i S p i i p i ( i n), (ii) S 2 i S 2 q i i q i ( i n), where i is a prefix-encoding of the number i. The original problem has a solution if and only if the two grammars hae a word in common, i.e., there is a word w such that S w and S 2 w. Consider a context-free grammar with productions oer the alphabet {0, } and one nonterminal symbol S. Eery production has S on the left-hand side and a (nonempty) string of letters and at most one occurrence of S on the right-hand side. We will code 0 s and s by the direction of edges, an outgoing edge coding a 0 (for a string starting in the ertex) and an incoming edge coding a. Let G a be the path corresponding to the string a (for an example, see Figure 5). Fig. 5. G 000. A production is either of the form S asb, where ab {0, } +, or of the form S a, where a {0, } +. We assume that there is always a production of the second kind. Construct a graph inequality as follows: The left-hand side contains a graph ariable S with two special ertices u S and S. The right-hand side has two special ertices u S and S. For eery production of the form S asb, include G a starting in u S and ending in the u S ertex of a new copy of S, and G b starting in the S ertex of S and ending in S. For eery production of the form S a, include G a starting in u S and ending in S. If we require that u and be mapped to u and, respectiely, then a solution to the inequality corresponds to a word in the language described by the grammar, and, ice ersa, eery word in the language gies rise to a solution of the graph inequality.

S S S S Fig. 6. Graph inequality for semi-thue system. For an example, see Figure 6, which shows the graph inequality belonging to the system S 0S00 0S S00 000 0 00. We will first proe the claim that for eery word in the language there is a corresponding solution of the graph inequality in a stronger form: For each n there is a graph G S such that (i) G S soles the inequality (with u, mapping to u, ) and (ii) there is a path G w between u S and S in G S for eery word w that can be deried in n steps from S. We proe this statement by induction on n. Forn = let G S consist of all paths G a for which S a is a production, and identify their starting ertices (calling it u S ), and their end ertices (calling it S ). For the induction step, assume we hae a graph G S with ertices u S and S fulfilling the induction hypothesis for n. Build G S with ertices u S and S by including for each production S asb (new) copies of G a, G S, and G b, and by identifying u S with the starting ertex of G a, u S with the ending ertex of G a, S with the starting ertex of G c, and S with the ending ertex of G c. It is easy to show by induction that the graphs so constructed fulfill (i) and (ii). For the other direction suppose that there is a solution G S to the graph inequality. We will show that for any path P from u S to S in G S there is a word w such that S w and P = G w. Use induction on the length of the path: Let P be a path of minimal length between u S and S for which the assertion has not yet been proen. P has length at least one (since u S and S are different ertices). Fix w such that P = G w. Since G S fulfills the inequality, P must be a subpath of the right-hand side of the inequality starting in u S and ending in S. The way the right-hand side was constructed, P must therefore be a subpath in a graph corresponding to a particular production S asb, ors a. In the latter case, a = w and we are done. In the former case, P consists of three parts corresponding to a, S, and b, respectiely. Since a and b together hae length at least one, we can apply the induction hypothesis to the subpath of P corresponding to S. If we are gien two grammars G, G 2, we can construct the inequalities for them as aboe and ask whether there exist graphs fulfilling them, as well as a path P from u P to P which is a subgraph of both S and S2, where u P and P hae to be mapped to u Si and Si (i =, 2). Such a path corresponds to a word w which can be deried in both grammars. We are left with the task of combining the inequalities

G G G u G G G G G G G G G G u Fig. 7. G G. into a single inequality fulfilling the additional requirements on the u and ertices. Consider the directed graph inequality of Figure 7. We claim that if G and G are solutions of this inequality, then G is a subgraph of G such that u and are mapped to u and, respectiely (and, obiously, any such graphs are solutions to the inequality). To see this, suppose that one of the ertices at the heart of a sunflower does not map to its corresponding ertex. It then has to map to a labeled ertex, or into a G or G, sayg. This is not possible, since such a ertex is at the heart of three copies of G, at most two of which can map outside the G, so there would hae to be a full copy of G within G, which is impossible. Hence the hearts of the sunflowers map to each other, and, in consequence, the copies of G map to the corresponding copies of G, while u and map to u and. We hae four equations altogether: G Si G i (with G i the right-hand sides constructed from the grammars) and G P G Si (i =, 2). We can extend the diagram aboe to incorporate all four inequalities: It will contain fie sunflowers on each side of the inequality, between which the terms of the four inequalities are linked up; each sunflower will hae three copies of each graph inoled in the construction, and hence the hearts of the sunflowers map to each other, as aboe. Thus we get a single directed graph inequality which has a solution if and only if the two grammars hae a word in common. 5. Conclusion. Seeral questions remain open, the most nagging one being the complexity of deciding the solability of (undirected) graph inequalities (without additional quantifiers and Boolean operators). It seems hard to translate the corresponding undecidability result for directed graph inequalities back to the undirected case. Another approach would be to strengthen the proof of the undirected undecidability result, which required one existential quantifier and seeral alternations of bounded quantifiers. It seems likely that by using a different problem for the reduction (for example, PCP) one might get the language down to existential and bounded uniersal

H Fig. 8. quantifiers only. Getting rid of that last layer of bounded quantifiers, thereby settling the complexity of Boolean combinations of graph inequalities, seems harder. The language shown to be undecidable in section 3, for example, is powerful enough to code the edge reconstruction conecture (in a more or less natural fashion). Hence a decision procedure would hae come as a surprise. In the case of graph inequalities the situation is different: We do not know of any difficult open problem that can be phrased as a graph inequality; hence decidability might still be an option. Question. Is the solability of graph inequalities (as defined in section 2) decidable? A positie indication for decidability is that it seems difficult to force large solutions. If graph inequalities were undecidable, then the solution size would hae to grow faster than any computable function. The best result we hae been able to obtain so far shows that a quadratic lower bound is possible, a far cry from undecidability. Theorem 5.. There is a graph inequality G () G 2 () of size O(n) such that the size of a minimal solution is Ω(n 2 ). Proof. Consider the system of inequalities (Figure 8) with prescribed mappings, where H is a path of length n connected to a complete binary tree of depth log n. Let B be the infinite binary tree with edges naturally labeled by strings from {0, } +. By Lemma 2.3 solutions of the first inequality are subgraphs of B such that if edge aα is in, then edge α is also in for any a {0, }, α {0, } +. From the second inequality it follows that for any solution there is some α {0, } n such that for eery β {0, } log n, edge αβ is in. Hence for any suffix γ of α for eery β {0, } log n, edge γβ is in and therefore there are Ω(n 2 ) edges in. Using Lemma 2.8 we combine the inequalities in Figure 8 into a single inequality. Question 2. Are there graph inequalities whose minimal solutions hae at least exponential size? Our decidability result for graph inequalities with one ariable (and one labeled ertex) shows that the computational complexity of the problem lies in NEP. As we pointed out earlier, it is also NP-hard (since we can ask for a clique as subgraph, without een using the existential quantifier). Question 3. What is the computational complexity of deciding the solability of one-ariable, one-ertex graph inequalities? Is the problem NEP-complete? First steps towards generalizations of the decidability result would probably try to increase the number of specified ertices, then the number of ariables. Also, can we decide Boolean combinations of graph inequalities? One special case of Boolean combinations can be settled with the techniques from section 2: graph equalities with one ariable and one specified ertex. Theorem 5.2. The solability of graph equalities with one ariable and one specified ertex is decidable. Proof. Lemma 2.5 allows us to assume that ariable occurs at most once on each

side of the equality (otherwise we can use Lemma 2.4 as in the proof of Theorem 2.). If does not occur on one of the sides, we are done. If it occurs precisely once on each side, it is not too difficult to see that the equality is solable if the two graphs to which the ariable is attached are isomorphic (where the labeled ertices hae to map to each other). The decision procedure outlined here is, again, in NEP. In the case of directed graph inequalities we hae a tight separation of decidability and undecidability: One ariable with one specified ertex is decidable, and three ariables with two specified ertices are not. While it might be interesting to find out what happens in the case of two ariables, a more promising obect of study should be the computational complexity of directed graph inequalities. The direction of the edges might help in encoding a problem complete for EP or NEP. Question 4. What is the computational complexity of deciding the solability of one-ariable, one-ertex directed (or colored) graph inequalities? Is the problem NEP-complete? Finally we would like to suggest that the question of computational complexity should also be an interesting one for the more general types of graph equalities and graph inequalities studied in the literature [CS79]. Acknowledgments. We would like to thank Laci Babai and János Simon for helpful discussions. REFERENCES [BST94] V. Baltić, S. K. Simić, and V. Tintor, Some remarks on graph equation G 2 = G, Uni. Beograd. Publ. Elektrotehn. Fak. Ser. Mat., 5 (994), pp. 43 48. [Cap79] M. F. Capobianco, Graph equations, Ann. New York Acad. Sci., 39 (979), pp. 4 8. [CK95] M. Capobianco and S.-R. Kim, More results on the graph equation G 2 = G, in Graph Theory, Combinatorics, and Algorithms, Wiley, New York, 995, pp. 67 628. [CLR89] M. F. Capobianco, K. Losi, and B. Riley, G 2 = G has no nontriial tree solutions, Ann. New York Acad. Sci., 555 (989), pp. 03 05. [CS77] D. M. Cetkoić and S. K. Simić, Graph equations, in Contributions to Graph Theory and Its Applications, Technische Hochschule Ilmenau, Ilmenau, Germany, 977, pp. 40 56. [CS79] D. M. Cetkoić and S. K. Simić, A bibliography of graph equations, J. Graph Theory, 3 (979), pp. 3 324. [Die97] R. Diestel, Graph Theory, Grad. Texts in Math. 73, Springer-Verlag, New York, 997. [HU79] J. E. Hopcroft and J. D. Ullman, Introduction to Automata Theory, Languages, and Computation, Addison-Wesley, Reading, MA, 979. [Sch99] M. Schaefer, Completeness and Incompleteness, Ph.D. thesis, Uniersity of Chicago, Chicago, 999. [Sch0] M. Schaefer, Graph Ramsey theory and the polynomial hierarchy, J. Comput. System Sci., 62 (200), pp. 290 322.