This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
A m e (^s(^(C/))}
And thus the SDON property is verified (with PC Act = < o,, s, (fis, 'fie >)'• {PC,PC',mi)eg{P) \ {PC2,PC',m2) eg{P) \-^'ikel,2, PCy^PCi J
nikeipsiSh) A PC = comp{SIk) A Shy^Sh =>VMeMpc', {mi,m2}gM
Indeed, mi,m2 & M and M G Mpc would imply 5/1 = 5/2 because PC is a DPC. Finally a DCC behaves deterministically when deployed with the first translational semantics. D DCC assemblage allows to statically ensure deterministic behavior of components, only based on the following requirements. - Potential services can be statically determined, or are statically specified (every served set has been declared as a potential service). - SI interfaces are respected: they only receive requests on the methods they define; this could be checked by typing techniques [2] on ASP source terms. - Requests follow bindings and are not modified while following these bindings. - There is a bijection between primitive components and functional activities. The two first requirements correspond to static analysis or specification; whereas the two last ones must be guaranteed by the components semantics which is the case for both translational semantics of Section 5. We have shown in [9] that every Process Network can be translated into a (deterministic) ASP term, which can then be fit into a deterministic assemblage of components. Such a bijection between process networks and DCCs will finally provide a large number of DCCs.
7 Conclusion This article defines a hierarchical component calculus that provides a very convenient abstraction of activities and method calls. This abstraction allows static verification of determinism properties. Our component model is aimed at distribution, featuring asynchronous remote method invocations, and futures as generalized references passing through components. Primitive components are defined as a set of Server Interfaces (SI) and client interfaces (CI), together with an ASP term for the primitive component content. Intuitively, each SI corresponds to a set of methods, each CI to a field. Composite components are recursively made of primitives and other composites, with a partial binding between Sis and CIs, and some Sis and CIs exported.
182
D. Caromel and L. Henrio
Primitive deterministic components are defined by imposing t h a t each set of interfering requests belongs to the same server interface. A deterministic composite (DCC) avoids potential interferences by imposing at most a single binding towards a server interface. For D C C , both translational semantics lead t o configurations t h a t respect the SDON properties, hence their deterministic nature. This results mainly relies on the fact t h a t primitive components provide an abstraction of activities, and interfaces provide an abstraction of potential services. One might have noticed the absence of any notion of location or machine, in contrast to calculus such as Ambient [8]. Because of the A S P calculus properties, an activity and further a component, can be placed '^anywhere" without any semantic consequence. A given hierarchical component can be entirely m a p p e d on a single machine, within the same address space, or fully distributed over the network, each inner component being located alone on its own machine. Abstracting activities by components is also convenient for distribution; allowing to m a p each primitive to a single location and to span composites over several machines. Two translational semantics for the component model are proposed. T h e second translation allows to envision an even more interesting perspective: deterministic component reconfiguration. As components and bindings are achieved by A S P active objects, one can imagine to apply the general deterministic property (DON) to reconfiguration phase and to design coherent reconfigurations.
References 1. lose '79: Proceedings of the 4th international conference on software engineering, 1979. Chairman-F. L. Bauer and Chairman-Leon G. Stucki and Chairman-M. M. Lehman. 2. Martin Abadi and Luca Cardelli. A Theory of Objects. Springer-Verlag, New York, 1996. 3. Robert Allen and David Garlan. A formal basis for architectural connection. ACM Transactions on Software Engineering and Methodology, July 1997. 4. Mark Astley and Gul A. Agha. Customization and composition of distributed objects: Middleware abstractions for policy management. In Proceedings of the ACM SIGSOFT 6th International Symposium on Foundations of Software Engineering (FSE), 1998. 5. Prangoise Baude, Denis Caromel, and Matthieu Morel. Prom distributed objects to hierarchical grid components. In International Symposium on Distributed Objects and Applications (DOA), Catania, Sicily, Italy, 3-7 November, LNCS. Springer Verlag, Berlin, Heidelberg, 2003. 6. Philippe Bidinger and Jean-Bernard Stefani. The kell calculus: operational semantics and type system. In Proceedings 6th IFIP International Conference on Formal Methods for Open Object-based Distributed Systems (FMOODS 03), Paris, Prance, 2003. 7. Eric Bruneton, Thierry Coupaye, Matthieu Leclerc, Vivien Quema, and JeanBernard Stefani. An open component model and its support in Java. In Ivica
Asynchonous Distributed Components: Concurrency and Determinacy
8.
9. 10.
11.
12.
13. 14.
15.
16.
17.
18.
19.
20.
183
Crnkovic, Judith A. Stafford, Heinz W. Schmidt, and Kurt C. Wallnau, editors, CBSE, volume 3054 of Lecture Notes in Computer Science. Springer, 2004. Luca Cardelh and Andrew D. Gordon. Mobile ambients. Theoretical Computer Science, 240(1):177-213, 2000. An extended abstract appeared in Proceedings of FoSSaCS '98, pages 140-155. Denis Caromel and Ludovic Henrio. A Theory of Distributed Objects. SpringerVerlag New York, Inc., 2005. To appear. Denis Caromel, Ludovic Henrio, and Bernard Paul Serpette. Asynchronous and deterministic objects. In Proceedings of the 31st ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pages 123-134. ACM Press, 2004. Denis Caromel, Wilfried Klauser, and Julien Vayssiere. Towards seamless computing and metacomputing in Java. Concurrency: Practice and Experience, 10(11-13):1043-1061, 1998. ProActive available at h t t p : / / w w w . i n r i a . f r / o a s i s / proactive. Bruneton E., Coupaye T., and Stefani J.B. Recursive and dynamic software composition with sharing. In Proceedings of the 7th ECOOP International Workshop on Component-Oriented Programming (WCOP'02), 2002. Cormac Flanagan and Matthias Felleisen. The semantics of future and an application. Journal of Functional Programming, 9(1):1-31, 1999. Dimitra Giannakopoulou, Jeff Kramer, and Shing Chi Cheung. Behaviour analysis of distributed systems using the tracta approach. Automated Software Engg., 6(1), 1999. Andrew D. Gordon, Paul D. Hankin, and Sren B. Lassen. Compilation and equivalence of imperative objects. FSTTCS: Foundations of Software Technology and Theoretical Computer Science, 17:74-87, 1997. Robert H. Halstead, Jr. Multilisp: A language for concurrent symbolic computation. ACM Transactions on Programming Languages and Systems (TOPLAS), 7(4):501-538, 1985. Gilles Kahn. The semantics of a simple language for parallel programming. In J. L. Rosenfeld, editor. Information Processing '74: Proceedings of the IFIP Congress, pages 471-475. North-Holland, New York, 1974. Uwe Nestmann and Martin StefFen. Typing confluence. In Stefania Gnesi and Diego Latella, editors. Proceedings of FMICS'97, pages 77-101. Consiglio Nazionale Ricerche di Pisa, 1997. Also available as report ERCIM-10/97-R052, European Research Consortium for Informatics and Mathematics, 1997. Thomas Parks and David Roberts. Distributed Process Networks in Java. In Proceedings of the International Parallel and Distributed Processing Symposium (IPDPS2003), Nice, France, April 2003. Alan Schmitt and Jean-Bernard Stefani. The kell calculus: A family of higherorder distributed process calculi. Lecture Notes in Computer Science, 3267, Feb 2005.
Decidable Properties for Regular Cellular Automata Pietro Di Lena Department of Computer Science, University of Bologna, Mura Anteo Zamboni 7, 40127 Bologna, Italy, [email protected] Abstract. We investigate decidable properties for regular cellular automata. In particular, we show that regularity itself is an undecidable property and that nilpotency, equicontinuity and positively expansiveness became decidable if we restrict to regular cellular automata.
1 Introduction Cellular Automata (CA) are often used as a simple model for complex systems. They were introduced by Von Neumann in the forties as a model of selfreproductive biological systems [16]. Mathematical theory of CA was developed later by Hedlund in the context of symbolic dynamics [7]. To a cellular automaton one associates the shift spaces generated by the evolution of the automaton on suitable partitions of the configuration space. Adopting Kiirka's terminolgy we call column subshifts this kind of shift spaces (see [12] chapter 5). A general approach to the study of a cellular automaton is to study the complexity of its column subshifts (see [5, 13, 10]). Regularity has been introduced by Kurka for general dynamical systems [14]. A CA is regular if every column subshift is sofic, i.e. if the language of every column subshift is regular. Kurka classified CA according to the complexity of column subshift languages [13]. In Kurka's classification the main distiction is whether the cellular automaton is regular or not. He compared language classification with two other famous CA classifications such as equicontinuity and attractor classification. In this paper we study the decidability of topological properties for CA. In particular, we show that regularity is not a decidable property (Theorem 7) which implies that the membership in Kurka's language classes is undecidable. In contrast, we show that some topological properties which are in general undecidable become decidable if we restrict to the class of regular CA. For instance, we show that for regular CA nilpotency, equicontinuity and positively expansiveness are decidable properties (Theorem 6). Moreover, we provide an answer to a question raised in [3] showing that the topological entropy is computable for one-sided regular CA (Theorem 5). The paper is organized as follows. Section 2 is devoted to the introduction of the notation and general definitions while Section 3 contains our results. Please use the following format when citing this chapter: Di Lena, P., 2006, in International Federation for Information Processing, Volume 209, Fourth IFIP International Conference on Theoretical Computer Science-TCS 2006, eds. Navarro, G., Bertossi, L., Kohayakwa, Y., (Boston: Springer), pp. 185-196.
186
P. Di Lena
2 Notations and Definitions 2.1 Shift Spaces and representations of Sofic Shifts Let A — {ai,..., a„} be a finite alphabet, n > 1. For any fc > 0, wiW2---Wk € A'^ is a finite sequence of elements of A. The sets A^ and A^ are respectively the set of doubly infinite sequences {xi)i^z and mono infinite sequences {xi)i^j^ where Xi G A. Let X e A^, for any integer interval [i,j], X[ij] e A^"*"*"^ is the finite subword XiXi+i...Xj of x. Define the metric d on A^ by d{x,y) = Si^z ^M ^^^^^ di{xi,yi) = 1 if Xi = Vi and di{xi,yi) = 0 otherwise. The set A^ endowed with metric d is a compact metric space. A dynamical system is a pair {X, F) where F : X -^ X is a continuous function and X is a compact metrizable space. The shift map (T : A^ —> A^, defined by a{x)i = Xi+i, is an homeomorphism of the compact metric space A^. The dynamical system {A^,a) is called full n-shift or simply full shift. A shift space or subshift (X, a) is a closed shift invariant subset of A^ endowed with a. The shift dynamical system {X, cr) is called one-sided if X C A'*^. In general, we denote the subshift {X,a) simply with X. Let denote with Bk{X) = {x £ A'^ | 3y G X,3i e Z,y[i,i+fc-ij = x} the set of allowed k-blocks of the subshift X, k > 0. The language associated to a subshift X is denoted with C{X) — Si^^BkiX). Any subshift is completely determined by its language (see [15]). The language of a subshift X is: 1. factorial: \i xyz € C{X) then y € C.{X). 2. extendable: Vx £ L{X), 3y £ C{X) such that xy e C{X). The language C{X) of a subshift X is bounded periodic if there exists integers m > 0, n > 0 such that Vx G C{X) and Vi >m,Xi = Xi+nA factor map F : (X,CT)—> {Y, a) is a continuous and cr-commuting function, i.e. F o a = a o F. If F is onto (or surjective), X is called extension of F and Y is called factor of X. If F is biiective, it is a topological conjugacy and X, F are said to be topologically conjugated shift spaces. A subshift is sofic if it can be represented by means of a labeled graph. We review the representation of a sofic shift as vertex shift of a labeled graph. A labeled graph G — (V, E, Q consists of a set of vertices V, a set of edges E and a labeling function ( : V —* A which assigns to each vertex v GV a. symbol from a finite alphabet A. Each edge e G E identifies an initial vertex i{e) G V and a terminal vertex i(e) G V. We denote the existence of an edge between vertices i),u' € y by 11 —* v'. Every sofic shift can be represented as the set of (mono or doubly) infinite sequences generated by the labels of vertices of a labeled graph. That is, the labeled graph Q = (V, E, (), with (^ : V -^ A, represents the (two-sided) sofic shift Sg = {x GA^\ 3{vi)i^z e V^,Vi -^ Vi+i,C{vi) =Xi,iG
Z}.
Decidable Properties for Regular Cellular Automata
187
The topological entropy h{X) = lim„-^oolog|S„(X)|/n of a shift space X is a measure of the complexity of X. While the topological entropy is not computable for general subshifts, it is for sofic shifts (see [15]). The language of a sofic shift is denoted as regular in the context of formal language theory (see [9] for an introduction). The class of regular languages is the class of languages which can be recognized by a deterministic finite state automaton (DFA). Formally, a DFA is a 5-tuple {Q,A,5,qo,F) where Q is a finite set of states, F C Q is the set of accepting states, qo ^ Q is the initial state, A is a finite alphabet and S : Q x A ^> Q is a, partial transition function (i.e. it can be defined only on a subset oi Q x A). The language represented by a DFA is the set of words generated by following a path starting from the initial state and ending to an accepting state. For every regular language there exists an unique smallest DFA, where smallest refers to the number of states. In general, most of the questions concerning regular languages are algorithmically decidable. In particular, it is decidable if two distinct DFA represent the same language. Prom a DFA representing the language of a sofic shift S it is possible to derive a labeled graph presentation of S in the following way: 1. the set of vertices V consists of the pairs {q,a) G Q x A s.t. S{q, a) G Q. 2. there exists an edge (g, a) —* {q', a'), {q, a), {q', a') G V, if 6{q, a) = q' 3.yv = {q,a) GV, ((V) = a. 2.2 Cellular Automata A cellular automaton is a dynamical system {A^, F) where A is a finite alphabet and F is a cr-commuting, continuous function. {A^, F) is generally identified by a block mapping / : A^^'^^ —+ A such that F(x)i = /(x[j_r,i+r.])j* G Z. According to Curtis-Hedlund-Lyndon Theorem [7], the whole class of continuous and crcommuting functions between shift spaces arises in this way. We refer to / and r respectively as local rule and radius of the CA. A CA is one-sided, if the local rule is of the form / : A''+^ —> A where Vx G A^,i G Z,F(x)i = f{x[ii^r])- -A- one-sided CA is usually denoted with {A^,F). We recall the definition of some topological properties of CA. Let d denote the metric on A^ defined in Section 2.1. Definition 1. Let {A^,F)
be a CA.
1. (A^,F) is nilpotent if 3N > 0, 3x G A^, a{x) = x, s.t. Vn > A^, F"(A^) = x. 2. {A^,F)
is equicontinuous at x G A^ if
Ve>0,3<5>0 s.t. VyGA^,d{x,y)
< 5,3n > 0 s.t. d{F''{x),F"{y))
3. (A^,F) is equicontinuous i/Vx G A^, {A^,F) is equicontinuous at x.
< e.
188
P. Di Lena
4. {A^,F) is almost equicontinuous if3x G A^ s.t. {A^,F) is equicont. 5. {A^,F) is sensitive if 3e > 0 s.t. Vx G A^,\/5 > 0,3y e A^,d{x,y) d(F''{x),F'^{y)) > e . 5. {A^,F)
atx.
< (5,3n > 0 s.t.
is positively expansive if 3e > 0 s.t. Vx, y G A^,xj^y,3n>0
s.t. c!(F"(x), F"(y)) > e.
Kari showed that nilpotency is an undecidable property [11]. In [4], Durand et al. showed that equicontinuity, almost equicontinuity and sensitivity are undecidable properties. Actually, it is unknown if positively expansiveness is or not a decidable property. Definition 2. (Column subshift) Let {A^,F) Sk = {xG (A'=)« \3yeA^:
he a CA. For k > 0 let
r{y)[o,k) =Xi,ie
denote the column subshift of width k associated to
N}
{A^,F).
Oilman noticed that the language of a column subshift is always contextsensitive [6]. Kurka classified cellular automata according to the complexity of column subshifts languages [13]. Definition 3. (Bounded periodic CA) {A^,F) C{St) is a bounded periodic language.
is bounded periodic z/Vi > 0,
Definition 4. (Regular CA) {A^,F) is regular if^t language (or, equivalently, if St is sofic shift).
> 0, C{St) is a regular
Definition 5. (Kurka's Language classification) Every cellular automaton falls exactly in one of the following classes. L I . Bounded periodic. L2. Regular not bounded periodic. L3. Not regular. Class LI coincide with the class of equicontinuous CA [13]. Thus the membership in LI is undecidable while it was unknown if it is for 1/2, L3. The topological entropy H{F) = limfe^oo h{Sk) of (A^,F) is a measure of the complexity of the dynamics of (A^, F). The problem of computing or even approximating the topological entropy of CA has been shown to be in general not algorithmically computable [8]. The topological entropy of one-sided CA has a simpler characterization than the general case (see [2]). Tiieorem 1. Let {A^,F)
be a CA with radius r. Then H{F) = h{Er).
Decidable Properties for Regular Cellular Automata
189
3 Results In this section we investigate decidable properties of regular CA. Most of our effort will be devoted to show that if 5 C {A'^^'+'^f is a sofic shift and {A^,F) is a CA with radius r, it is possible to decide whether S = S2r+i (Theorem 3). This strong result has a lot of consequences. The most relevant one is that for regular CA it is possible to compute column subshifts of every given width (Theorem 4). The (dynamical) complexity of a CA is strictly related to the complexity of column subshifts languages. Actually we show that, thanks to the computability property, it is possible to decide if a regular CA is nilpotent, equicontinuous or positively expansive (Theorem 6). Moreover, it turns also out, that it is possible to compute the topological entropy for one-sided regular CA (Theorem 5). The negative consequence of computability/decidability results is that regularity itself is an undecidable property (Theorem 7). In order to show our fundamental decidability result (Theorem 3) we need to define the concept of cellular automaton extension of a sofic shift and to show some basic properties. Definition 6. Let (A^,F) be a CA with radius r. Let Q = {V,E,C,) be a labeled graph with ( : V ^ A?'^'^^. For t > 0, let the (F,t)-extension ofQ be the labeled graph G(F,t) = {Vt,Et,Ct), with Ct '• Vt —^ A^''+*, defined in the following way (see figure 1): • vertex set: Vt = {{v,,..,vt)
G V* I 3a G A^'+\Civi)
= a[i,2r+i],l
• edge set: Et = {(ei,.., et) G J5* | 3v, v' G Vt, z(e,) - Vj, i(e,) = v'jJidvj))
= av'j)r+i}
• labeling function: \/v = {vi,...,Vt) G Vt,Ct{v) =awherea[i^2r+i] = C{vi)A
Definition 7. Let {A^,F) be a CA. Lett>0,k> 1 and let a,b € Bt{Sk) such that a = ai...ak, b = bi...bk where ai,bi G A* and aj+i = foj,l < i < /c. Then, we say that x,y are compatible blocks and we denote with aQb — ai...akbk their overlapping concatenation. Moreover, let x,y G Sk such that x = xi..Xk,y = yi-.-J/fc where Xi,yi G A^ and Xi+i = yi,l < i < k. We say that x,y are compatible sequences and, abusing the notation, we denote with xQy = xi...Xkyk their overlapping concatenation. The following two lemmas will be used extensively.
190
P. Di Lena ^(v") = aV..a'2r^j
f(a|...a2r+j) = a'f^j, Vie[1,t] Fig. 1. A legal edge v ^^ v' oi an (F, i)-extended graph G(F,t)Lemma 1. Let {A'^,F) be a CA with radius r. Let t > 0 and let a,b e Bt{S2r+i) be compatible blocks. Then aQb G Bt{S2r+2)Proof. Let a = ai...at where oi,...,at G A^'"+^ and let x £ A^ such that F'(x)[o,2r] = «i+ii 0 < i < t. Moreover, let b = bi...bt where bi,...,bt & ^^'"+^ and let y G A^ such that F*(j/)[i_2r+i] = &i+i, 0 < i < t. Let z G A^ he such that Z(^_oo,2r] = 2;(_oo,2r]. -2^(1,00) = 2/(1,00) and let a © 6 = ci-.c* where ci, ...,Ci G >1^'"+^. Then it is easy to check that F'^(z)[o^2r+i] = Q+ii 0 < i < ^ which implies that a Qb G Bt{S2r+2)- D Lemma 2. l e i (A^, F) be a CA with radius r. Let S C (A^''+i)'^ be a sofic shift and let G be a labeled graph presentation of S. Let x,y G Sg.^^ j, be compatible sequences. Then x Qy G Sg.j,^,. Proof. Since, by hypothesis, x = {xi)i^{^,y = {yi)ieN G Sg^j, ^^ there exist two paths wi —> U2 —> ••• and wi ^ 112 —> ... in Q such that C("i) = ^i and C,{vi) = yi, i G N. Then, (wi,fi) —> (^2,^2) —* ... is a legal path in G(F,2) which implies that xQy G Sg^^.,^. D The following proposition shows that the sofic shift presented by the (F, t)extension G{F,t) of a labeled graph G doesn't depend on G but only on the sofic shift presented by G.
Decidable Properties for Regular Cellular Automata
191
Proposition 1. Let {A^,F) be a CA with radius r and let Q,G' be two distinct labeled graph presentations of the same sofic shift S = Sg = Sg' C (yl^'"+'-)^. Then, for any t > 0, 5g(^ „ = 5'e|p ^. Proof. We show that Sg^^, ^^ C Sg' . The proof for the converse inclusion can be obtained by exchanging Q with Q'. First of all, note that, by definition of [F, l)-extension, Sg.^, ^, — Sgi . Let X G Sg^p^^ and let xj, ...,X( G S such that x = xi O ... © Xt- Then, xi, ...,Xt € Sc' and, by Lemma 2, it follows that x e Sa' • • Thanks to Proposition 1 we can refer directly to the extension of a sofic shift S rather than to the extension of a labeled graph presentation of S. Definition 8. Let {A^,F) be a CA with radius r. Let S C (yl2'-+i)N be a sofic shift and let Q be a labeled graph presentation of S. For t > 0, let denote with 5(F,t) = ^S(F.t) ^^^ (F,t)-extension of the sofic shift S. We now show some useful properties of the {F, i)-extensions of sofic shifts. Lemma 3. Let {A^,F) shift. Then Vi > 0,
be a CA with radius r. Let S C {A'^r+i^^ ^g „ g^^^
a. if E2r+i C S then S2r+t C S(^F,t), h.if IJ2r+i = S then E^r+t = S(F,t), c. if S2r+i 3 5 then E2r+t 3 5'(F,t) • Proof, a. Let x e £'2r+f such that x = xi © .. 0 xt where Xj G i?2r+i) 1 1 < « < i and, by Lemma 2, xi © .. © Xt G 5(F,t). b.By point a, S2r+t C S(^F,t): thus we just have to show that S(^F,t) £ ^2r+t or, equivalently, that C{S(^F,t)) ^ C{S2r+t)- Letfc> 0 and let a G Bk{S(^F,t))- Let «!,..., at G Bk{S) be such that ai © ... Q at = a. By hypothesis, ai,...,at G Bk{S2r+i) then, by Lemma 1, it follows that ai © ... © at G Bk{E2r+t)c. Since S2r+i D S, appling the same reasoning of point 6, it is possible to conclude that S2r+t 2 5'(F,t)' We have just to show that the inclusion is strict. Since S2r+i 3 S, there exists a block 6i G C{S2r+i) such that 6i ^ £ ( 5 ) . Then, let b G £(Z'2r+f) such that b = 6i 0 62 © ••• © ^t for some &2,..., 6t G /:(i:2r+i). IVivially,fo^ CiS^F.t))- • The following theorem easily follows from Lemma 3 and provides a strong characterization for regular CA. It is a two-sided extension of a theorem proved by Blanchard and Maass for one-sided CA [1]. Theorem 2. Let {A^, F) be a CA with radius r. Then {A^, F) is regular if and only if S2r+i is a sofic shift. Proof. The necessary implication is trivial. Then, suppose Z'2r+i is a sofic shift. For every d < 2r -f 1, Z'rf is a factor of S2r+i then it is a sofic shift. For every d> 2r + l,hy Lemma 3 point b, Sd can be represented by a labeled graph then it is a sofic shift. D In general, if Ud is a sofic shift for d < 2r + 1 it is not possible to conclude that the CA is regular (see [10]).
192
P. Di Lena
Definition 9. Let A be a finite alphabet. Let t > 1 and let [i,j] C [1,^] be an integer interval. Let
#(,,,]: {Ar - {A^-'+r denote the projection map induced by the one-block factor map
defined by (p[ij-^{ai...at) = aiai+i...0j,Vaia2...at £ A*. Remark 1. Let {A^,F) be a CA with radius r and let G{F,t) be tiie (F, t)extension of Q. Then for every i G [l,i], ^[i,2r+i](5'£;(f, j,) C S'g. Definition 10. Let {A^,F) be a CA with radius r and let S C sofic shift. S is F-extendibie if
(A2'-+1)N
be a
S = % 2 r + i ] ( V , t ) ) ' ^ ^ > 0,Vi G [l,i]. Note that for a sofic shift to be F-extendible is a necessary condition in order to be equal to S2r+iProposition 2. Let {A^, F) be a CA with radius r and let S C (A2''+1)N be a sofic shift. Then, S is F-extendible iff S = ^[i,2r+i](5'(F,2)) = ^i2,2r-+2](5'(F,2))Proof. The necessary implication is trivial. Then, let 5 = ^[i,2r+i](5'(F,2)) = ^[2,2r+2](5'(F,2))- Note that this imphes S = S(^F,I)- Let t > 2, we have to show that S = $[i,2r+i]{S{F,t)) iox 1 < i < t. Let z e S and let k G [l,i]. To reach the proof it is sufficient to show that z G ^[k,2r+k]iS(F,t))- Since S = ^[i,2r+i]iS(F,2)) = ^{2,2r+2]{S{F,2)), there exists xi,..,xt-i G 5(ir,2) such t h a t ^[2,2r+2](a;i)
=
^[l,2r+l](2;i+l), 1 < i < t -
1 a n d ^[2,2r+2](a;fc-l)
=
^[i,2r+i]{^k) = z. Then, xi,..,Xt-i are compatible and by Lemma 2, it follows that xi O ... O xt-i € S(^F,t) and ^[k,2r+k]{xi © ... 0 xt-i) = z. D Proposition 3. Let {A^,F) be a CA with radius r and let S C (^Sr+i^N jg ^ sofic shift. Suppose S is F-extendible then S C Z'2r+iProof We prove by induction on fc > 0 that Bk{S) C Bki^2r+i)1. (Base Case) By definition, Bi{S) C Bi{S2r+\) = A'^''+\ 2. (Inductive Case) Suppose Bk{S) C Bki^2r+i) for fc > 0. We have to show that Bk+i{S) C Bk+i{S2r+i)Since the radius of the CA is r, the set of blocks Bk+i{S2r+i) is completely determined by the set of blocks BkiSir+i) as well as the set of blocks Bk+i{^[r+i,3r+i]{S{F,2r+i))) is Completely determined by the set of blocks Bk{S(F,2r+i))- Thus, showing that Bk{S(^F,2r+i)) £ Bk{S4r+i) we can reach the conclusion Bk+iiS) C Bk+i{S2r+i)Let X G Sfc(5(F,2r+i))- Since S is F-extendible, there exist xi, ..,X2r+i G Bk{S) such that x = xiQ ...(Dx2r+i- By inductive hypothesis, xi,..., X2r+i G Bk{^2r+i) then, by Lemma 1, a; G Sfc('^4r+i)- •
Decidable Properties for Regular Cellular Automata
193
P r o p o s i t i o n 4. Let {A^,F) be a CA with radius r and let S C (A^r+i^N ^g ^ sofic shift. Then it is decidable if S is F-extendible. Proof. Given a labeled graph representation of S, it is possible to compute S(^F^2) and it is possible to compute labeled graph representations for ^[i,2r-+i]('S'(F,2)) and ^[2,2r+2]('S'(F,2))- Given labeled graph representation of 5, 5" = ^[i,2r+i](5'(F,2)) and S" = ^[2,2r+2]{S{F,2)) it is easy to build three finite state automata whose recognized languages are respectively C{S),C{S') and C{S"). Then, the proof follows from Proposition 2 and from the decidability of the equivalence between finite state automata. D P r o p o s i t i o n 5. Let {A^, F) be a CA with radius r and let S C S2r+i be a sofic shift. Then it is decidable if S2r+i = S. Proof. We provide a proof for the following claim which trivially is algorithmically checkable. Let M = ((5,A2'-+i,go,i^,<5) be the smallest DFA recognizing the language C{S). Let N = {\Q\ • |A|2'-+i)2'-+i. Then Z-sr+i -= S if and only if BNi^Ar+l) = Siv(5'(F,2r+l))By Lemma 3, the necessary condition is trivially true. Obviously, if Sir+i = 5(F,2r+i) then Z'2r+i = S. Thus, we show by induction on fc > 0 that Bk{Sir+l) = Sfc(S'(F,2r+l))a. (Base Case) By hypothesis, Sjv(^4r+i) = 'Sjv(5'(F,2r+i))- Moreover, since the language of a subshift is factorial, ^^(1^4^+1) = Sfc(S(F,2r+i))i Vfc < A''. b.(Inductive Case) Suppose 5 x ( ^ 4 r + i ) = BK{S(F,2r+i)), K > N. We have to s h o w t h a t BK+li^ir+l)
=
BK+l{S(^F,2r+l))-
Let Q = {V, E, 0 be the labeled graph presentation of S derived from the smallest DFA M according to the procedure described at the end of section 2.1. Note that the number of vertices of Q is less then or equal to \Q\ • \A\'^'^'^^. Moreover, let ^(F,2r+i) be the (F, 2r+l)-extension oiQ. Note that the number of vertices of Q(F,2r+i) is less then or equal to A''. Let a G BK+ii^ir+i) and let a^, ...,a^''+^ G Bx+i(-^2r+i) such that a = a^ 0 ... 0 a ^ ' ' + ^ Since, by inductive hypothesis, Bxi^Ar+i) = BKiS(^F,2r+i)): it follows that BK+i{^2r+i) = BK+I{S) and, trivially, that a^,...,a'^^'^^ G BK+I{S). Then there exist uniques legal paths
in g, where u\ = iqo,a\) and ( ( 4 ) = ai^i e [l,2r + 1], 1 < A; < iiT + 1. We show that there exists x G 5'(F,2r+i) such that x^o^i^] = a. Let y G S{F,2r+i) such that ^[0,^-1] = o,[o,K-i]- One such y exists since, by inductive hypothesis, Si<-(Z'4r+i) = S_ft-(5'(F,2r+i))- Then there exists an unique path vo -^ vi —» . . i n ^(F,2r+i) such that C2r+i{vi) = Vi, i G N and such that Vo = ((go,C[i,2r+i]). •••> (9o,C[2r+i,4r+i])) where c = yo G A'^''+^. Since K > N there exist 0 < i < j < K such that Vi — Vj. Then,
194
P. Di Lena
let consider a'' = aia2..aj'aj^ia^_,_2...a^^i, 1 < fc < 2r + 1. Obviously, a'' e C{S) n C{i:2r+i), l < k < 2r + l. Moreover, a^ are compatible then, by Lemma 1, a = a^ 0 ... 0 5^''+^ G £(1^4^+1) and, by inductive hypothesis, a e £(5(ir,2r+l))-
Let I = \a\. Let z G S(^p^2r+i) such that zro,!) = a. Then, there exists an unique path UQ —> tij —> .. in Q{F,2r+i) such that C2r+i{v[) = Zi, i GN and such that V'Q — VQ. Moreover, since V'Q = VQ and zjo,;) = a, it follows that ujj. = Vk for 0 < A; < « and v^_,_j. = Vj+k, 1 < k < C where C — K — j . Then it is easy to see that vo -> ... -^VK^ vl^c+i -^ '"i+c+2 -^ is a legal path in Q{F,2r + 1) and that the labehngs of the vertices in the path generate a sequence x G >S'(F,2r+i) such that xp^x] = o-- O Now we are ready to state our main result and next to show the most immediate consequences. Theorem 3. Let (A^, F) be a CA with radius r and let S C (^2r+i^N ^^ ^ ^^yj^ shift. Then it is decidable if S = U2r+i' Proof. S = S2r+\ if and only if S is F-extendible and S 2 ^2r+i- Then, the proof follows from Proposition 4 and Proposition 5. D We now explore some important consequences of Theorem 3 related to regular CA. Theorem 4. Let {A^,F)
be a regular CA. Then Vi > 0, St is computable.
Proof Let r be the radius of the CA. By Theorem 3, given a sofic shift S C (A^'"+^)^, it is possible to decide if 5 = ^2r+i- We can enumerate all labeled graph representing all sofic shifts contained in A'^^'^^. Then there exists an algorithm that iteratively generates graphs in the enumeration and checks if the shift represented is S2r+i- Since {A^,F) is regular, S2r+i will be eventually generated and recognized. This proves that, if {A^, F) is regular, Z'2r+i is computable. In general, if i < 2r 4-1, we can compute St by simply taking the projection ^[i,t](^2r+i) otherwise, if i > 2r -I-1, by Lemma 3 point b, we can compute St by computing the (F, t — 2r)-extension of S2r+i- D The following theorem gives an answer to a question raised in [3]. Theorem 5. The topological entropy of one-sided regular CA is computable. Proof Since the entropy of sofic shifts is computable, the conclusion follows from Theorem 1 and Theorem 4. D The following theorem shows that if we restrict to the class of regular CA, it is possible to provide answers to questions which are undecidable in the general case.
Decidable Properties for Regular Cellular Automata
195
Theorem 6. Let {A^, F) be a regular CA. Then the following topological properties are decidable. l.Nilpotency 2. Equicontinuity 3. Positively Expansiveness Proof. By Theorem 4, given {A^,F), it is possible to compute S2r+i' 1. It is easy to see that {A^, F) is nilpotent if and only if there exists a G A^^+^ and N > 0 such that Vn > N,'^x e S2r+i, o'"(x) = a. Given a labeled graph representation of Z'2r+i! this last condition is trivially algorithmically checkable. 2.It is easy to see that {A^,F) is equicontinuous if and only if £(Z'2r+i) is a bounded periodic language and that, given a labeled graph representation of I^2r+i, it is algorithmically checkable if C{S2r+i) is bounded periodic. 3.Every positively expansive CA is conjugated to (Z'2r+i,cr) where S2r+i is a shift of finite type and, in particular, it is an n-full shift (see [12]). Since, for positively expansive CA, n = |F"-'-(x)| for every x G A^, n is a computable number. The proof follows from the decidability of the conjugacy problem for one-sided shifts of finite type (see [15]). D To conclude, we show that, as a negative consequence of the decidability of properties in Theorem 6, regularity is an undecidable property which implies that the membership in Kurka's language classes is undecidable. Theorem 7. It is undecidable whether a CA is regular. Proof. Assume it is decidable if a CA is regular. Then, since nilpotent CA are regular, by Theorem 6, it is possible to decide if a CA is nilpotent. D
4 Conclusions a n d open problems We investigated decidable properties for regular cellular automata. We showed that regularity itself is not a decidable property (Theorem 7) and that, conversely, for regular cellular automata nilpotency, equicontinuity and positively expansiveness are decidable properties (Theorem 6). Moreover we aswered a question raised in [3] showing that the topological entropy is computable for one-sided regular CA (Theorem 5). It is unknown if almost equicontinuity and sensitivity are or not decidable properties for regular CA (since to be almost equicontinuous or sensitive is a dicotomy for CA, this two properties are either both decidable or both not decidable).
References 1. F. Blanchard, A. Maass. Dynamical Behaviour of Coven's Aperiodic Cellular Automata. Theor. Coraput. Sci., 163, 291-302 (1996).
196
P. Di Lena
2. F. Blanchard, A. Maass. Dynamical properties of expansive one-sided cellular automata. Israel J. Math. 99, 149-174 (1997). 3. P. Di Lena. On Computing the Topological Entropy of one-sided Cellular Automata. International Journal of Unconventional Computing (1995). To appear. 4. B.Durand, E.Formenti, G. Varouchas. On undecidability of equicontinuity classification for cellular automata. Discrete models for complex systems, DMCS '03 (Lyon), 117-127 (2003). 5. R.H. Gilman, Robert H. Classes of hnear automata. Ergodic Theory Dynam. Systems 7, no. 1, 105-118 (1987). 6. R.H. Gilman. Notes on Cellular Automata. Preprint (1988). 7. Hedlund, G. A. Endormorphisms and automorphisms of the shift dynamical system. Math. Systems Theory 3, 320-375 (1969). 8. L.P. Hurd, J. Kari, K. Culik. The topological entropy of cellular automata is uncomputable. Ergodic Theory Dynam. Sys. 12, no. 2, 255-265 (1992). 9. J. Hopcroft, J.D. Ullman. Introduction to automata theory, languages, and computation. Addison-Wesley Series in Computer Science. Addison-Wesley Publishing Co., Reading, Mass. (1979). 10. Z.S. Jiang, H.M. Xie. Evolution complexity of the elementary cellular automaton rule 18. Complex Systems 13, no. 3, 271-295 (2001). 11. J. Kari. The nilpotency problem of one-dimensional cellular automata. SIAM J. Comput. 21, no. 3, 571-586 (1992). 12. P. Kurka. Topological and symbolic dynamics. Cours Specialises [Specialized Courses], 11. Societe Mathematique de Prance, Paris (2003). 13. P. Kurka. Languages, equicontinuity and attractors in cellular automata. Ergodic Theory Dynamical Systems 17, no. 2, 417-433 (1997). 14. P. Kurka. Zero-dimensional dynamical systems, formal languages, and universality. Theory Comput. Syst. 32, no. 4, 423-433 (1999). 15. D. Lind, B. Marcus. An introduction to symbolic dynamics and coding. Cambridge University Press, Cambridge (1995). 16. J. von Neumann. Theory of self-reproducing automata. Univ. of Illinois Press, Urbana (1966).
Symbolic Determinisation of Extended Automata Thierry Jeron, Herve Marchand, and Vlad Rusu Irisa/Inria Rennes, Campus de Beaulieu, 35042 Rennes France. {Thierry.Jeron I Herve.Marchand I Vlad.Rusu} Qirisa.fr Abstract. We define a symbolic determinisation procedure for a class of infinite-state systems, which consists of automata extended with symbolic variables that may be infinite-state. The subclass of extended automata for which the procedure terminates is characterised as bounded lookahead extended automata. It corresponds to automata for which, in any location, the observation of a bounded-length trace is enough to infer the first transition actually taken. We discuss applications of the algorithm to the verification, testing, and diagnosis of infinite-state systems. Key words: symbolic automata, determinisation
1 Introduction Most existing models of computation are nondeterministic, but they include restricted, deterministic versions as subclasses. A natural question is comparing the expressiveness of the general, nondeterministic class with that of the corresponding restricted, deterministic subclass. For example, it is well known that nondeterministic and deterministic finite automata on finite words are equivalent, but for finite automata on infinite words, the equivalence depends on the acceptance condition (e.g., Miiller versus Biichi acceptance); and for pushdown and timed automata, the nondeterministic version is strictly more expressive than the deterministic one [1, 2]. Besides this theoretical interest, the distinction between nondeterministic and deterministic models has practical consequences. For example, verification consists in checking whether an implementation of a system satisfies a specification; both views of the system are modeled by automata of some kind. This problem can be seen as a language inclusion problem, which in turn can be encoded into a language emptyness problem (i.e., checking the emptyness of the language recognised by a product between the implementation and the complement of the specification). The complement of the specification is an automaton that accepts exactly the words that are rejected by the specification, and is easily computed if the specification is deterministic (by complementing the specification's acceptance condition). Otherwise, if the specification is nondeterministic, it has to be determinised, i.e., turned into an equivalent deterministic machine.
Please use the following format when citing this chapter: Jeron, T., Marchand, H., Rusu, V., 2006, in International Federation for Information Processing, Volume 209, Fourth IFIP International Conference on Theoretical Computer Science-TCS 2006, eds. Navarro, G., Bertossi, L., Kohayakwa, Y., (Boston: Springer), pp. 197-212.
198
T. Jeron, H. Marchand, and V. Rusu
Hence, determinisation is an important operation in formal verification. It is also important in other fields such as conformance testing and fault diagnosis where deterministic testers (resp. diagnosers) have to be derived from specifications that are, in general nondeterministic due to, e.g., partial observation. In this paper we define a determinisation operation for a class of infinite-state systems, which consists of extended automata operating on symbolic variables and communicating with the environment via synchronising actions. Variants of this model are often encountered in the literature and can be used, e.g., for the formal specification of reactive systems. The determinisation procedure consists in iterating a sequence of local determinisation steps, which postpone operations on the variables until it becomes clear which exact operations should have been performed. The subclass of extended automata on which the procedure terminates is characterised as bounded-lookahead automata, for which the observation of a bounded-length trace is enough to infer the first transition actually taken. The result is nontrivial because the order in which local determinisation steps are iterated has a strong influence on termination. The main difficulty was to find an order for which the bounded lookahead decreases at each iteration, thus ensuring termination of the procedure. The rest of the paper is organised as follows. We first introduce extended automata and the determinisation operation by means of examples. Then, in Section 2 we formally define the syntax and semantics of extended automata, and in Section 3 the determinisation operation is formally defined. The operation may not terminate in general, and in Section 4 the subclass for which the procedure does terminate is precisely characterised via necessary and sufficient conditions. However, these conditions are undecidable, hence, we also provide sufficient, decidable conditions for termination. In Section 5 we discuss applications of our procedure to the verification, testing, and diagnosis of reactive systems, and conclude in Section 6. The technical report [3] contains proofs of all the results. Example 1 (extended automata, determinisation). Figure 1 (left) depicts an extended automaton S. In location IQ, the action a occurs. If a; > 0 then the control goes to location li and the variable x is decreased by 1, and if x < 0 then the control goes to location h and x is increased by 2. Clearly, if a; = 0 then the next control location and the next value of x are not uniquely defined: the system is nondeterministic. The right-hand side of Figure 1 depicts the automaton det{S) obtained after determinising S. Intuitively, the locations l\ and I2, which could be nondeterministically chosen as the next control location after an action a, are merged into one new location denoted by {lo,{li,l2))- A new transition labeled by a goes from IQ to (^o, (h^h))- This transition is taken if a occurs, and if x satisfies the disjunction x > 0 V x < 0 (which actually simplifies to true). This condition is the disjunction of the guards of the two transitions involved in the nondeterministic choice in S. Note, however, that those transitions perform different assignments to variables: X := X — 1 for one, and x := x-(- 2 for the other. Hence, the new transition
Symbolic Determinisation of Extended Automata
199
lo
({l0,{h,l2))) cc > 0 A (x - 1)> 0
Fig. 1. Left: extended automaton S
/
\
x < 0 A (x + 2)< 0 c
Right: extended automaton det{S)
from lo to {IQ, {h^h)) of det{S) does not "know" which assignment to perform. To solve this problem, the idea is to postpone assignments until it becomes clear which one of the transitions of the nondeterministic choice was actually taken, and then to "catch up" with the assignments in order to preserve the semantics. Hence, if 6 occurs after a, then the transition from /Q to Zi was taken (hence, X := X — 1 sould have been performed), but if c occurs after a, the transition from ^0 to I2 was taken (hence x := x + 2 should have been performed). Note how the assignments are simulated in det{S): the transition labeled by h (resp. by c) has x — 1 (resp. x + 2) substituted for x in its guard and assignments. To match the behaviour of 5 , in which the transition labeled by h (resp. c) are fireable only after a transition labeled a has been fired with a; > 0 (resp. a; < 0) holding, the guard of the transition labeled by h (resp. c) in det{S) is strengthened by x < 0 (resp. x > 0).
2 Extended automata Extended automata consist of a finite control structure and a finite set of typed variables V. Each variable x €V takes values in some domain donix • A valuation V of the variables V is a function that associates to each variable x G y a value v{x) e dorrix- The set of valuations of the variables V is denoted by V. In the sequel, a predicate P over variables V is often identified with its set of "solutions", i.e., the set of valuations V' C V of the variables V for which P is true. Definition 1 (extended automaton). An extended automaton (sometimes refered to simply as an automaton^ is a tuple S = {V, 0, L, 1°, S, T):
200
T. Jeron, H. Marchand, and V. Rusu
- V is a finite set of typed variables - O is the initial condition, a predicate on V, assumed to have a unique solution - L is a nonempty, finite set of locations and 1° G L is the initial location, ~ S is a nonempty, finite alphabet of actions, - T is a set of transitions. Each transition t € T is associated with a tuple {ot, Gt, at, At, dt), where - Ot £ L is called the origin of the transition, ~ Gt is a Boolean expression over variables V, called the guard, - at G E is called the action of the transition, - At is the assignment of the transition: a set of expressions of the form {x := A^)xev where, for each x £ V, the right-hand side A'^ of the assignment X := A^ is an expression on V, - dt € L is called the destination of the transition. We sometimes write t : {o,G,a,A,d) to emphasise the tuple associated to t. By slight abuse of notation, we shall denote by o an operation of syntactical substitution: a guard G (or an assignment A) is composed with another assignment A' by replacing in G (resp. in the right-hand side of A) all the variables by their corresponding right-hands sides from A'. Examples of such substitutions in guards and assignments have been given in Example 1 above. The semantics of extended automata is described by labelled transitions systems. Definition 2 (Labelled Transition System (LTS)). A Labelled Transition System is a tuple S = {Q,Q^,A,^ where Q is a set o/states, Q° C Q is the set of initial states, A is a set of labels, and —>C Q x A x Q is the transition relation. The LTS semantics of an extended automaton enumerates the valuations V of its variables V. For an expression E involving (a subset of) V, and for u G.V, we denote by E{u) the value obtained by substituting in E each variable x by its value vix). Definition 3 (Semantics of extended automata). The semantics of an extended automaton S = {V,0,L,l°,E,T) is an LTS [Sj = {Q,{q°},A,^), where " the set of states is Q = L x V, - the set of initial states is the singleton {g°} = {(^o, ^o)} where PQ is the unique valuation satisfying O, - the set of labels is A = T, > is the smallest relation in Q x A x Q defined by the following rule: {l,v),{l',v')
eQ
t:{l,G,a,A,l')eT {i,u)^{i'y)
G{v) = true
v'= A{v)
Symbolic Determinisation of Extended Automata
201
The rule says that the transition t : {l,G,a,A,l') is fireable in a state (/,J/) if the guard G evaluates to true when the variables evaluate according to v; then the transition takes the system to the state {I', P') where the assignment A of the transition maps the valuation v to v'. We extend this notion to sequences of transitions a = ti • ta- • -tn G T*, saying that a is fireable in a state q S Q if there exists states qi = q,q2,- • -Qn & Q such that Vi = 1.. .n — 1, qi A qi+i. We then write g -^ to say that a is fireable in q. The transition sequence a is initially fireable if it is fireable in the initial state qo. A state q is reachable if there exists an initially fireable transition sequence a leading to it, i.e., 3a G T*,qo -^ q. We denote by Reach{S) the set of reachable states. For a sequence a = i i - - - i „ G T " (n > 1), we let first{a) = ti. Definition 4 (trace). The trace of a transition sequence (T = ti • t2- • -tn is the projection traceia) ~ at^ • a^^ • • • a^^ of a on the set S of actions. The set of traces of an extended automaton S is the set of traces of initially fireable transition sequences and is denoted by Traces{S).
3 Local Determinisation Intuitively, an extended automaton is deterministic if in each location, the guards of the transitions labeled by the same action are mutually exclusive. Determinising an extended automaton >S means computing a deterministic extended automaton det{S) with the same traces as S. Definition 5 (deterministic extended automaton). An extended automaton (y, 0 , L, i°, S, T) is deterministic in a location I G L if for all actions a € E and each pair 11 : {l,Gi,a,Ai,li) and t2 : {l,G2,a,,A2,l2) of transitions with origin I and labeled by a, the conjunction of the guards Gi A G2 is unsatisfiable. The automaton is deterministic if it is deterministic in all locations I & L. It is assumed that the guards are written in a theory where satisfiability is decidable, such as, e.g., combinations of quantifier-free Presurger arithmetic formulas, arrays, and lists. Such formulas are expressive enough to encode the most common data structures, and their satisfiability is decidable using, e.g., the classical Nelson-Oppen combination of decision procedures [4]. Note that determinism does not take reachability of states into account. However, since extended automata have a unique initial state, the definition of determinism is equivalent to the fact that the semantics of a deterministic extended automaton is a deterministic LTS in the usual sense. Exemple 1 shows that determinising two transitions consists in merging the two transitions into a new one, and propagating guards and assignments onto transitions following them (cf. Figure 1). Formally, follow{t) = {t' G T\ot' = dt}. We also denote by Idy the identity assignments over variables V, i.e., x := x for each x GV.
202
T. J6ron, H. Marchand, and V. Rusu o
t/\t2 • ( d t j , d t 2 )Y
dti
-!
dt2
Jt2
h
di 4 t'/ Gfollow{ti),i = 1,2
"' d{
'•2
ii-^ If d{
? =mod{t'i),i = 1,2
re Fig. 2. Determinising 2 transitions: (left) before
(right) after
Definition 6 (determinising two transitions). Let S he an extended automaton, and let t\,t2 & T he two transitions with same origin o = Ofj = Ot^ and same action a = at^ = at^- The automaton det2{S,ti,t2) is defined as follows. //Gtj A Gfj is unsatisfiable then det2{S,ti,t2) —S, otherwise, C7<jet2(S, t) = 0s ^ L.'det2(5,t) = LsU {{o, {dti,dt2))}, where (o, (dti.dt^)) is a new location ^
=1°
1° '• d.ct2t.S, t)
'•S
^S Ts\{ti,t2}U{ti^2}UTiUT2, where - ti,2 = (o, Gti VGt2,a,/dv',(o, (dti,dt2)>), - for i = 1,2, Ti = Ut'efoiio™(t ji^^^^iC*')}! ™*^ tf^^ transitions modi{t') : ((o, {d(i,dt2)), Gf, AGf o At.,at',At' oAt,,dt').
^det2(S,
t) =
%et2(S,t)
-
The operation is illustrated in Figure 2. The transitions ti and t2 in S are replaced in det2{S,ti,t2) by the set of transitions {ii,2}UTiUT2. The transition ti^2 leads from the common origin o of i 1,^2 to the new location (o, (dtijdt^)); its guard is the disjunction of those of t\, ^2; hence, ii,2 can be fired whenever ii or ^2 can. However, t\^2 does not perform any of the assignments oiti, ^2 because it does not "know" which ones to perform. The assignments are postponed onto copies of the transitions t' G follow{ti) (i = 1,2), modified in order to "catch up" with the effect of transition ti: - the guard G^^diit') equals Gt, A Gf o Aj,.. Intuitively, this amounts to firing the transition modi{t') in det2{S,ti,t2), under exactly the same conditions as the transition t' in <S: the conjunct Qti "recalls" that ti should have been fired before t', and by composing Gf with At.., the effect of ti on the variables is simulated before the guard of t' is evaluated. ~ A„„dj(t') performs the assignments of Af composed with the assignments At^. In this way, the cumulated effect on the variables of firing in sequence ti then t' in <S is simulated.
Symbolic Determinisation of Extended Automata
203
Definition 7 (Local determinisation in location). The local determinisation in location I of an extended automaton S = {V, 0, L, 1°, E, T), where I G L, is defined as follows. Let Ti CT be the set of all transitions with origin I, then: - det{S,l) = S if for every pair of distinct transitions t\, t2 & Ti such that ati = 3*2; the formula G^ A Gtj is unsatisfiable; - otherwise, choose two distinct transitions ti,t2 G Ti such that a^j = a^j, Gti A Gf2 is satisfiable, and let det{S,l) = det{det2{S,ti,t2),l)The operation terminates, as the set of pairs of nondeterministic transitionsn decreases.
4 Bounded-Lookahead Extended A u t o m a t a We now know hot to eliminate nondeterminism from a location I G Lg. Then, to eliminate the nondeterminism globally from S, one should iterate det{S, I) for all I £ Ls- However, local determinisation creates new locations, which may themselves be nondeterministic and have to be determinised, which may give rise to yet another set of nondeterministic locations, etc. This raises the question of whether the global determinisation process ever terminates. In this section we define a global determinisation procedure that we show to terminate exactly for the class of bounded lookahead extended automata. Intuitively, an automaton is deterministic with lookahead n if any nondeterministic choice can be resolved by looking n actions ahead. Definition 8 (bounded lookahead). An automaton S = {V,0,L,q°,E,T) has lookahead n £ N in a state q € Q[s] if Vui, <72 € T""^ . q -^ Aq -^ Atrace{ui) = trace{a2) => first{ai) = first{a2). The automaton has lookahead n in a set Q' C Q^gj of states if it has lookahead n in every q G Q'. Finally, S has bounded lookahead if, for some n GN, S has lookahead n in the whole set Q/sjWe shall find it convenient to define the lookahead of a location of an automaton. Definition 9 ((smallest) lookahead in location). An automaton S has lookahead n in location I G L if S has lookahead n in the set {{l,y)\v G V}. S has smallest lookahead n G N in a given location I if it has lookahead n in I, and does not have lookahead n — 1 in I. We denote by look{l,S) G N the smallest lookahead of location I in S (if it exists), otherwise, look{l,S) ^ oo. For example, the automaton depicted in the left-hand side of Figure 3 has look = 1 in /o, because, when e occurs, the left-hand side a-labeled transition must have been fired, but when b occurs, the right-hand side a-labeled transition has been fired. On the other hand, the automaton depicted in the left-hand side of Figure 4 does not have look = 1 in /Q, because the occurence of b does not reveal which of the a-labeled transitions was fired. However, the following action (either c or d) reveals all the past trace, hence, look = 2 in ^o for the given automaton.
204
T. Jeron, H. Marchand, and V. Rusu
Fig. 3. Inherited nondeterminism may not decrease global lookahead.
Fig. 4. Created nondeterminism has decreased global lookahead. Definition 10 (global lookahead). look{S) =
maxi^ig{look[l,S)}.
Clearly, a location I is deterministic in an automaton S iff look{l,S) = 0; and the automaton S itself is deterministic iff look{S) = 0. The following proposition says that the lookahead of an automaton does not increase by local determinisation. Proposition 1 (Global lookahead does not increase). look{det{S,1)) < look{S). The following examples show that look{S) may or may not decrease with local determinisation. Consider the automaton on the left-hand side of Figure 3, which has global lookahead 1. Determinising in IQ leaves the automaton in the right-hand side, which still has the same global lookahead! The determinisation in IQ in Figure 4, however, decreases the global lookahead of the automaton from 2 to 1.
Symbolic Determinisation of Extended Automata
205
The diflerence between these situations is the following: in Figure 3, the determinisation step has merged the nondeterministic location I2 into the new location (^0, (^ii'2)), hence, the resulting automaton has inherited (in a sense that will be made precise below) the nondeterminism that I2 had; because of that nondeterminism, the global lookahead has not decreased. On the other hand, the determinisation step in Fig. 4 does not have this problem: both h, h are deterministic, and, even though the new location (^o, (^ii '2)) is nondeterministic, the nondeterminism is createdhy the fact that /i, I2 bring one 6-labeled transition each. Definition 11 (created/inherited nondeterminism). LetS he an extended automaton andti,t2 be two transitions of S involved into a nondeterminism in °*i = °t2 = °- ^^t {°! (dfiidta)) be the new location resulting from the determinisation det2{S,ti,t2), and assume that (o, {dtj,dt2)) is nondeterministic in det2{S,ti,t2). We say that this nondeterminism is created if both dtj, dj^ are deterministic in S, otherwise, the nondeterminism is inherited. Now, consider a global determinisation procedure that performs local determinisation steps in a breadth-first order: the first iteration determinises the nondeterministic locations of the original automaton, and each subsequent iteration determinises the new nondeterministic locations, generated during the iteration that preceded it. Figure 3 also illustrates the first iteration of such a breadth-first procedure on the automaton in the left-hand side. The resulting automaton is depicted on the right-hand side. Both automata have the same global lookahead = 1 . Hence, the lookahead cannot be used as a decreasing measure to ensure the termination of the procedure. Even worse, applying local determinisations in a depth-first order (i.e., determinising new nondeterministic locations as soon as they are created) may not terminate, even when the automaton has bounded lookahead. An example is shown in Figure 5: the automaton in the left-hand side has global lookahead 1, and, by determinising in IQ, one obtains the automaton depicted in the right-hand side of the figure, which contains a sub-automaton isomorphic the automaton in the left-hand side, with global lookahead still 1. After determinising in the newly created location, the sub-automaton is still there, and remains present all through the process of depth-first determinisation, which, in this case, clearly does not terminate. Hence, applying local determinisation steps in depth-first or in breadthfirst order does not lead, in general, to a terminating global determinisation procedure. However, Proposition 2 below shows that if an iteration of a breadth-first procedure only gives rise to created nondeterminism, the global lookahead does decrease. Proposition 2 (Global lookahead decreases if all new nondeterminism is created). LetS' be an automaton obtained by determinising all nondeterministic locations {li,.. .Ik} of an automaton S in an arbitrary order, (i.e., So = S,
206
T. Jeron, H. Marchand, and V. Rusu
Fig. 5. Depth-first determinisation may not terminate. \/i < k — 1, Si+i = det{Si, U), and S' = Sk)- If none of these local determinisation steps gave rise to inherited nondeterminism, then look{S') < look(S). To ensure that all new nondeterminism is created, one must determinise locations whose direct successors are deterministic. But now we are faced with another difficulty: if the automaton has cycles in which every location is nondeterministic, it is impossible to choose a location on the cycle to start determinising with! This will lead us to "breaking" such cycles by determinising one location on each of them. Definition 12. A location V is a direct successor of a location I in S if there exists t £ Ts such that Of = I and dt = I'• A cycle is a sequence c = ti • h' • -in € T* such that Vi = 1 , . . . n — 1, dj. = Ot^^j, and dt„ = Ot^. The cycle is elementary if moreover Vi, j = 1 , . . . n — 1, z < j => dt^ ¥" '^u holds. We say I £ c if 3i £ {l,...n}.l = djj, denote by C{S) the set of cycles of S, and by
C{S,l) =
{ceC{S)\lec}.
Definition 13 (nondeterministic cycle). A cycle c is nondeterministic if VI G c, I is nondeterministic. We denote by N'iS) the set of nondeterministic cycles of S. Lemma 1. For S an automaton and all locations I G Ls, C{det(S,l),l) fl N{det{S, I)) = 0, and Vc' GC(S).C' i 0(3, /) A c' ^ Af{S) ^ d G C{det{S, I)) \ J\f{det{S,l)). Proof. For the first statement, note that / is deterministic in det{S,l), hence, by definition, a cycle c G C{det{S, I), I) cannot be nondeterministic in det{S, I), i.e., it cannot be in Af{det{S,l)). For the second statement, the left-hand side of the implication means that the cycle c' G C{S) does not visit I, but visits some other location I' which is deterministic in <S. Determinisation in I leaves c' unchanged, thus, c' G C{det{S,l)), and /' is still deterministic in det{S,l), hence, c' ^ Af{det{S,l)).D
Symbolic Determinisation of Extended Automata
207
Lemma 1 says that cycles visiting I in det{S, I) are not nondeterministic, and cycles c' that do not visit I and that are not nondeterministic in S are still not nondeterministic cycles of det{S,l). The consequences are that determinising one location per elementary nondeterministic cycle generates an automaton without any nondeterministic cycles, and determinisation does not add new nondeterministic cycles. We now introduce our global determinisation procedure (Fig. 6), which starts by "breaking" all elementary nondeterministic cycles, by determinising one location on each. Procedure det{S) while C ~ {ce A^(>S)|c elementary} ^ 0 do choose c & C; choose / G c; iS := det{S,l) endwhile n := 0; S„ := S while Sn is nondeterministic do while L' := {I G Ls„ 15!^ is nondeterministic in i} ^ 0 do L" := {/' € L'\S'„ is deterministicin all direct successors of I'}) choose I (z L S'n:= det{S'n,l) endwhile Sn •= S'n; n •.= n+l endwhile
return Sn-
Fig. 6. Global determinisation procedure det{S)
Theorem 1 (termination, sufficient condition). det{S) terminates
iflook{S)<
oo.
Proof. By Lemma 1 and Proposition 1, the elimination of nondeterministic cycles (first while loop in Figure 6) terminates and does not increase look{S). Consider the sets L" C L' computed at each new iteration of the inner (third) while loop. Note that V ^ % and L" = 0 implies that there exists a nondeterministic cycle in <S„. Indeed, assume /i G L', then L" = 0 imphes h ^ L", which implies that h has a direct successor h € Lg^ where S'^ is also nondeterministic, which implies again l^ G L'. The process continues, and we eventually build a nondeterministic cycle in <S„, which is impossible since all nondeterministic cycles were eliminated. Inside the inner while loop, L' ^ 0, and by the above reasoning, L" ^ 0. Hence, the choose I operation (from L") inside the loop is always possible, and then determinising in location I decreases the cardinal of L' by one. Since L'
208
T. Jeron, H. Marchand, and V. Rusu
is finite {L' C Lg^) and its cardinal decreases, eventually L' — % and the inner while loop terminates. L' = 0 also means that at the end of the inner while loop, iS^ is deterministic in all locations Ls„, hence, nondeterministic locations in S'^ are new. For termination of the outer while loop, we prove look{Sn+i) < look{Sn)We know that after the inner loop, the nondeterministic locations in S'^ are new (in Ls' \ Ls„) and cannot have inherited nondeterminism, because they were generated by determinising locations in L", whose direct successors are, by construction, deterministic. Finally, by Proposition 2, look{S'n) < look{Sn), and iS„+i becomes S'^ after n is incremented, and the proof is done. • The fact that bounded lookahead is necessary for termination is based on: Proposition 3 (/oo^ decreases by at most 1).
look{det2{S,ti,t2))'>look{S)—l.
Then, a finite sequence of det2Q operations cannot decrease lookahead from oo toO: Theorem 2 (necessary condition). / / det{S) terminates then look{S) < oo. This concludes the study of the procedure's termination. It also preserves traces: Theorem 3. If det{S) terminates then Traces{det{S)) — Traces{S). The determinisation procedure can be improved using approximate reachability analysis. Assume that an over-approximation Reach" 3 Reach{S) of the reachable set of states is known (e.g., by abstract interpretation). Moreover, assume that this set is described using a formula in the same logic as the automaton's guards, which we have assumed to be decidable for satisfiability (cf. Section 2). Then, Definition 5 of a deterministic extended automaton can be weakened, by requiring that Reach" A Gtj A Gf^ be unsatisfiable (instead of Gti A Gt2 unsatisfiable). This new definition of determinism increases the subclass of extended automata on which the determinisation procedure terminates. The procedure now terminates for automata satisfying a modified definition of bounded lookahead, which, intuitively, requires only states in the set Reach" (instead of Qisj) to have bounded lookahead. Checking for Bounded Lookahead The bounded lookahead condition is clearly undecidable for extended automata. We now give a sufficient criterion for this condition. We need a notion of product of extended automata: Definition 14 (Synchronous Product). For j = 1,2, the extended automata Sj = {Vj,0j,Lj,l^,Sj,Tj) are compatible »/Vi n V2 = 0 and Si — S2. The synchronous product S = iSi||iS2 of two compatible automata <Si,<52 is the automaton {,VO,L,l°,S,T) with: V = Vi U V2, 9 = Oi A 02, L = Li x L2, l'^ = (l^, I2), S = Si = S2, and the set T of transitions of the composed system is the smallest set defined by the rule: ti : {li,a,Gi,Ai,l[)
g Ti
^2 : {h,a,G2,A2,l'2)
t:{{hj2),a,GiAG2,AiUA2,{l[,l'2))^'^
€ T2
Symbolic Determinisation of Extended Automata
209
Then, the bounded lookahead condition for an extended automaton can be equivalently formulated as follows. Consider an extended automaton S = {V,&,L,l°,E,T), and let the primed copy S' of S be the automaton obtained by "priming" all the components of S except the alphabet E, i.e., S' = {V',G',L',l'°,S,T'), where V = {v'\v G V}, L' = {l'\l e L}, and for states q' = {{l,v))' = {V,v') where v' is the same valuation as v, but for variables V, i.e., Vx' e V, v'{x') ^ v{x). Proposition 4 (checking for bounded lookahead). An extended automaton S has bounded lookahead iff, for all q,qi,q2 & Q[si and distinct transitions ti,t2 € Ts with atj = ajj, if q -^s ! A g -^s Q2 then there exists no infinite execution in S\\S starting from (gi, q'2), where S' denotes the primed copy of S. The conditions of Proposition 4 are decidable if S is finite-state but are not decidable in general. For infinite-state extended automata <S, we can build finitestate abstractions S" that simulate the transition sequences cr of 5 (i.e., whenever q -^ q' holds in S, a{q) -^ a{q') holds in S"). The bounded lookahead conditions of Proposition 4 can be then automatically checked on <S", and, if they hold, the simulation property guarantees that they also hold on S. This gives a sufficient criterion for bounded lookahead, which is, in general, not necessary {S" may contain cycles not present in S), and whose precision can be improved by taking more precise abstractions S".
5 Applications of Determinisation Verification A standard verification problem is that of trace (or language) inclusion: given two systems J (the implementation) and S (the specification), decide whether Traces{X) C Traces{S). When T, S are extended automata and <S is deterministic, the problem reduces to a reachability problem in the extended automaton X||i5, where S is obtained from S by adding a new location fail ^ L, and for each I G L and a G 17, a new transition with origin I, destination fail, action a, identity assignments, and guard At:(i,a,Gt,At,i')er'~'^t- '^^^ ^^"^ transitions allow actions in S whenever they are not allowed in S. Hence, when S is deterministic, Traces{I) C Traces(S) iff no location in the set {{l,fail\l € L^)} is reachable in I\\S. When S is not deterministic, the above statement is incorrect. Let S be the nondeterministic automaton in the left-hand side of Figure 3. A naive application of the completion operation on S builds a transition labeled b from h to fail, suggesting that a • & is not a trace of S, which is obviously false. In particular, verification would wrongly declare erroneous an implementation that exhibits the trace a • b. Hence, to be adequate for verification, S has to be determinised before being completed.
210
T. Jeron, H. Marchand, and V. Rusu
Conformance Testing Conformance testing is a functional testing that consists in comparing a black-box implementation J to a formal specification S according a conformance relation. The implementation is a black box, i.e., only its interface (input and output alphabet) is known. In [5] we show that conformance of an implementation 5 to a specification according to the standard ioco relation [6] is equivalent to the fact that running a canonical tester in parallel with the implementation never reaches a certain set of locations. The tester can be automatically computed from the specification using operations similar to the completion operation, defined above, and, of course, determinisation. Without determinisation, the tester might wrongly declare non-conformant an implementation that is conformant to the specification (a phenomenon similar to that exhibited by the trace a • b, noted in the previous paragraph). Fault Diagnosis The determinisation problem for extended automata also has a close relationship with diagnosis for discrete event systems [7]. For instance, an extended automaton with bounded lookahead can be seen as an automaton in which nondeterministic choices are diagnosable; and checking membership to the class of bounded lookahead automata can be reduced to a diagnosability problem in this model. Also, the sufficient criterion for bounded lookahead (around Proposition 4) was inspired by the algorithm used to check diagnosability [8], based on the search of specific cycles in a product of the specification with itself. Conversely, it could be profitable to re-define diagnosability in terms of our bounded lookahead condition, in order to capture a notion of diagnosability for richer, infinite-state models. Finally, the construction of a diagnoser from an automaton specifying a plant and a fault model is based on determinisation: one has to determinise the plant "decorated" with past occurrences of (unobservable) faults. Our determinisation procedure then constitutes a basic block for the construction of diagnosers from plants specified as extended automata, thus extending the works on diagnosis to expressive, infinite-state models.
6 Conclusion, Related Work, and Future Work In this paper we present a determinisation procedure for extended automata and prove that the procedure terminates exactly for the class of extended automata with bounded lookahead. The intuition behind this class is that in any location, for any trace, there exists a bounded number of steps after which the first transition taken is uniquely identified. Technical difficulties for proving termination arise from the fact that the order in which elementary determinisation steps are applied has a strong infiuence on termination. The main dificulty was to find an adequate order, for which the bounded lookahead provides a decreasing measure. The models of extended automata considered in this paper only have observable actions. One can also consider models with internal (unobservable) actions.
Symbolic Determinisation of Extended Automata
211
In this case, determinisation first consists in an extended e-dosure generalising that of finite automata. The extended e-closure algorithm is then based on the propagation of guards and actions onto the next transitons labeled by observable actions [9], and terminates iff there are no cycles of transitions labeled by internal actions. The present work was initially motivated by conformance testing, more specifically, model-based testing based on the ioco theory [6]. In this framework, off-line test generation (computation of test cases from specifications) involves determinising the specification in order to compute the next possible observable actions after each trace, and, therefore, to obtain deterministic test cases [10]. In that work, we consider an extension of the model presented here (actions are either inputs or outputs and may carry communication parameters), which can be handled by a small modification of our determinisation procedure. The procedure also has potentially interesting application in the verification and diagnosis of infinite-state systems. An alternative approach, which is also used in conformance testing and in fault diagnosis, is on-the-fly determinisation of a bounded number of transitions of a (basic, symbolic, or timed) automaton, starting from the initial state [6, 11, 12]. In this case, the problems related to termination disappear, because the number of determinisation steps is finite and defined in advance by the bounded exploration depth. However, this approach cannot be used for constructing canonical testers, which we found to be a useful object, and cannot be used for proving trace inclusion.
References 1. John E. Hopcroft, Rajeev Motwani, and Jeffrey D. Ullman. Introduction to Automata Theory, Languages and Computability. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2000. 2. Rajeev Alur and David L. Dill. A theory of timed automata. Theoretical Computer Science, 126(2):183^235, 1994. 3. T. Jeron, H. Marchand, and V. Rusu. Symbolic determinisation of extended automata. Technical Report 1176, IRISA, February 2006. 4. Greg Nelson and Derek C. Oppen. Simplification by cooperating decision procedures. ACM Trans. Program. Lang. Syst, l(2):245-257, 1979. 5. Vlad Rusu, Herve Marchand, and Thierry Jeron. Automatic verification and conformance testing for validating safety properties of reactive systems. In Formal Methods 2005 (FM'05), volume 2805 of LNCS, pages 223-243, 2005. 6. Jan Tretmans. Test generation with inputs, outputs and repetitive quiescence. Software - Concepts and Tools, 17(3):103-120, 1996. 7. M. Sampath, R. Sengupta, S. Lafortune, K. Sinnamohideen, and D. Teneketzis. Failure diagnosis using discrete event models. Proceedings of the IEEE Transactions on Automatic Control, 4(2): 105-124, 1996. 8. S. Jiang, Z. Huang, V. Chandra, and R. Kumar. A polynomial time algorithm for diagnosability of discrete event systems. IEEE Transactions on Automatic Control, 46(8);1318-1321, August 2001.
212
T. Jeron, H. Marchand, and V. Rusu
9. Elena Zinovieva. Methodes symboliques pour la generation de tests de systemes reactifs comportant des donnees. PhD thesis, Univ. of Rennes, Nov. 2004. 10. B. Jeannet, T. Jferon, V. Rusu, and E. Zinovieva. Symbolic test selection based on approximate analysis. In Tools and Algorithms for the Construction and Analysis of Systems (TACAS'05), volume 3440 oi LNCS, 2005. 11. T. Jeron and P. Morel. Test generation derived from model-checking. In Computer-Aided Verification (CAV'99), volume 1633 of LNCS, pages 108-122, 1999. 12. Moez Krichen and Stavros Tripakis. Black-box conformance testing for real-time systems. In SPIN'04, volume 2989 of LNCS, pages 109-126, 2004.
Regular Hedge Model Checking Julien d'Orso^ and Tayssir Touili^ ^ University of Illinois at Chicago, dorso91iafa.jussieu.fr ^ LiAFA, CNRS & Univ. of Paris 7. touilieiiafa.jussieu.fr Abstract. We extend the regular model checking framework so that it can handle systems with arbitrary width tree-like structures. Configurations of a system are represented by trees of arbitrary arities, sets of configurations are represented by regular hedge automata, and the dynamics of a system is modeled by a regular hedge transducer. We consider the problem of computing the transitive closure T"*" of a regular hedge transducer T. This construction is not possible in general. Therefore, we present a general acceleration technique for computing T^ • Our method consists of enhancing the termination of the iterative computation of the different compositions T* by merging the states of the hedge transducers according to an appropriate equivalence relation that preserves the traces of the transducers. We provide a methodology for effectively deriving equivalence relations that are appropriate. We have successfully applied our technique to compute transitive closures for some mutual exclusion protocols defined on arbitrary width tree topologies, as well as for an XML application.
1 Introduction Regular Model Checking has been proposed as a general and uniform framework to analyse infinite-state systems [21, 28, 12, 7]. In this framework, configurations are represented by words or trees, sets of configurations by regular finite word/tree automata, and the transitions of the system by a regular relation described by a word/tree transducer. A central problem in regular model checking is to compute the transitive closure of a regular relation given by a finite-state transducer. Such a representation allows to compute the set of reachable configurations of a system (thus enabling verification of safety properties) as well as to detect loops between configurations if the transformations are structure preserving (thus enabfing verification of liveness properties) [12, 6]. However, computing the transitive closure of a transducer is not possible in general since the transition relation of any Turing machine can be represented by a regular word transducer. In fact, the major problem in regular model checking is that a naive computation that consists in iteratively computing the different compositions T* of a transducer T does not terminate in general. Therefore, a main issue in regular model checking is to define general acceleration techniques that will force the above iterative procedure to terminate for many practical applications. Please use the following format when citing this chapter: d'Orso, J., Touili, T., 2006, in International Federation for Information Processing, Volume 209, Fourth IFIP International Conference on Theoretical Computer Science-TCS 2006, eds. Navarro, G., Bertossi, L., Kohayakwa, Y., (Boston: Springer), pp. 213-230.
214
J. d'Orso and T. Touili
During the last years, several authors addressed this issue. (1) First in the case of regular wore? model checking where configurations are encoded as words. These works have been successfully applied to reason about linear parametrized systems (i.e., parametrized systems where the processes are arranged in a linear topology) [12, 23, 19, 13, 25, 3, 4], as well as systems that operate on linear unbounded data structures such as lists, integers, reals, and even hybrid automata [5, 11, 6], and programs with pointers [9]. (2) Then in the case of regular tree model checking where configurations are represented by trees of arbitrary sizes (but fixed arities). These works have been applied to the analysis of parametrized systems with tree topologies [17, 19, 2, 1], and multithreaded programs [22, 17, 14, 8, 26]. In this paper, we develop the regular model checking paradigm further, and consider the more general case of regular hedge model checking, where configurations are represented by trees of arbitrary arities. Indeed, arbitrary width tree-like structures are very common and appear naturally in many modeling and verification contexts. We can mention at least three examples of such contexts: - XML documents can be modeled by unranked trees whose nodes are labeled with the tags of the document [29, 24]. For example, a document having n pages, where page i has ki paragraphs can be represented by a tree whose root has n children, and where the i*'' child has fcj children. Since the number of pages and paragraphs in a document are arbitrary, unranked trees are necessary to represent such documents. Then, transformations on XML documents such as XSLT can be represented by relations on unranked trees. - Configurations of multithreaded recursive programs can also be represented by unbounded width trees where the leaves are labeled with the control points of the program and the inner nodes with the sequential and the parallel operators • and II. For example, a term | | ( i i , . . . ,in) represents a configuration where the terms i i , . . . ,i„ are in parallel. Since the number of parallel processes can be arbitrarily large, we need unbounded width trees to accurately represent such configurations. Then, actions of the program such as procedure calls, launching of new threads, synchronisation statements, etc, can also be represented by relations on unranked trees [15, 16]. - Many parametrized protocols are defined on tree topologies with unbounded width. Indeed, in the case of tree networks, the number of processes and the topology of the network (including the arities of the different nodes) are not fixed. In this case, labeled trees of arbitrary width and height are needed to represent configurations of tree networks of arbitrary numbers of processes: each vertex in a tree corresponds to a process, and the label of a vertex is the current control state of its corresponding process. Typically, actions in such parametrized systems are communications between processes and their sons or fathers. These actions correspond in our framework to tree relabeling relations (transformations which preserve the structure of the trees). Examples of such systems are multicast protocols, leader election protocols, mutual exclusion protocols, etc.
Regular Hedge Model Checking
215
We use hedge automata [18] to symbolically represent infinite sets of unranked trees, and hedge transducers to model transformations on these trees. Then, as in the case of regular word and tree model checking, the central problem is to compute the transitive closure of a hedge transducer T. Our aim is then to define general techniques which can deal with different classes of relations, and which can be applied uniformly in many verification and analysis contexts such as those mentioned above. The main contribution of this work is the definition of a general acceleration technique on relabeling hedge transducers (tranducers that preserve the structure of the trees). Our technique works as follows: To enhance the termination of the iterative computation of the different compositions T ' , we merge equivalent states using an appropriate equivalence relation, i.e., an equivalence relation that preserves the traces of the transducers (for which collapsing two states does not add new traces to the transducers). The main problem amounts then to defining and computing appropriate equivalences. We provide a methodology for deriving such equivalence relations. More precisely, we consider equivalence relations induced by two simulation relations, namely a downward and an upward simulation, both defined on hedge automata. We give sufficent conditions on the simulations that guarantee appropriateness of the induced equivalence. Furthermore, we define effectively computable downward and upward simulations for which the induced relation is guaranteed to be appropriate. We have successfully applied our technique to compute transitive closures of some mutual exclusion protocols defined on arbitrary width tree topologies. We were also able to handle an XML application. This effort is reported in Section 6. Related work. There are several works on efficient computation of transitive closures for word transducers [12, 19, 25, 5, 11, 6, 4] and tree transducers [17, 2, 1]. However, these works only consider trees where the arities are fixed, whereas our framework allows to consider ranked as well as unranked trees. In fact, our technique can be seen as an extension of the approach used in [1] to hedge transducers. Note that arbitrary arities make this extension nontrivial. In particular, the transition rules of the collapsed hedge transducer under construction make use of regular languages over classes of tuples, these classes themselves being potentially regular languages. This nesting of languages is delicate to manipulate. More recently, hedge automata have been used to compute reachability sets of some classes of transformations, namely Process Rewrite Systems (PRS) [15] and Dynamic Pushdown Networks (DPN) [16]. Compared to our work, these algorithms compute the sets of the reachable states of the systems, whereas we consider the more general problem of computing the transitive closure of the system's transducer. Moreover, our technique is general and can be uniformly apphed to all the classes of relabeling transformations, whereas the algorithms of [15, 16] can only be applied to the specific class of PRS or DPN. Outline. In Section 2, we give the definitions of hedge automata and transducers, and show how the i*'' iterations for a relabeling hedge transducer can be
216
J. d'Orso and T. Touili
effectively computed. In Section 3, we describe our general semi-algorithm. In Section 4, we define relations ~ induced by downward and upward simulations, and give sufficient conditions ensuring that ~ is an appropriate equivalence relation. We provide in Section 5 an effectively computable example of such an equivalence. Finally, in Section 6, we show some examples on which we applied our technique.
2 Hedge automata and transducers 2.1 Terms Let E be an unranked alphabet and rf be a fixed denumerable set of variables {a;i, X2,...}. The set Ts[Af] of terms over S\J X is the smallest set such that:
-
S\JX(ZTs\X],
- if / 6 r , i i , . . . ,i„ G
TE[X]
for some n > 1, then f{ti,...
,^„) £
TE[X].
Terms without variables are called ground terms. Let Tj; be the set of ground terms over S. A term t in T^[<^] is linear if each variable occurs at most once in t. A context C is a linear term of T^[A']. Let i i , . . . ,i„ be terms of Ts, then C [ t i , . . . ,i„] denotes the term obtained by replacing in the context C the occurrence of the variable Xj by the term ti, for each 1 < i < n. As usual, a term in Tjjf/f] can be viewed as a rooted labeled tree u where the leaves are labeled with variables or elements in S, and every internal node N with a symbol A(A'") G S, where A is the labeling associated to u. 2.2 Hedge automata To finitely represent infinite sets of terms, we use hedge automata [18]: Definition 1. A Hedge automaton is a tuple A = {Q,S,F,S) where Q is a finite set of states, E is an unranked alphabet, F C Q is a set of final states, and 6 is a set of rules of the form f{L) —> q, where f G S, q € Q, and L C Q* is a regular word language over Q. A is deterministic if for every f € E, if 5 contains two rules f[Li) —+ qi and f{L2) —> 92, then Li D L2 = 0. We define a move relation —>s between ground terms in T^uQ as follows: for every two terms t and t', we have t —>s t' iS there exist a context C and a rule r = / ( L ) -^ q e S such that t = C f{qi{ti),... ,g„(i„)) , qi • • • qn & L, and
t' =
c[q{fit,,...,tn))
Let —»5 denote the reflexive-transitive closure of —>j. A ground term t &Ts is accepted by a state q\it —>5 q{t). Let Lq = {t\t -^s
Regular Hedge Model Checking
217
The language of A, denoted by L{A), is the set of all ground terms accepted by A. A set of terms £ over E is hedge regular if there exists a hedge automaton A such that £ = L{A). Intuitively, given an input term t, a run of ^ on t according to the move relation —*s can be done in a bottom-up manner as follows: first, we assign nondeterministically a state q to each leaf labeled with symbol / if there is in S a rule of the form f{L) —> q s.t. e £ L. Then, for each node labeled with a symbol g, and having the terms ti,... ,t„ as children, we must collect the states qi,...,qn assigned to all its children, i.e., such that ti —>5 qi{ti), for 1 < i < n, and then associate a state q to the node itself if there exists in 5 a rule r = g{L) -^ q such that qi- • • q-n £ L. A term t is accepted if A reaches the root of i in a final state. Theorem 1. [18] The class of Hedge automata is effectively closed under determinization and under boolean operations. Moreover, the emptiness problem for Hedge automata is decidable. 2.3 Relabeling hedge transducers and relations Definition 2. A Relabeling Hedge Transducer is a tuple T = (Q, E, F, A) where Q is a finite set of states, S is an unranked alphabet, F C Q is a set of final states, and A is a set of rules of the form f{L) -^ q{g), where f,g £ S, q £ Q, and L C Q* is a regular word language over Q. As for hedge automata, a relabeling hedge transducer defines a move relation —>/i between ground terms in TSUQ as follows: for every two terms t and t', we have t —>4 t' iff there exist a context C and a rule r = f{L) —> q{g) £ A such tha.tt = C f{qi{ti),...,qn{tn))
, qi-• • qn ^ L, a.nd t'= C q{g{ti,...
,tn)) •
Let —»/i denote the reflexive-transitive closure of —>/i. The transducer T defines the following relation between unbounded width trees: Rr = {{t,t') £ TE X Ts \ t —>A lit'), for some q £ F}. Note that RT is structure preserving, i.e., if {t,t') £ RT, then t and t' correspond to two different labelings of the same skeleton tree. Remark 1. Let / and g be two letters in E. We represent the pair (/, g) by f /g. Let t and t' be two terms corresponding to different labelings Ai and A2 of the same underlying tree u. We define the term t/t' as the labeling A3 of u such that for every node N of u, XsiN) = Ai(Af)/A2(iV). A relabeling hedge transducer T = {Q, E, F, A) can be seen as a hedge automaton A = (Q, E x E,F, 5) over the alphabet E x E, where 6 is the set of rules f/g{L) —» q s.t. f{L) —» q{g) £ A. Then it is easy to see that L{A) = {t/t'\it,t')£Rr}. A relation R over Ts is hedge regular if there exists a relabeling hedge transducer T such that R = Rr- We denote by R^- the composition of Rr,
218
J. d'Orso and T. Touili
n times. As usual, R^ = Un>i-^r denotes the transitive closure of Rr- Let L C TE he a. hedge tree language. Then, we define the set Rr{L) = {t' £ E \ ^teL,{t,t') GRT}. We show in what follows that hedge regular relations are closed under composition, and that they preserve regularity of hedge languages. First, we need to define the product of regular word languages as follows: Definition 3. Let L i , . . . , L„ be n regular word languages over the alphabet Q. The product Li (8> • • • 0 I/„ is defined by: ii®--®L„ = {(9j,...,g^)---«,---,Ol9i---9reLi,l
- P F = P} X • • • X P^; -T = { ( ( p i , . . . , P „ ) , ( g i , . . . , g n ) , ( p i r - - - . K ) ) I {Pi^li^P'i) GTj}. Let A = {Qi,S, Pi, (5i) be a hedge tree automaton and T = {Q2, S, P2, A2) be a relabeling hedge transducer. Let B = {Q, E, F, 6) be the hedge tree automaton such that Q = QiX Q2, F = FiX F2, and 5 is the set of rules g{L) —> (gi, ga) such that there exists two rules / ( L i ) —> gi G (5i and / ( i a ) —> 92(5) S A2 such that L = Li (g) L2. Then we have the following: Lemma 1. L{B) =
Rr{L{A)).
Let T = {Q,E,F,A), and let the relabeling hedge transducer Tn = {Qn,E,Fn,An) defined as follows: Q„ = Q"', Fn — F'^, and Zi„ is the set of rules of the form f(L) -^ ( g i , . . . , qn){g) such that there exist in A rules of the form fi{Li) -^ gi(/i+i), 1 < i < n, s.t. fi = f, /„+i = 5, and L = Li®- • -^LnThen we can show that: Lemma 2. Pr„ = Rr-
3 Computing transitive closures Our goal in this work is to compute a relabeling hedge transducer that recognizes the transitive closure P ^ of a regular hedge relation Rr- Unfortunately, this is not possible in general since the transitive closures are not necessarily hedge regular. Therefore, our purpose is to propose a semi-algorithm that, in
Regular Hedge Model Checking
219
case of termination, computes a relabeling hedge transducer that recognizes the transitive closure Rlj. More precisely, starting from a relabeling hedge transducer T, we derive a transducer, called the history hedge transducer that characterizes the transitive closure R^. The set of states of the history transducer is infinite. To tackle this issue, we present a method (that is not guaranteed to terminate) for computing a finite-state transducer which is an abstraction of the history transducer, based on a notion of an equivalence relation on the states of the history transducer. The abstract transducer can be generated on-the-fly by a procedure which starts from the original transducer T, and then incrementally adds new states and transition rules, merging equivalent states. Let us first give the formal definition of the history hedge transducer: Definition 4. The history hedge transducer of a relabeling hedge transducer T = (Q, E, F, A) is the (infinite) transducer given by the tuple H = [QH, ^, FH, AH) such that: QH = [j Qn, FH = [j Fn, and AH = U ^nn>l
n>l
n>l
Since Rj- = Rr^ (Lemma 2), and by definition i?-H = U -Rr„, it follows n>l
that: T h e o r e m 2. R1^ = RHAs mentioned previously, Ti cannot be computed in general since it has an infinite number of states. To sidestep this problem, we will compute an equivalent smaller transducer 7i^ (that might be finite), obtained by merging the states oiJi according to an equivalence ~ on QH- This transducer is defined as H^ = (Q~, -S', F^, A^) such that: - Q^ = {g~ I q & QH}, where g^ denotes the equivalence class of the state q w.r.t. ~; - Fr^ = {g^ I q G FH} is the set of equivalence classes of FH w.r.t. ~; - A^ is the set of rules f{L^) —> s^{g) such that f{L) —> s{g) is a rule in AH, where L^ is obtained from L by substituting each state q by its equivalence class g^. We compute K~ iteratively according to the following procedure: 1. We compute successive powers of T: 7i-^, Ti-^, Ti-^,... (where H - ' = Uj;=i 'Fj) while collapsing states according to ~ . We obtain the sequence of transducers H^^, 'H^^ W^^,--2. If at step i we obtain that R^
220
J. d'Orso and T. Touili
4 Appropriate equivalences for hedge automata Let A = {Q,E,F,5) be a hedge automaton. We define in this section an appropriate equivalence ~ on the set of states Q such that L{A^) = L{A). To do so, we first define two simulation relations, namely a downward simulation =4down and an upward simulation =4up on Q, and then we show how to generate an appropriate equivalence ~ from these simulations. 4.1 Dow^nward and upward simulations We introduce here the notion of downward and upward simulation for hedge automata: Definition 5. [Downward Simulation] A binary relation =4down on Q is a downward simulation iff for any symbol f € S, for all states q,r G Q, we have: Whenever q =4down f, f{L) —* q G S, then for every states qi,...,qn G Q s.t. Qi- • •
own '^li • • • jQn "^down
' ' n ; and
ri • • • Tn & L .
It is easy to see that if q =4 down ^i then whenever a term t is accepted by state q (i.e., t —^s 9(0)i i* is also accepted by state r. Lemma 3. Let =4down be a downward simulation on Q. The reflexive closure and the transitive closure of =4down O-T^ both downward simulations. Furthermore, there is a unique maximal downward simulation on Q. Definition 6. [Upward Simulation] Given a downward simulation =4down on Q, a binary relation =4up on Q is an upward simulation w.r.t. =4down iff for any symbol f £ S, for all states qi,ri G Q, the following holds: Whenever qi =4up fi o.nd f{L) -^ q & S, then for every states g i , . . . , g„ G Q s.t. qi- • -qi- • -qn G L, there exist states r i , . . . , r„, r G Q and a rule f{L') -^ r in 5 such that qj 4down TJ, for j ^i,ri---rn& L', and q 4up r. It is easy to see that whenever g ^„p r, for every context C and every terms tx,... ,tn,t',t such that t = C[ti,... ,ti,t',ti+i,... ,in] and C[ti,...,ti,q{t'),ti+i,...,tn]
-^S S{t)
for a state s; then there exists a state s', s =4up s' such that: C[ti, ...,ti,
r{t'),ti+i, ...,tn]-^5
S'(t)
Lemma 4. Let =4down be a reflexive (transitive) downward simulation on Q, and let =4up be an upward simulation w.r.t. =4down- The reflexive (transitive) closure of =4up is also an upward simulation w.r.t. =4down- Furthermore, there is a unique maximal upward simulation on Q.
Regular Hedge Model Checking
221
4.2 Induced equivalence We define an equivalence relation derived from two binary relations: Definition 7. Two binary relations ^ i and :<2 are said to be independent iff whenever q ^i r and q •:<2 r', there exists s such that r •<2 s and r' -
4.3 Defining an appropriate equivalence Let A = [Q, a, F, 6) be a hedge automaton. Let =4down be a downward simulation, and let =^„p be an upward simulation w.r.t. =4down- Thanks to Lemmas 3 and 4, we suppose without loss of generality that =4 down and =4 up are reflexive and transitive. Let :
5 A n instance of an appropriate equivalence Let us now come back to our relabeling hedge transducer T = (Q, S, F, A) and its corresponding history transducer Ti = {QH-,S,FH,AH)We suppose that T is deterministic (this is not a restriction thanks to Theorem 1 and Remark 1). Recall that our purpose is to effectively compute an appropriate equivalence relation ~ on QH such that Liji.^) = Liji). We give in this section an example of a computable equivalence ~ on QH induced by a downward simulation =4down, an upward simulation w.r.t. ^down, and a relation ^ satisfying the conditions required in the previous section. First, we need to introduce the notion of copying states: Definition 8 (Copying States). Let q G Q be a state:
222
J. d'Orso and T. Touili
~ q is a prefix copying state iff for every term t: t^Aq{t')
ifft = t'
- q is a suffix copying state iff for every term t, context C, and qp G F: C[q{t)]^AqF{C'[t\)
iffC = C'
Let 5 be a set in QH X QH- We define the relation Rs generated by S as the smallest reflexive-transitive relation that contains S and that is a congruence with respect to product, i.e., if ( ( g i , . . . , ?„), {q'l,..., g^)) € Rs, then for any si,...,Sk,s[,...,s'i in QH, ( ( s i , . . . , Sfe, Q i , . . . , g„, s'l,..., s;), {si,...,Sk,q'i,...,q'ra,s[,...,
s'l)) G Rs
Lemma 6. If the set S is a downward (resp. upward) simulation on Q-H, then its generated relation :<s is also a downward (resp. upward) simulation. Let Qpref be the set of prefix copying states of T, and Qsuff be the set of suffix copying states of T that are not in Qpref- Let =4down be the binary relation on QH X QH generated by the set {{{Q,q),q),{q,{q,q))
Iq&Qpref}
We show that =4down is a downward simulation: Lemma 7. =4 down is a downward simulation. Let =4up be the binary relation on QH X QH generated by the set {{{Q,q),q),iq,iq,q))
\q&Qsuff}
Then we have: Lemma 8. =4up is an upward simulation w.r.t. =4downLet :<==4up- Then, we can show that :< and =4down are independent: Lemma 9. :< and =4down o,i^s independent. Let then ~ be the relation induced by =4down and ^ . We show that the conditions of Theorem 3 are satisfied: Lemma 10. Whenever x G FH and x =4up y, then y G FH- Moreover, if X & Fr^ and x € X, then x G FHIt follows then from Theorem 3 that: Theorem 4. L(K^) = L(W). Remark 2. Note that both ^^^down and =^„p are included in ~ (this is due to the fact that these relations are reflexive and symmetric). Now, it remains to show how can the equivalence ~ be effectively computed. For this, we need to compute the sets of copying states Qpref and QsuffThis is described next.
Regular Hedge Model Checking
223
Input: Hedge transducer T = (Q, E, F, A), and a state q. Begin d := {q} Repeat for each qi G d, and for each rule r = /(-L) —> g(gi), add {92 1 L n (Q*g2Q*) y^ 0} to rf. Until No more additions can be made End Output: "Yes" if all rules r encountered were copying (i.e. such that / == ff)"No" otherwise.
Fig. 1. Determining whether a state is prefix copying. 5.1 Computing copying states The algorithm for checking whether a state q is prefix copying is shown in Figure 1. Intuitively, the algorithm worlcs as follows: it tries to explore all rules r useful for computing the language of T with q as the only accepting state. If all such rules r are of the form / ( L i ) -^ fiQi), then q is indeed prefix-copying. Input: Hedge transducer T = (Q, E, F, A), and a state q. Begin up := {q}, side := 0 Repeat for each qi € up, and for each rule i• = fiL) -* 9{q2) such that L n (Q*q2Q*) / 0, then / q} to side. add 92 to up, and add {q' \ LD Q'q'Q')y^1>Aq' Until No more additions can be made End Output: "Yes" if all rules r encountered were copying (i.e. such that f = g) and all states in side are prefix-copying and there is a final state in up. "No" otherwise.
Fig. 2. Determining whether a state is suffix copying. The algorithm for checking whether a state q is suffix copying is shown in Figure 2. Intuitively, the algorithm explores all rules r leading from state q to a final state according to the move relation for T. We must first check that all rules r encountered are copying rules. However, the test performed until now only checks what lies on the path from q up to the root of an accepted context. Therefore, we need to also check what's happening to the child nodes along this root path. This is the purpose of the variable side. Any subtree attached to a
224
J. d'Orso and T. Touili
child of the root path is accepted by some state in side. Hence, we require that all states in side are prefix copying.
6 Applications In this section, we give the results of applying the procedure of Section 3 to the analysis of two mutual exclusion protocols defined on arbitrary width tree-like networks, and of an XML application. 6.1 The unranked simple token protocol We consider the example of the unranked simple token protocol, which is a mutual exclusion protocol defined on arbitrary width tree-like networks. Each process stores a single bit which reflects whether the process has a token or not. The process that has the token has the right to enter the critical section. In this system, the token can move from a leaf upward to the root in the following fashion: any process that currently has the token can release it to its parent. Initially, the system contains exactly one token, located anywhere. More formally, the passing of the token upward the tree can be represented by the following relabeling hedge transducer T = (Q, E, F, A) where Q = {qo,Qi,(l2}, ^ = {n,t}, F = {q2}, and A contains the rules: n{q*o) ^ qoin) (1) t{q*o) ^ qiin) (2) niQoQKlo) -^ 92(t) (3)
n{q*oq2q*o) -^ g2(n) (4)
The intuition behind the states of the transducer is the following. - State qo is meant to accepts all "pairs" of identical trees where the token doesn't appear. This is a prefix-copying state. - State qi is an intermediate state meaning that the current node released the token. Its parent then acquires the token. - State q2 is the final state of the transducer. It accepts all "pairs" of trees in which the token has moved one step upward. This is a suffix-copying state. According to the algorithm of Figure 1, we get Qpref = {qo}, and with the algorithm of Figure 2, we get Qsuff = {qs}Let us now apply the algorithm described in Section 3. We will compute the difi^erent iterations W^^,..., H^*. We terminate at step i if R^
Regular Hedge Model Checking
225
For example, rule (5) is obtained by composing rules (2) and (1). The resulting product is the rule t{{qo,qo)*) —> {qi,qo){n) (denoted (2)(8)(1) above). Since {qo,qo) =4down Qo {qo S Qpref) and 4downQ~ (Remark 2), we get that (QO^QO) ~ qo- Therefore, merging w.r.t. ~ , we get rule (5). Note that rule (7) has been simplified. Indeed, performing the product of the rules (4) and (3) yields the rule n{L) -^ 92~(t)i where L is the following regular word language: (go,?o)*(92,go)(go,9o)*(9o,9i)(go,9o)* + iqo,qo)*{qo,qi) {qo,qo)*iq2,qo){qo,qo)* + {qo,qo)*{q2,qi)iqo,qo)*- For the sake of brevity. We omit the first part of L since the states {q2,qo) and {qo,qi) are not reachable. Computing H^^: Take H^^ and add the following rules obtained as described previously: n(q^^{qi,qo)r.qU "^ (^2, 9l, ?o)^(n) (8) = (3)®(5) = (6)®(1) n(9S^(2,gi,go)~9o*~) ^ {q2,qi)^{n) (9) = (7)®(2) = (4)®(6) Computing W^"*: Take K^^ and add the following rule: n{q*o^{q2,qi,qo)^qo..) ^ (92,9i,9o)~(n) (10) = (9)0(1) = (4)®(8) The procedure terminates at step 4, since subsequent iterations do not change the accepted language. 6.2 The unranked two-way token protocol This mutual exclusion protocol is similar to the Simple Token Protocol above, with the following difference: the node that currently owns the token can release it to its parent neighbor, or it can release it to one of its child neighbors. Thus, the token can move upward, as well as downward inside the tree of processes. Formally, these transformations can be represented by the following relabeling hedge transducer T = {Q,E,F,A), where Q = {qo,qi,q2,q3}, ^ — {n,t}, F = {ga}, and A contains the rules: n(9o)-> 9oW (1) niq*o)^qi{t) (2) t(go*) ^ g2(n) (3) t(qoqiqo) -> qsin) (4) n{q^q2qo) ^ 93(0 (5) Hq^qsq^) -^ qsin) (6) The intuition behind the states of the transducer is as follows: - State qo accepts all "pairs" of identical trees where the token never appears. This state is prefix-copying. - State qi is the intermediate state denoting that the current node just acquired the token. Its parent neighbor releases the token. - State q2 is also an intermediate state. It means that the current node releases the token. The parent node acquires the token. - State qs is the final state. It accepts all "pairs" of trees in which the token has moved one step upward or downward. This state is suffix-copying. Computing H^^: Take T and replace occurences of a state in a rule of A with its equivalence class w.r.t. ~ . n{qU -> qo^{n) (1) n{qU ^ 91-^(0 (2) t{qU ^ 92~(n) (3) t{q^^qi^qU -^ g3~(n) (4) »^(9o~92-^go~) -^ 93~(i) (5) n(g^^g3~go~) -* g3~(n) (6)
226
J. d'Orso and T. Touili
Computing W^^. ^ake H^^ and add rules n{qU-^iqo,qi)^it) (7) n{qo^{qo,qi)r.qoJ -> {quq3)r~.{n) (8) t{q*o^{qi,q3)r.q*oJ - - 93~(n) (9) i(9o~)^fe,go)^(n)(10) n{qor.iq2,qo)r.qo^) ^ (g3,Q2)~(n) (11) n{q^^{q3,q2)r.qU ^ g3~(0 (12) t{qU^{'l2,qi)^{t) (13) ri(9o~(g2,gi)~9S-) ^ 93~(") (14) "(9o~(92,go)~go~(9o,9i)~gS~) -^ 93~(n) (14) ?^(9o~(9o,9i)~9o~(92,go)~9o^) ^ g3~(n) (14) n{qU^{qi,q2)^{n){l5) tiq^Uqi,q2)^qU -^ <73^(t) (16)
= ( 1 ®(2) = (2 0(4) = (4 ®(6) = (3: = (5 ®(3) = (6 0(5) = (3 0(2) = (5 0(4) = (5 0(4) = (5 = (2 0(3) = (4 0(5)
Computing Ti^^: Take H^^ and add rules (9o,9i,g3)~(n) n{qo^iqo,qi)^qoJ n{qo^{qo,qi,q3)r.qor.) (gi,93)~(n) (93,g2,9o)~(n) »^(9o~(92,9o)~go~) (?3,g2)~(n) "•(9S~fe>92,go)~9o-) 93-(n) n{qoM2,9o)~go~ (^o, 9i, g3)~Q5-) 93~(n) '^(95-(9o,gi,g3)~go~(Q'2,go)~9S~) 93-(n) '^(9o~(93,92, go)~g5~(9o, 9i)~9o~)
"(9o-(9o,9i)-go-(93,92,go)~gS-) -^ g3~(n)
(17 (18 (19 (20 (21 (21 (22
= = = = = = = (22 =
Computing Ti^^: Take ?i^^ and add rules n{qo^{qo,qi,q3)r^qo^) -» (go,gi,g3)-(n) ?^(Qo-(?3,g2,go)-go-) -^ (93,g2,?o)~(n) «(Q'S~(?3,?2,go)~gS-(9o,gi,g3)~g5-) ^ g3~(«) "(gS~(9o,«i,g3)~gS~(«3,g2,go)-gS-) ^ g3~(n)
23) 24) 25) 26)
(1)®(8) (2)0(9) (11)0(1) (12)0(3) (14)0(6) (14)0(6) (6)0(14) (6)0(14) = = = =
(1)0(18) (6)0(19) (6)0(21) (22)0(6)
The procedure terminates at step 4, since subsequent iterations have the same language. Note that some rules have been omitted if they contain unreachable states. Some redundant rules have been omitted as well, for the sake of simplicity. 6.3 An XML application Figure 3 represents an XML document that stores the informations about the clients of a store and the items they bought. Each client has four fields: name, address, the different items that were bought, and the status of the order, i.e., whether the order is treated or not. status is 1 if the order is being treated, 0 if it has not been treated yet, and 2 if its treatment is finished. Initially, the first client has status 1, and the others 0. This document can be represented by the tree of Figure 4. Note that we need here arbitrary-width trees since the number of clients and the number of bought items are arbitrary.
Regular Hedge Model Checking
227
name adflress status
items
Maria
bed
chair
fridge
closet
F i g . 4. The previous XML document as a tree
T h e store has a software t h a t t r e a t s the clients in the order they appear in the XML document. T h e effect of one action of the software consists in changing the status of the current client (resp. the next one) to 2 (resp. to 1) to
228
J. d'Orso and T. Touili
express that the treatment of the current client is over, and that now we moved to the treatment of the next chent. This transformation can be represented by the following relabehng hedge transducer r = {Q,S,F,A), where Q = {9i9iiQii9i')92,92i92'9/}; ^ — {9/}i ^ — S' ^ {name,address,item,items, status, client, clients, 1,0,2}, where Z" is a finite alphabet that corresponds to the names, addresses, etc, and that is not relevant for us in this application; and A contains the following rules: -
For every f G S, /(g*) ^ g(/); 1(e) —> 92(2): 1 is changed to 2; status{q2) —> q'2{status); client{q*q'2q*) —> q'^iclient); 0(e) —> gi(l): 0 is changed to 1; status{qi) —+ q[{status); client{q*q'lq*) —> q'l(client); clients{q*q2qiq*) —> qf- we make sure that the client whose " 1 " has been changed into "2" is adjacent in the document (and therefore in the tree) to the client whose "0" has been changed into " 1 " .
In order to check the behavior of this software, we need to compute the transitive closure r"*". Our technique terminates in this example and computes r"*". We skip here the details since they are similar to the previous examples.
7 Conclusion In this paper, we have extended the regular model checking framework so that it can handle systems with arbitrary width tree-like structures. Since the central problem in regular model checking is the computation of transitive closures of transducers, the main contribution of this paper is a general acceleration technique that computes the transitive closure of a given hedge transducer. The technique is based on defining and effectively computing an equivalence relation used to collapse the states of the transitive closure of the hedge transducer. We have successfully applied our technique to compute transitive closures for (1) some mutual exclusion protocols defined on arbitrary width tree topologies; and (2) XML document transformations. As future work, it would be interesting to see if one can extend our technique to handle non-structure preserving transducers. It would also be of interest to see if we can combine our simulation-based technique with other regular model checking techniques such as abstraction [11, 10] or learning [27, 20].
References 1. P. A. Abdulla, A. Legay, J. d'Orso, and A. Rezine. Simulation-based iteration of tree transducers. Proceedings of TACAS'05, 2005.
Regular Hedge Model Checking
229
2. Parosh Aziz AbduUa, Bengt Jonsson, Pritha Mahata, and Julien d'Orso. Regular tree model checking. In Proc. 14"' Int. Conf. on Computer Aided Verification, volume 2404 of Lecture Notes in Computer Science, pages 555-568, 2002. 3. Parosh Aziz Abdulla, Bengt Jonsson, Marcus Nilsson, and Julien d'Orso. Regular model checking made simple and efficient. In Proc. CONCUR 2002, 13*'' Int. Conf. on Concurrency Theory, volume 2421 of Lecture Notes in Computer Science, pages 116-130, 2002. 4. Parosh Aziz Abdulla, Bengt Jonsson, Marcus Nilsson, and Julien d'Orso. Algorithmic improvements in regular model checking. In Proc. 15"' Int. Conf. on Computer Aided Verification, volume 2725 of Lecture Notes in Computer Science, pages 236-248, 2003. 5. Bernard Boigelot, Axel Legay, and Pierre Wolper. Iterating transducers in the large. In Proc. 15*'' Int. Conf. on Computer Aided Verification, volume 2725 of Lecture Notes in Computer Science, pages 223-235, 2003. 6. Bernard Boigelot, Axel Legay, and Pierre Wolper. Omega regular model checking. In Proc. TACAS '04, lO"' Int. Conf. on Tools and Algorithms for the Construction and Analysis of Systems, Lecture Notes in Computer Science, pages 561--575, 2004. 7. A. Bouajjani. Languages, Rewriting systems, and Verification of Infinte-State Systems. In ICALP'OL LNCS 2076, 2001. invited paper. 8. A. Bouajjani, J. Esparza, and T. Touili. Reachability Analysis of Synchronised PA systems. In INFINITY'04. ENTCS, 2004. 9. A. Bouajjani, P. Habermehl, P. Moro, and T. Vojnar. Verifying programs with dynamic 1-selector-linked structures in regular model checking. Proceedings of TACAS'05, 2005. 10. A. Bouajjani, P. Habermehl, P. Moro, and T. Vojnar. Verifying programs with dynamic 1-selector-linked structures in regular model checking. In TACAS05, Lecture Notes in Computer Science, pages 13-29. Springer, 2005. 11. A. Bouajjani, P. Habermehl, and T. Vojnar. Abstract regular model checking. In CAVO4, Lecture Notes in Computer Science, pages 372-386, Boston, July 2004. Springer-Verlag. 12. A. Bouajjani, B. Jonsson, M. Nilsson, and T. Touili. Regular model checking. In Emerson and Sistla, editors, Proc. 12*'' Int. Conf. on Computer Aided Verification, volume 1855 of Lecture Notes in Computer Science, pages 403-418. Springer Verlag, 2000. 13. A. Bouajjani, A. Muscholl, and T. Touili. Permutation rewriting and algorithmic verification. In Proc. LLCS' 01 17*'' IEEE Int. Symp. on Logic in Computer Science. IEEE, 2001. 14. A. Bouajjani and T, Touih. Reachability analysis of process rewrite systems. In FSTTCSOS, Lecture Notes in Computer Science, pages 73-87, 2003. 15. A. Bouajjani and T. Touili. On computing reachability sets of process rewrite systems. In Proc. 16"' Int. Conf. on Rewriting Techniques and Applications (RTA '05), volume 3467 of Lecture Notes in Computer Science, April 2005. 16. Ahmed Bouajjani, Markus Miiller-Olm, and Tayssir Touili. Regular symbolic analysis of dynamic networks of pushdown systems. In CONCUR'05, LNCS, 2005. 17. Ahmed Bouajjani and Tayssir Touili. Extrapolating Tree Transformations. In Proc. 14*'' Int. Conf. on Computer Aided Verification, volume 2404 of Lecture Notes in Computer Science, pages 539-554, 2002. 18. A. Bruggemann-Klein, M. Murata, and D. Wood. Regular tree and regular hedge languages over unranked alphabets. Research report, 2001.
230
J. d'Orso and T. Touili
19. D. Dams, Y. Lakhnech, and M. Steffen. Iterating transducers. In G. Berry, H. Comon, and A. Finkel, editors, Computer Aided Verification, volume 2102 of Lecture Notes in Computer Science, pages 286-297, 2001. 20. P. Habermehl and T. Vojnar. Regular model checking using inference of regular languages. In Proc. of 6th International Workshop on Verification of Infinite-State Systems—Infinity'04, pages 61-72, Sept. 2004. 21. Y. Kesten, O. Maler, M. Marcus, A. Pnueli, and E. Shahar. Symbolic model checking with rich assertional languages. Theoretical Computer Science, 256:93112, 2001. 22. D. Lugiez and Ph. Schnoebelen. The regular viewpoint on PA-processes. In Proc. 9th Int. Conf. Concurrency Theory (CONCUR'98), Nice, France, Sep. 1998, volume 1466, pages 50-66. Springer, 1998. 23. A. Pnueli and E. Shahar. Liveness and acceleration in parametrized verification. In CAV'OO. LNCS, 2000. 24. H. Seidl, Th. Schwentick, and A. Muscholl. Numerical Document Queries. In PODS'OS. ACM press, 2003. 25. T. Touili. Regular Model Checking using Widening Techniques. Electronic Notes in Theoretical Computer Science, 50(4), 2001. Proc. Workshop on Verification of Parametrized Systems (VEPAS'Ol), Crete, July, 2001. 26. T. Touili. Dealing with communication for dynamic multithreaded recursive programs. In 1st VISSAS workshop, 2005. Invited Paper. 27. A. Vardhan, K.Sen, M. Viswanathan, and G. Agha. Actively learning to verify safety for FIFO automata. In FSTTCS04, Lecture Notes in Computer Science, pages 494-505, 2004. 28. Pierre Wolper and Bernard Boigelot. Verifying systems with infinite but regular state spaces. In Proc. 10th Int. Conf. on Computer Aided Verification, volume 1427 of Lecture Notes in Computer Science, pages 88-97, Vancouver, July 1998. Springer Verlag. 29. Silvano Dal Zilio and Denis Lugiez. Xml schema, tree logic and sheaves automata. In RTA '03, 2003.
Completing Categorical Algebras (Extended Abstract) Stephen L. Bloom^ and Zoltan Esik^* ^ Department of Computer Science Stevens Institute of Technology Hoboken, NJ 07030 ^ Institute for Informatics University of Szeged Szeged, Hungary, and GRLMC Rovira i Virgili University Tarragona, Spain
A b s t r a c t . Let £• be a ranked set. A categorical Z'-algebra, cZ'a for short, is a small category C equipped with a functor oc • C " s-C, for each a £ Sn, n >0. A continuous categorical X'-algebra is a cSa which has an initial object and all colimits of w-chains, i.e., functors N >-C; each functor ac preserves colimits of w-chains. (N is the linearly ordered set of the nonnegative integers considered as a category as usual.) We prove that for any cZ'a C there is an w-continuous cSa. C", unique up to equivalence, which forms a "free continuous completion" of C. We generalize the notion of inequation (and equation) and show the inequations or equations that hold in C also hold in C". We then find examples of this completion when - C is a cEa of finite Z'-trees - C is an ordered S algebra - C is a cZ'a of finite A-sychronization trees - C is a cSa of finite words on A.
1 Introduction Computer science is necessarily concerned with fixed point equations, and in finding settings in which fixed point equations may be solved. Such equations arise in well known ways, for example, in specifying b o t h the syntax and semantics of programming languages. In many examples, the setting is some kind of ordered algebra A with the properties t h a t A contains a least element J_, and w-chains, i.e., increasing sequences ao < ai < ... have least upper bounds. In this setting, the least solution of an equation X=
f{x),
* Partially supported by the National Foundation of Hungary for Scientific Research. Please use the following format when citing this chapter: Bloom, S.L., EsLk, Z., 2006, in International Federation for Information Processing, Volume 209, Fourth IFIP International Conference on Theoretical Computer Science-TCS 2006, eds. Navarro, G., Bertossi, L., Kohayakwa, Y., (Boston: Springer), pp. 231-249.
232
S. Bloom and Z. Esik
when / : A >• A preserves least upper bounds of w-chains may be found as the least upper bound of
±
e l s e x.
However, not all fixed point equations may be solved by means of least upper bounds. One example that plays an important role in the semantics of parallel computation is synchronization trees, see [Mil89, Win84]^ or [BE93]. For a fixed alphabet A, an ^-synchronization tree is a finite or countable rooted tree, in which every edge is labeled by a letter in A; the collection of these trees forms a category ST A , in which a morphism / : s ^t is a function from the vertices of s to the vertices of t which preserves the root, the edge relation and the labeling. This category has an initial object J_, the rooted tree with no edge, and is equipped with at least the operations of prefixing and sum. For each letter a G A, and each synchronization tree t, a : t is the tree obtained from t by adding a new root, r and an edge labeled a from r to the root oit. When s, t are synchronization trees, s-f-Hs the tree obtained from s,t by identifying their roots, and otherwise, keeping the vertices and edges of each. In this category, fixed point equations such as X = {a : x) + X
have solutions, but there is no canonical ordering on the category in which least solutions exist. However, this category has all colimits of w-diagrams; the rightside of fixed point equations determines a continuous endofunctor F : ST A ^STAFurther, the "initial fixed point" of the functor F is determined up to isomorphism as a colimit of the w-diagram ^ In [Win84], two complete partial orders are defined on synchronization trees. However, the definition depends on the concrete representation of trees and is thus not fully abstract.
Completing Categorical Algebras
233
Thus, ST A is an example of a continuous cUa defined in the abstract (and immediately below). There are other examples which we will mention after stating our main results. Although there are many kinds of completions in the category-theory literature, we were not able to find this particular completion, except for the case of linear orders. In volume 2 of [Ele02], Johnstone describes an "Ind-completion" of a category, which is certainly related to this one. However, Johnstone does not study algebraic structures on the category and thus does not consider (in) equations. The notion of a cS& probably occurs to all those familiar with both universal algebra and category theory, and the outline of an w-completion result is probably obvious to many. Perhaps the "right" notion of the truth of an inequation in a cSa is not obvious, and the details of the construction have turned out to be more delicate than expected. We think they merit exposition in this paper. In this extended abstract, only a few proofs will be given. A version of this paper with full proofs may be found at www.es .Stevens .edu/~bloom/research/pubs2/ccafull.pdf.
2 Some notation N is the category whose objects are the nonnegative integers, in which there is a morphism n >- p exactly when n < p. li f : X >• Y is either a function or functor, we write J / , fi, f{i) for the value of / on the argument i. The composite of / : x ^y and g : y ^z is written fg : x ^ z , where f,g are functions or functors.
3 The completion and characterization theorems Let 17 be a ranked alphabet. A categorical U-algebra C consists of a small category C, and, for each letter a £ I7„, a functor ac '• C" ^C. A m o r p h i s m
h-.C—^C of categorical 17-algebras is a functor h : C >• C such that for each n > 0 and eachCTG i7„, C" - ^ ^ C - ^ D and C" - ^ DP -^^ D are naturally isomorphic. A ci7a-morphism h is strict if the functors a • h and /i" • a are the same for all a € EnRecall that a functor h : D ^D' is w-continuous, or just "continuous", for short, if whenever a functor / : N >• D has a colimit {vn '• fn ^ d)n in D, then {vnh : fnh ^dh)n is a colimit oi f • h : N ^ D'. A cZ'a C is (w-) continuous if
234
S. Bloom and Z. Esik
- C is w-complete, i.e., C has an initial object ± and all functors N coHmits, and further, - each functor ac • C" ^C is continuous.
^C have
A (strict) morphism of continuous cZ'a's is a continuous functor F : C 3-D which preserves initial objects and is a (strict) ci^a morphism. Remark 1. Categorical i7-algebras are a generalization of ordered Z'-algebras and continuous cZ'a's are a generalization of (order) continuous U-algebras, see [Blo76, GTWW77, GueSl] or below. Let Tnix'(p) denote the collection of iJ-terms on p variables x i , . . . , X p . Suppose that C is a cI7a. Any term t G T m ^ ( p ) determines a functor tc : C^ ^C as follows: - {xi)c • C^
^ C is the i-th projection functor (1 < i < p).
- If cr e Z'fc, 0 < k, {cr{ti,...
,tk))c
is the composite
Cr> »*')---fa)^> c'
-^ . g
A cI7a inequality is an expression s -< t
where s, t are terms in T m ^ ( p ) , for some p > 0. If C is a ci^a, we say C is a model for s ^ t, in symbols, C\=s
if there is a natural isomorphism sc ^tcOur main results are about completions of ci7a's. Theorem 1 (Completion theorem). For any cSa C having an initial object, there is a continuous cEa C", and a cEa morphism r]: C •—^
C",
with the following properties. If D is a continuous cSa, and if F : C >• D is any cSa-morphism which preserves initial objects, then there is a morphism F " : C ^ — - ^ D in the category of continuous cSa's, unique up to a natural isomorphism, such that the functors T] • F^ and F are naturally isomorphic.
Completing Categorical Algebras
235
It then follows that - C^ is unique up to categorical equivalence. - T] is a full and faithful functor which is infective on objects, and which preserves initial objects. ~ Any cSa inequality or equality which holds in C, also holds in C". Our characterization of C " involves the following notion. Definition 1. Suppose that K is a full subcategory of the category D. ~ K is compact in D if for each object c in K, and each object d of D, if there is a colimiting cone {rf : fi —
d)i
(1)
where f : N ^K, then any map c ^d factors through some rf. - D is compactly generated by K if K is compact in D and for every object d of D, there is a functor f : N ^ K and a colimiting cone as in (1) in which each colimit morphism rf : fi >• d is monic. Using this notion, we describe those situations in which the induced functor F^ in Theorem 1 is an equivalence. Theorem 2 (Characterization theorem). Suppose that D is a continuous cEa and F : C ^D is a cEa morphism which preserves initial objects. Then the induced functor F ^ : C" s- D is an equivalence iff F is full, faithful, and D is compactly generated by the image of F. We will outline the proofs after discussing some examples. 3.1 Ordered i^-algebras When X" is a ranked set, an ordered Z'-algebra consists of a partially ordered set (A, <) equipped with a function a : A"-
^ A
which is order preserving. Such algebras are categorical X'-algebras, in which the objects are the elements of A and in which there is a morphism a ^h exactly when a
236
S. Bloom and Z. Esik
3.2 S t r e e s As formalized in [BET93], a i7-tree i is a partial function t : N"^ ^ E, with source the set N!^ of finite sequences of positive integers, and target E, with the following properties. - The domain of t is a nonempty, prefix-closed subset of N!!),. - If u e N!!]_ is in the domain of t and if t{u) G I7„, and i is a positive integer, then ui, the sequence obtained by putting i at the end of the sequence u, is in the domain of i iff 1 < i < n. Thus, the leaves of t are those sequences u such that t{u) £ SoWe assume there is a distinguished letter ± e SQ. Then for trees s,t,we define s
a{ti,...,tn){u)
]a = <^ , . [ti{V)
if u is the empty sequence ., it U = IV,
where iv is the sequence obtained by putting i on the front of the sequence v. iJtr is an ordered cZ'a, in that there is a morphism s ^t, for any trees s,t iS s
D
Note that if D is any cSa with an intial object ±D, there is a unique ci7a morphism SFtr ^D taking J_ to ±D- Thus, Corollary 1. Str is the initial continuous cSa in the category of all continuous cSa's in which A. is the initial object: for any such continuous cSa D there is a continuous cSa-morphism Str ^D, unique up to an isomorphism. D 3.3 Synchronization trees We have shown in [BE93] that ST A defined briefly in the introduction is an u>continuous categorical Z'^-algebra, where S is the signature having a constant symbol 0, denoting the initial object -L, a unary function symbol a for each a G A, denoting the prefixing operation, and a binary function symbol +, denoting the coproduct operation described above. See also [Mil89, Win84]. Let !FSTA denote the full subcategory of ST A determined by the finite synchronization trees. Note that TSTA is also a cZ'a, a "categorical subalgebra" of5T^.
Completing Categorical Algebras Proposition 2. ST A is the completion of T ST A-
237 •
Let V be the collection of all cI7a's D in wliich. 0 is an initial object which satisfy the following: x+ 0 ^x x+ y = y+ x x + {y + z)'^{x
+ y) + z
Then it is not hard to show that the subcategory ^iST^(mon) of TSTA with the same objects having only monies as morphisms is the initial ciTa in V, in the following sense: for any cZ'a in V there is a cZ'a-morphism F : ^5T>i (monies) > D, unique up to a natural isomorphism. Corollary 2. J^STAi'mon)'^ in V.
is initial in the category of all continuous
cSa's
Proof. Let JD be a continuous cZ'a in V. Then there is a cSa morphism F : ^(ST^(mon) ——>• D, since .FiSTA(mon) is initial in D. But then there is a continuous F " : ^iST^(mon)'^ -—^ D, unique up to natural isomorphism, by the completion theorem. D 3.4 Words We recall from [Cou78, BE05] that when ^4 is a finite or countable set, a word over A (called an arrangement in [Cou78]) is a triple u — (L„, <«, A^) consisting of a finite or countable linearly ordered set {Lu, • u' • v' so that it agrees with / on the elements of L„ and with g on the elements of Ly. Let S be the signature with a constant symbol a, for each a £ A, denoting the constant functor W^ > WA whose value is the singleton word labeled
238
S. Bloom and Z. Esik
a, a symbol 0 in EQ denoting the constant functor whose value is the empty word, and a binary function symbol ; denoting the concatenation functor. The following fact was essentially shown in [Cou78]. Proposition 3. WA is a continuous
cSa.
In WA, one can solve such equations as x = a; a; and x = x;a; x. The initial solution to the second, is the word faf whose underlying order is isomorphic to the rationals, with every point labeled a. (There doesn't seem to be an ordering of WA such that {af is the least upper bound of a sequence of finite approximations.) Let J^WA be the full subcategory of WA determined by the finite words. Proposition 4. WA is the completion of !FWALet ^>V^(mon) be the subcategory oiJ^WA with the same objects, having only the monies as morphisms. Define the category Ai having as objects all ciTa's with an initial object 0 which satisfy the monoid equations 0;x^x x;0 = x x;{y;z) = {x\y);z It is not hard to show that .7-">Vyi(mon) is freely generated by ^ in A^ in the sense that for any cE& D in M., and any function / : A 3-obj(L>), mapping 'letters' in A to objects in D, there is a functor F : !FWA{'^on) ^D, unique up to a natural isomorphism, such that F{0) is initial and F{a) = / ( a ) , for each a E A. Thus, Corollary 3. J^WAi'fnon)^ is freely generated by A in the category of all continuous cSa's in M. D
4 Weak maps and compact generation An endofunctor m : N >- N is just a nondecreasing function. We say an endofunctor is unbounded if for each i £N, i < jm, for some j G N. When m : N >- N is an endofunctor and / : N >• C is a chain, we write mf for the composite
r^ _irv N - ^ C. Thus, on the object z G N, {mf)i = fimWhen f,g are chains, a weak map a : f -—^g is a natural transformation a : f
^ mg
for some unbounded endofunctor m on N. We define the composite of weak maps a : / >• ruag and j3 : g >• mph as aop
:= f
"> niag '""^
{mam/3)h.
Completing Categorical Algebras Definition 2. For weak maps a : f
^rriag and /? : /
239
^mpg, define a ~ /?
by: for all i >0 there is some j > ima,imf3 such that Oii • g{ima,j)
= Pi • g{imp,j).
(2)
It is clear that ~ is an equivalence relation on the weak maps with the same source and target. Let [a] : f ^g denote the ~-equivalence class of the weak map a : f ^g. This equivalence relation is compatible with composition. Proposition 5. / / o ; ~ a' : / ^g and p ^ /?' : g ^h, then a o / ? ~ a'o/?'. D
We will need the following fact about a ~ /?. Lemma 1 (Inflation Lemma). Suppose that a : f
s^mg and that m' : N
>• N is any functor satisfying km < km', for all k > 0. Define the natural transformation a' : /
^m'g
by di ••= fi
-^ gim " ' ^ ^
gim'-
Then
4.1 Compact generation Recall Definition 1. Note the similarity of this notion to that of the definition in [CCL80] of a continuous lattice. The following lemma indicates where compact generation arises. Lemma 2. Let C be a full subcategory of D. Suppose that f, f : N ^ C and that [rf : fi >-rf)i and {rf : f[ >-d')i are colimiting cones in D. Then 1. A weak map 7 : /
^mf
determines the map K(7)
as the unique morphism d
:d
3- d'
^ d' such that rf • K ( 7 ) = li • rfm
for all i > 0.
240
S. Bloom and Z. Esik
2. If ^ : f
>- mf
and 7 : /
3- m / ' are weak maps such that 7 ~ 7', then K(7) = K ( 7 ' ) .
3. Suppose that D is compactly generated by C and that for i > 0, the morphisms rf and rf are monies. Then, for any map h:d in D there is a weak map 7 : /
^d' >• mf
K(7)
such that
= h.
4- Suppose that D is compactly generated by C and for i > 0, the morphisms rf and rf are monies. Ifj : f ^mf and^ : f *-m/' are weak maps, and K{J) = K{^), then
Now, we give a condition sufficient to obtain a colimit of a functor G : N ^D. Lemma 3. We assume the following hypotheses. - Fori > 0, /* : N ^D is a functor with colimiting cone {TJ : / j ^K{f'^))j. " For each i < j , P'''^ : /* ^ f^ is a natural transformation such that /3''* = Ifi and, when i < j < k.
Thus, G : N ^D is a functor, where Gi = « ( / ' ) , and G{i,j) = «(/?*'•'), for allO
g{i,J):=f\iJ)-P;'' - Let fJ,i{j) = msix{i,j),
- Suppose that {rf : gi
and let 5' : /*
*-/Uiff be the weak map
^i^{g))i is a colimiting cone.
Then, it follows that (K((5*) : «(/*) ^^{g))i is a colimiting cone overG, where is the unique map satisfying the conditions that
K((5')
for all j .
Completing Categorical Algebras
241
The following Proposition is quite useful. Proposition 6. Suppose that D is compactly generated by the full subcategory C. Then: 1. C has initial object iff D has. 2. D has colimits of all u-diagrams iff each functor N s-C has a colimit in D. 3. A functor F : D—-^D' is continuous iff it preserves colimits of all functors
n—^c.
Proof. We prove only the second two statements. Proof of 2. Suppose that each functor N ^ C has a colimit in D. We show that if G : N ^D is a functor, G has a colimit in D. For each n > 0, let / " : N ^ C be a functor such that (rf : / f ^ G„)i is a colimiting cone in D. By Lemma 2, each 0 < i < j , each morphism G{i,j) : Gi ^Gj is determined by a weak map pi,j : f
—
mijf^.
For ease of notation, let's assume that all functors mij are the identity, so that for each 0 < i < j , /?*'•' : /* ^ P is a natural transformation. Define g : N ^ C by: 9 i ••= f l
9(i,j):=fii,j)-pr Since every functor N ^ C has a cohmit in D, let (r? : g^ colimit in D. For each i>0, there is a weak map <5' : /* s- ^^g defined by
(As above, iii{j) = max(i,j).) Thus, there is a unique map such that for all j > 0, (3) holds. In particular, letting j = i,
K((5*)
*- d)i be a
: Gi
^d
r!=5\-T!
(4)
Claim. (K(5*) : Gi ^d)i is a coHmiting cone. Indeed, any cone {ui : Gi over G determines the cone
^e)i
{TI -Vi'-gi — ^ e)i
over g, and hence, there is a unique map
242
S. Bloom and Z, Esik j^* : d
> e
such that for all i,
We show that for all i > 0, Vi =^
K{5')
• u*.
(5)
Indeed, for fixed i, the maps aj :=
form a cone over / ' : N that for all j ,
T]
•
• u*
K{5')
^ C , so that there is unique map Q * : d r] . a* =
T]
•
^ e such
• v*.
K{5')
But Ui is one such map. Hence a * = ViWe now show u"^ : g ^e is the unique map such that for all«, (5) holds. Indeed, suppose Ui = K((P ) - a ,
all i > 0. Then, for each i , j , ^
• '^i
=
^
• K{5') • a
= ^ • < . o ) • "• But if i = j , Tl-Vi=-Tf
• a,
and v"^ is the unique such map. D Proof of 3. Suppose that F : D ^D' preserves the colimits of all functors N ^C. We show that F preserves the colimits of all functors N ^D. We use Lemma 3. Indeed, suppose that G : N ^D is a functor. Using the notation of the previous part, we have shown that {^{5') : Gi - ^
g)i
is a colimit of G, where, for each i >0, f^ : N (Tj : 4 —
^C is a functor and
G,)j
is a colimit in D, and where g is the diagonal functor, with colimiting cone (T-f : 9i
^ 9)i.
Completing Categorical Algebras
243
But now, applying F, the assumptions imply that
{rJF : fJF —
GiF)j
(TfF : giF - —
gF)^.
is a colimiting cone, as is
It then follows from Lemma 3 that i[Kid')F] : GiF —
gF)i
is a colimiting cone in D'.
D
5 Construction of C^ We now describe the cS& C"^ as a quotient of the functor category C^. 5.1 S t e p 1. We assume C has an initial object (if necessary, we adjoin one freely.) Let C^ be the category whose objects are all functors / : N ^ C; a morphism a : f >• g is & natural transformation. We usually denote the components of a natural transformation a : f *- g by ^n '• In
^ Qri'i
for n > 0. We impose the structure of a ci7a on C^ by 'lifting' the functors a : C' ^CtoN. For example, if cr e S2, and f,g : N ^ C, ac^{f,g) : N ^ C is the functor whose value on n is
The value on the arrow n < p in N is: (^c{f{n,p),g{n,p))
•.ac{fn,gn)
^ (^c{fp,9p)-
So, now, for every term 5 in Tinx;{p), S(7N is defined. (We usually will drop subscripts.) For example, if p = 2, and a : / *-/' and (3 : g ^g' are arrows in C^ (i.e., natural transformations), s{a,P):sif,g)
-^s{f',g')
is the natural transformation with components (s(a,/?))„ =s{an,(3n) •.s{fn,gn)
^s{f'^,g'^).
244
S. Bloom and Z. Esik
D e f i n i t i o n 3 (770 d e f i n e d ) . Let rio-.C be the functor
—^C"*
taking the object x in C to the functor
r]o{x) with ?7o(x)„ = x,
and rio{x){n,p) = 1^, the identity morphism x ^x, for all 0 < n < p. On the morphism g : x ^y in C, the value ofr]o{g) is the natural transformation Vo{x) ^Vo{y), each of whose components is g. P r o p o s i t i o n 7. The functor rjo : C ^C^ is a strict cUa-morphism, which is full and faithful, and injective on objects. If J- is an initial object in C, T/O(-L) is initial in C^. D Now for t h e next step. 5.2 S t e p 2. D e f i n i t i o n 4 . Let C " be the category whose objects are those of C^ in which a morphism [a] : / ^g is an '2:i-equivalence class of a weak map a : f ^mg. We define t h e canonical embedding of C into C ^ . D e f i n i t i o n 5 (77 d e f i n e d ) . Let rj: C ^C" in C to [rioif)] : rio{x)—^rio{y) in C^.
be the functor
taking f : x
^y
We would like t o impose t h e structure of a cSa, on C"^. T h e first problem is t h a t if cr € T m ^ ( 2 ) , say, and if a : / >• mag and P : f >• mpg', when m.a ^ nif}, how should we define cr{\a], [/?]) : o'{f,f') ^a{g,g'), since a{a,(3) may not be weak map! Indeed, for i G N, if ima 7^ imp, we have cr{a,f3)i =a{ai,pi)
: crifij'i)
^(^{9imc.,9'imfi)^
which is not a weak m a p . However, if m ^ = TO/3, this equation does define a weak m a p a{a, (3) : a{f, f) ^ a{g, g'). We have a simple alternative, using t h e Inflation Lemma 1, above. L e m m a 4 . Suppose that m, m' are unbounded endofunctors on N with jm < jm!, for all j > 0. Suppose also thatoi : fi ^mgi, j3i : fi ^m'gt are natural transformations such that ai c^ Pi, for each i = 1 , . . . , n . Then if a £ Sn, we have the natural transformations ( T ( Q ! I , . . . , Q : „ ) : = ( Q ; i , . . . , a „ ) -(T : o-(/i, . . . , / „ ) • — ^ m a { g i , . . . ,gn) o-(/?i, •••,/?») : = (/3i,...,/3n) -(^ •• (^(fi, • • •, fn) —^rn'a{gi,... With these
assumptions, (T(ai,...,a„) ~ (T(/3I,...,/3„).
D
,gn)-
Completing Categorical Algebras
245
Definition 6 (C^ as cSa). Suppose a G Sn o-nd n > 0. For any n-tuple [ai],..., [an], where [ai] is an equivalence class of a weak map ai : fi ^gi, i = 1,... ,n, choose some m : N a-N and some Pi : fi ^mgi, for i = I,... ,n such that ~ aiC^i j3i, for each i; - Pi • fi ^rngi, for each i. The existence of such Pi and m follows by the Inflation Lemma. Now define ^•^-([ai], ••-,["«]) : o - ( / i , . . . , / „ )
^a{gi,...,gn)
[cT{p,,...,Pn)], the equivalence class of the weak map cr{Pi, • • •, Pn)- (We write just a for aQU.) The fact that
6 C^ has the required properties In the previous section we defined the categorical iJ-algebra C"^ and the embedding T] : C ^ C"^. In this section, we prove that the construction satisfies all properties required in Theorem 1. We will show that C " is compactly generated by 77(C), and then apply Proposition 6. Lemma 5. / / / : N ^C is any functor, then f is the colimit object in C^ of the diagram
via the colimit morphisms
[rl] : Vifn) —
/
where, for each n, r / has the components ri^ii) := f{n,ma.x{i,n}). Further, each morphism [r/] is monic.
(6)
246
S. Bloom and Z. Esik
Proof. First, we show each morphism r / is monic. Suppose that / , g : N are objects in C"^, and a,(3 : g -—>• fnT] are weak maps such that f] ^ H • [4]
3-C
I/Q] . Wf Ti,
By the Inflation Lemma, we may assume that a,j3 : g bounded endofunctor m : N ^N. Thus,
>• mfn for some un-
so that for each i there is some j > n + im such that Oii- f{n,j)
= f3i-
f{n,j),
But this imphes a ~ /3, and hence [a] = [/?]. It is clear that for n
^ Vifp)
f commutes. Now suppose that g is any object in C", {[ui] : ri{fi) over the diagram fr]. But defining 1/* : f
^g)i is a cocone
^ g
as the weak map with components {i'*)i := i^i,
we have fj = r / • V*,
for each i. We now consider the factorization property.
D
Lemma 6 (C" has the factorization property). Suppose that c is an object in C, f : N ^C is an object in C^, and [a] : crj ^f is a morphism in C^. Then [a] factors as [a] = [grf\ • [r^], for some n > 0, and some morphism g : c
^ fn in C.
Completing Categorical Algebras Proof. If a : crj
*-m/ is any weak map, then, for any i, since (c77)(0,i) = Ic, ^ — ^ Oil — C
If 3 = ao : /o
247
"0-. f / ( O m , im) , ^ JOm ^ Jim'
^ /om in C, we have
Proposition 9. C"^ is compactly generated by r]{C). Proof. By Lemmas 5 and 6. Corollary 4. C"^ is io-complete. Proof. By Proposition 6 and Proposition 9.
D
We now show C"^ is a continuous ci7a. Proposition 10. For each a G S, the functor ac^ is continuous. Proof. For ease of notation, assume that a G Si. We have to show that if ([•?"'] •' / ' ^g)i is a colimit of the w-diagram A, then ([cr{T^)] : a-{p) ^cr(g))i is a colimit of (j{A), i.e., the diagram a(r)'^la(/^)[«la(/2)—... But this fact follows just as above, diagonal, which is a{g). There is an alternative argument is compactly generated by C". Then, a preserves cohmits of functors N
since the colimit of this diagram is the using the fact that for each n > 1, (C^)" by Proposition 6, we need show only that >• C " . D
Proposition 11. If s,t are E-terms in Tms{p),
then C \= s ^t
t.
iff C" \= s <
a
We turn now to showing that r] : C ^C" has the universal property stated in Theorem 1. Suppose that D is an w-continuous ci7a, and F : C >• D is a ciJamorphism. We want to define F'^ : C^ >• D. We use Proposition 6. For each chain / : N ^C be an object of C"^, choose a colimit cone (A{ : fiF - — K{fF))i
(7)
in D. On the object / in C"^, we define fF'^ as the colimit object K{fF). Suppose f,g:N s- C are objects in C^ and a : f >• ruag is any weak map. Then a determines the weak map aF : fF ^m{gF), which in turn determines the map a* : K ( / F ) ^ by the property that for each
K{gF)
i>0, X{ -a* =Qi-Af
248
S. Bloom and Z. Esik
Lemma 7. If a,/3 : f
>• g are weak maps, and if a c± f3, then a * = /?*.
Proof. Since a ~ /3 = > a F ~ /3F.
D
Definition 7. We define [a]F'^ = a*. Proposition 12. Suppose that r / : fnij defined above. Then [ T / ] F ' ^ = A^.
^ f is the monic colimit morphism
Proof. By definition, [r^jF'^ is a"^, where a = T^F. Since /^r^F is the constant chain whose object is fnF, the morphisms r/" are all the identity map 1 / „ F '• fuF ^fnF. Thus, for any i > 0, a* =
TI"F
-a*
= 4ii)F.xi^, = TlF{n,n
+ i)-\l^^^
Thus, T / F " = A^, showing that F'^ preserves colimit cocones of functors fr], for/:N ^C. D Corollary 5. F'^ is continuous. Proof. By Proposition 6, part 3. D It remains to show F^ is a ciJa-morphism. When a £ 1^2, we want to show that for any objects f,g € C" F^ia{f,g))=aD{F^{f),F'^{g)), at least up to isomorphism. The method is to show that each side is the colimit object of the same w-diagram in D. We omit the details. D
7 Conclusion We have presented a completion theorem for categorical algebras that generalizes the well-known completion of ordered algebras from [Blo76]. We have shown that the completion C^ is conservative in the sense that it satisfies all (in)equalities that hold in C. In addition to order completion, we have presented two main applications: synchronization trees and words, and thus found concrete descriptions of free continuous categorical algebras satisfying monoid and commutative monoid "equations". We beheve that the Completion Theorem will find several more applications in Computer Science. For one example, the collection of countable labeled partial orders over an alphabet, sometimes called pomsets, equipped with the operations of series and parallel composition is a continuous categorical algebra in a natural way, cf. [Pra86, Ren96, LWOO]. We expect that this algebra is equivalent to the completion of the categorical algebra determined by the finite pomsets. Further natural sources of applications are event structures (cf. [WN95]), or labeled transition systems with bisimulations, cf. [Mil89].
Completing Categorical Algebras
249
References [Bio76] S.L. Bloom. Varieties of ordered algebras. J. Computer and System Sci., vol. 13, no. 2 (1976) 200-212 [BE93] S.L. Bloom and Z. Esik. Iteration Theories. Springer, 1993. [BEOS] S.L. Bloom and Z. Esik. The equational theory of regular words. Information and Computation, 197/1-2 (2005) 55-89. [BET93] S.L. Bloom, Z. Esik and D. Taubner. Iteration theories of synchronization trees. Information and Computation, 102/1 (1993) 1-55. [Cou78] B. Courcelle. Frontiers of infinite trees. RAIRO Inform. Theor., 12/4 (1978), 319-337. [EBT78] C. Elgot, S.L. Bloom, R. Tindell. The algebraic structure of rooted trees. J. Computer and System Sci., vol. 16, no. 3 (1978) 362-399. [CCL80] G. Gierz, K.H. Hofmann, K.Keimel, J.D. Lawson, M.Mislove, D.S. Scott. A compendium of continuous lattices. Springer-Verlag 1980. [GTWW77] J.A. Goguen, J.W. Thatcher, E.G. Wagner and J.B. Wright. Initial algebra semantics and continuous algebras. J. Assoc. Comput. Mach., 24/1 (1977), 68-95. [GueSl] I. Guessarian. Algebraic Semantics. Lecture Notes in Computer Science, 99. Springer-Verlag, Berlin-New York, 1981. [Ele02] P.T. Johnstone. Sketches of an Elephant: A topos theory compendium Oxford University Press, 2002. [LWOO] K. Lodaya and P. Weil. Series-parallel languages and the bounded-width property. Theoret. Comput. Sci. 237 (2000), 347-380. [Mil89] R. Milner. Communication and Concurrency. Prentice-Hall, Englewood Chffs, NJ., 1989. [Pra86] V. Pratt. Modeling concurrency with partial orders. Internat. J. Parallel Programming, 15/1 (1986), 33-71. [Ren96] A. Rensink. Algebra and theory of order-deterministic pomsets. Combining logics. Notre Dame J. Formal Logic 37/2 (1996), 283-320. [Win84] G. Winskel. Synchronization trees. Theoretical Computer Science, 34 (1984), 33-82. [WN95] G. Winskel and M. Nielsen. Models for concurrency, in: Handbook of Logic in Computer Science, Vol. 4, Oxford University Press, 1995, 1-148.
Reusing Optimal TSP Solutions for Locally Modified Input Instances* (Extended Abstract) Hans-Joachim Bockenhauer'^, Luca Forlizzi^, Juraj Hromkovic^, Joachim Kneis'^**, Joachim Kupke^, Guido Proietti'^''*, and Peter Widmayer^ ' Department of Computer Science, ETH Zuricii, Switzerland, {hjb, j u r a j .hromkovic, jkupke,widinayer}Qinf . e t h z . c h ^ Department of Computer Science, Universita di L'Aquila, Italy, {forlizzi,proietti}@di.univaq.it
^ Department of Computer Science, RWTH Aachen University, Germany, j oachim.kneisQcs.rwth-aachen.de
* Istituto di Analisi dei Sistemi ed Informatica "A. Ruberti", CNR, Roma, Italy A b s t r a c t . Given an instance of an optimization problem together with an optimal solution, we consider the scenario in which this instance is modified locally. In graph problems, e.g., a singular edge might be removed or added, or an edge weight might be varied, etc. For a problem U and such a local modification operation, let LM-t/ (local-modificationU) denote the resulting problem. The question is whether it is possible to exploit the additional knowledge of an optimal solution to the original instance or not, i.e., whether LM-U is computationally more tractable than U. Here, we give non-trivial examples both of problems where this is and problems where this is not the case. Our main results are these: 1. The local modification to change the cost of a singular edge turns the traveling salesperson problem (TSP) into a problem L M - T S P which is as hard as T S P itself, i.e., unless P = NP, there is no polynomial-time p(n)-approximation algorithm for LM-TSP for any polynomial p. Moreover, LM-TSP where inputs must satisfy the /3triangle inequahty (LM-/i/3-TSP) remains NP-hard for all /3 > | . 2. For LM-Zi-TSP (i.e., metric LM-TSP), an efficient 1.4-approximation algorithm is presented. In other words, the additional information enables us to do better than if we simply used Christofides' algorithm for the modified input. 3. Similarly, for all 1 < /? < 3.34899, we achieve a better approximation ratio for LM-Zi,3-TSP than for A^-TSP. 4. Metric TSP with deadlines (time windows), if a single deadline or the cost of a single edge is modified, exhibits the same lower bounds on the approximability in these local-modification versions as those currently known for the original problem. This work was partially supported by SNF grant 200021-109252/1, by the research project GRID.IT, funded by the Italian Ministry of Education, University and Research, and by the COST 293 (GRAAL) project funded by the European Union. This author was staying at ETH Zurich when this work was done. Please use the following format when citing this chapter: Bockenhauer, H.-J., Forlizzi, L., Hromkovic, J., Kneis, J., Kupke, J., Proietti, G., Widmayer, P., 2006, in International Federation for Information Processing, Volume 209, Fourth IFIP International Conference on Theoretical Computer Science-TCS 2006, eds. Navarro, G., Bertossi, L., Kohayakwa, Y., (Boston: Springer), pp. 251-270.
252
H.-J. Bockenhauer et al.
1 Introduction Traditionally, optimization theory has been concerned with the task of finding good feasible solutions to (practically relevant) input instances, little or nothing about which is known in advance. Many applications, however, demand good, sometimes optimal, solutions to a limited set of input instances which reflect a supposedly-constant environment (imagine, e.g., an existing railway system or communications network). When this environment does change, maybe only slightly and maybe only locally, do we have no choice but to recompute some good feasible solution, effectively forgetting about the old one? Here, we will analyze local modifications only. In a graph problem, for example, the cost of a single edge might change, an edge might be removed or added, or some other local parameter might be adjusted. Results related to this work pertain to the question by how much a given instance of an optimization problem may be varied if it is desired that optimal solutions to the original instance retain their optimality [12, 17, 18, 20, 21]. In contrast with this so-called "postoptimality analysis," our approach here is to ask, if we cannot avoid to lose the optimality of a given solution when an instance is varied arbitrarily, what can we do to restore the quality of a solution, maybe in an approximative sense? Surely, for some problems, knowing an optimal solution to the original instance trivially makes their local-modification variants easy to solve because the given optimal solution is itself a very good solution to the modified instance. For example, adding an edge in the instance of a coloring problem will increase the cost of an optimal solution by at most the amount of one - an excellent approximation, but certainly not the object of our interest. Our goal is to present non-trivial examples of problems, some where the knowledge of an optimal solution to an instance close to the input is helpful and some where it is not. To this end, we will study T S P , its restricted versions, and its generalizations such as T S P with deadlines (a special case of T S P with time windows). Let A-TSP denote metric TSP, and, for ah /? > i , let Afs-TSP denote the special case of TSP where all instances satisfy the /^-triangle inequality
cax,z})<(3-{c{{x,y})+ci{y,z})) for all vertices x, y, and 2;. If ^ < /? < 1, we call this the strengthened triangle inequality; and if /3 > 1, we call it the relaxed triangle inequality. For an optimization problem U, we denote our local-modification variant of U by LM-U. For the aforementioned TSP-based problems, we regard it as a local modification to change the cost of exactly one edge. For T S P with deadlines, we also regard it as a local modification to shift one deadline by the amount of at least one time unit. Our main results are as follows: (i) It is well-known that T S P is not approximable in polynomial time with a polynomial approximation ratio (unless P = NP). We show that this
Reusing Optimal TSP Solutions for Locally Modified Input Instances
253
holds for LM-TSP, too. Thus, in terms of a worst-case analysis, LM-TSP is as hard as T S P , and we do not have anything to gain from knowing an optimal solution to a close problem instance. By parameterizing T S P with respect to the /3-triangle inequality [1, 2, 3, 4, 5] and by introducing the concept of stability of approximation [15, 5], it was shown that T S P is not as hard as it may look like in the light of worst-case analyses. For any /? > 5, we have a constant polynomial-time approximation ratio, depending on (3 only. Bockenhauer and Seibert [8] proved that zi/3-TSP is APX-hard for every ^ > \ (note that for /3 = ^, the problem becomes trivially solvable in polynomial time). Here, we prove that LM-zi/3-TSP is NP-hard for every 13 > \. This implies in particular that LM-Zi-TSP, too, is NP-hard. We conjecture that this problem is also APX-hard, which, so far, we have been unable to prove and thus leave as an open research problem. (ii) For many years, Christofides' algorithm [9] with its approximation ratio of 1.5 has been the best known approximation algorithm for attacking Z\-TSP. It remains a grand challenge to improve on Christofides' algorithm. We will show that, intriguingly enough, LM-Z\-TSP admits an efficient 1.4approximation algorithm. This result can be generalized to LM-Zi^-TSP, and the resulting approximation guarantee beats all previously-known approximation algorithms for zi/3-TSP for all 1 < /? < 3.34899, which includes the practically most relevant T S P instances. (iii) T S P with time windows is one of the fundamental problems in operations research [10]. Usually, only heuristic algorithms are used to attack it although the question how hard it is w. r. t. approximability has only been resolved in [6, 7], where even an i7(n) lower bound on the polynomial-time approximability of Z\-TSP with time windows was shown, in contrast to the constant approximability of Z\-TSP. This lower bound already holds for the special case of this problem where all time windows are immediately open, a special case of the problem which we will call T S P with deadlines, or AD L T S P for short. Here, we consider local-modification versions of Z\-TSP with deadlines. We show that already if we only allow a single deadline to be changed, and only by an amount of one time unit, the resulting problem, LM-/i-DLTSP, has the same lower bound of Q{n) on the approximation ratio as Z \ - D L T S P . Let us underscore the importance of this negative result: Not only does TSP with deadlines remain an intractable problem in its LM version, but the extra knowledge of an optimal solution to a related instance does not even help a single bit. Likewise, we will establish the lower bound of (2 — e), for any £ > 0, for L M - Z \ - D L T S P with a constant number of deadlines, the same as is known for / A - D L T S P with a constant number of deadlines [6, 7]. These results can also be obtained if, again, we modify the cost of an edge rather than a deadline. So, on the one hand, additional information about an optimal solution to a related input instance may be useful to some extent, and on the other hand, the local-modification problem variant may remain exactly as hard as the original problem. Yet, the final aim of our paper is to call forth the investigation of
254
H.-J. Bockenhauer et al.
the hardness of local-modification optimization problems in order to develop approaches to handle situations where multiple (and, potentially, dynamically determined) local modifications may arise. The paper is subdivided into two main sections. In Section 2, we will analyze TSP with local modifications and present hardness results as well as approximation algorithms for the metric and near-metric case. Section 3 is devoted to inapproximability results for the local-modification version of TSP with deadlines.
2 Results for T S P In this section, we will analyze the local-modification version of TSP. In Subsection 2.1, we will present our hardness results. In Subsection 2.2, we will present a 1.4-approximation algorithm for the local-modification metric TSP, and Subsection 2.3 is devoted to approximability results for the case of the relaxed triangle inequality. We start off with a formal definition of T S P and its local-modification variants. Definition 1. Let G = {V,E,c) he a weighted complete graph, and let (3 > \ be a real value. We say that G obeys the Ap-inequality iff for all vertices x, y, z GV, we have c{{x,z})
+ c{{y,z}))
.
(A^)
By T S P , we denote the following optimization problem. For a given weighted complete graph G = {V,E,c), find a minimum cost Hamiltonian cycle, i. e., a tour on all vertices of cost OTG
••= min I ^
c(e) {V,C') is a Hamiltonian cycle
I eec Restricting, for some value of (3, the set of admissible input instances to those which obey the Af}-inequality yields the problem Zi/j-TSP. Besides, define Zi-TSP := zii-TSP. Definition 2. Let U € {TSP, zi-TSP, Ap-TSV). as follows. Input:
The problem IM-U is defined
- two complete weighted graphs Go = {V, E,co), GN = {V, E, Cjv) such that Go and GM are both admissible inputs for U and such that CQ and CN coincide, except for one edge; - a Hamiltonian cycle {V,C) such that ^ co{e.) = OTGOeec
Problem; Find a Hamiltonian cycle (V,C) that minimizes ^ eec
CM{C).
Reusing Optimal TSP Solutions for Locally Modified Input Instances
255
2.1 Hardness Results Before presenting approximation algorithms for LM-Zi-TSP, we start by proving some hardness results. First, we will show that LM-TSP is as hard to approximate as "normal" (i. e., unaltered) TSP. Theorem 1. There is no polynomial-time p{n)-approximation LM-TSP for any polynomial p (unless P = NP).
algorithm for
Proof idea. We will give a reduction from the Hamiltonian cycle problem (HC): Given an undirected, unweighted graph G, decide whether G contains a Hamiltonian cycle or not. Let G = {V, E) be an input instance for HC where V = {vi,...,Vn]. _ In order to construct an input instance (Go, Gjsi, C) for LM-TSP, we employ a graph construction due to Papadimitriou and Steiglitz [19], who used the same construction in order to give examples of TSP instances which are hard for local search strategies: For each vertex Vi, we construct a so-called diamond graph Di as shown in Figure 1 (a). These diamonds are connected as shown in Figure 1 (b). The edge costs in Go are set as follows. Let M := n • 2" + 1. All diamond edges shown in Figure 1 (a) and the connections from Ei to Wj+i and from En to Wi as shown in Figure 1 (b) are assigned a cost of 1 each. Edges {Ni,Sj) are assigned a cost of 1 whenever {vi^Vj} € E and a cost of M otherwise. All other edges receive a cost of M each. In Gjv, the cost of the edge {En, Wi) is changed from 1 to M. The given optimal Hamiltonian cycle C is the one shown in Figure 1 (b). This optimal solution for Go has a cost of 8n. It is easy to see that if there is a Hamiltonian cycle H' in G, a corresponding Hamiltonian cycle H in G can traverse all diamonds from Ni via Wj via Ei to Si. Hence, CN{H) = 8n. All Hamiltonian cycles in Gjv that do not correspond (in this way) to Hamiltonian cycles in G cost at least M -\- 8n — 1. Thus, the approximation ratio of any non-optimal solution is at least as bad as 1-1-2""'^. For a more detailed description of diamond graph constructions, also see, for example, [16]. D
Fig. 1. The diamond construction in the proof of Theorem 1.
256
H.-J. Bockenhauer et al.
Now, we will show that LM-Z\-TSP remains a hard problem for any /3 > | . Theorem 2. LM-Z\/3-TSP is NP-hard for any
P>\.
Proof. We will use a reduction from the restricted Hamiltonian cycle problem (RHC). The objective in RHC is, given an unweighted, undirected graph G and a Hamiltonian path P in G which cannot be trivially extended to a Hamiltonian cycle by joining its end-points, to decide whether a Hamiltonian cycle in G exists. This problem is well-known to be NP-complete (see, for example, [16]). The reduction uses an idea analogous to the standard reduction from the Hamiltonian cycle problem to TSP: Let {G,P) be an instance of RHC where G = {V,E), V = {vi,... ,Vn}, and P = ( u i , . . . ,Vn)- From this, we construct an instance {Go, GN, C) of LM-Zi/3-TSP as follows: Let Go = (V, E, CQ) and GAT = {y, E, CN) where {V, E) is a complete graph, co{e) = 1 for all e e £^U {{t;„, vi)} and co{e) = 2/? otherwise, and CAr({t;„, vi}) = 2/3. Let C = {vi,V'2, • • • ,Vn,vi)Clearly, this reduction can be done in polynomial time, and it is easy to see that there is a Hamiltonian cycle in G iff there is a Hamiltonian cycle of cost n in GN• 2.2 The M e t r i c Case In what follows, we will show that LM-Z\-TSP admits a |-approximation, which beats the naive approach of using Christofides' algorithm (which would yield a |-approximation), whereby the input cycle iV, C) would be ignored altogether. Theorem 3. There is a 1.4-approximation algorithm for
hM-A-TSP.
In order to prove Theorem 3, we will need the following few lemmas. Our crucial observation is that in a metric graph, all of the neighboring edges of short edges can only be modified by small amounts. Lem.ma 1. Let Gx = {V,E,ci) and G2 = {V,E,C2) be metric graphs such that Ci and C2 coincide, except for one edge e & E. Then, every edge adjacent to e has a cost of at least ||ci(e) — C2(e)|. Proof. We set {a, a'] := {ci(e),C2(e)} such that a' > a and 5 := a' — a. Let f G Ehe any edge adjacent to e, and for any such / , let f'GEhe the one edge that is adjacent to both e and / . Then, by the triangle inequality, we have: a ' < c ( / ) + c(/') and hence a' — a < 2c{f).
c{f')
We will have to distinguish two cases. Either, an edge becomes more expensive, or it becomes less expensive. In either case, our strategy is to compare the input solution (to the old problem instance) with an approximate solution (to the new problem instance). Let us start with the latter case.
Reusing Optimal TSP Solutions for Locally Modified Input Instances
257
Lemma 2. Let {GO,GN,C) be an admissible input for L M - Z \ - T S P such that 6 := co{e) — Civ(e) > 0 for the edge e. If -QY— < ^, it is a ^-approximation to output the feasible solution C := C for LM-/1-TSP. Proof. CN{C)
^ co{C) ^ OTGO ^ OTG, + ^ _ I I
OTG^
-
OTG„
OTG,
-
OTG,
^ OTG^
< i i ^ _ ^ "
^ 5
5
D Lemma 3. Let {GO,GN,C) be an admissible input for L M - Z \ - T S P such that ^ := co(e) — CN{e) > 0 for the edge e. / / -QT^-— > | , there is a ^-approximation for LM-A-TSP. Proof. We may assume that optimal TSP tours in GN use the edge e. For if they did not, C would already constitute an optimal solution. Fix one such optimal tour COPT in GN- In COPT, e is adjacent to two edges / and / ' . Let v be the vertex incident with / , but not with e, and let v' be the vertex incident with / ' , but not with e. By P, denote the path from v to v' in COPT that does not involve e. Consider the following algorithm: For every pair / , / ' of disjoint edges, both of which are adjacent to e, compute an approximate solution to the TSP path problem on the subgraph of GN induced by the vertex set V \ e (i. e., without two vertices) with start vertex v and end vertex v' where {v} = f \ e and {{;'} = f'\e. It is known [13, 14] that this can be done with an approximation guarantee of | . Each of these paths is augmented by / , e, and / ' so as to yield a TSP tour. The algorithm concludes by outputting the least expensive of all of these tours. Note that since all pairs / , / ' are taken into account, one of the considered tours uses exactly those edges f = f, f = f that COPT uses. This is why the algorithm outputs a tour of cost at most c{f) + c{f') + CN{e) + \c{P) = [OTG,
- c{P)) + \c{P) = OTG, + \c{P)
(where c is short-hand notation for CN wherever CQ and CN coincide) and thus achieves an approximation guarantee of 1+2 3
^(^) OTG^
Since by Lemma 1, min{c(/), c(/')} > | for i G {1,2}, we have OTG^ -C{P) > 6 and hence: OTG^
-
OTG^
- 5
So, we obtain an overall approximation guarantee of 1 + | = | .
D
258
H.-J. Bockenhauer et al.
Corollary 1. There is a '^-approximation algorithm for the subproblem of LM-Z\-TSP where edges may only become less expensive. Proof. Compute, as laid out in Lemma 3, an approximate solution to LM-/A-TSP and compare it with the input solution C. Output the less expensive of the two solutions. Depending on whether the value of •Q^'— (where 5 := co{e) — CN{S) > 0) is less or greater than | (which we cannot necessarily tell), one of the considered two feasible solutions is a |-approximation. D We will now turn to the case where an edge becomes more expensive. We can state a lemma akin to Lemma 2, but notice that by reusing a formerly optimal solution, we incur a certain extra cost. Lemma 4. Let {GO,GN,C) he an admissible input for L M - Z \ - T S P such that 5 := Cjv(e) — co{e) > 0 for the edge e. If Q^ < ^, it is a ^-approximation to output the feasible solution C := C for LM-Zi-TSP. Proof. CNJC) ^ cojC) + 5 ^ OTGQ + 5 _^ OTG^ +'^ = 11 OTG^
-
OTG^
OTG^
-
OTG^
^ OTG„
< i i ^ _ ^ "
5
5
D When computing an approximate solution, things become slightly different from what they used to be like in Lemma 3: We may assume that e used to be a part of C and that a new solution should no longer use it. Instead, it will use two edges / and / ' such that / and / ' are non-disjoint and both incident with the same vertex of e. This pair may be chosen at either end-point of e, a choice which is completely arbitrary. We conjecture that, if an improvement of the approximation guarantee is possible, this is precisely the point where to start at. Lemma 5. Let {GO,GN,C) be an admissible input for L M - ^ - T S P such that 5 := CAr(e) —co{e) > 0 for the edge e. If -QY— ^ f) there is a ^-approximation for LM-Z\-TSP. Proof. We may assume that optimal TSP tours in GN do not use the edge e. For if they did, C would already constitute an optimal solution. Fix one such optimal tour COPT, and fix one vertex w incident with e. In CQPT, W is incident with two edges / and / ' . Let v be the vertex incident with / , but not with e, and let v' be the vertex incident with / ' , but not with e. By P, denote the path from V to v' in COPT that does not involve w. Consider the following algorithm: For every pair / , / ' of edges incident with w, compute an approximate solution to the TSP path problem on the subgraph of G2 induced by the vertex set V \ {w} with start vertex v and end vertex v' where {v} = f \e and {v'} = / ' \ e. It is known [13, 14] that this can be done
Reusing Optimal TSP Solutions for Locally Modified Input Instances
259
with an approximation guarantee of | . Each of these paths is augmented by / and / ' so as to yield a TSP tour. The algorithm concludes by outputting the least expensive of all of these tours. Note that since all pairs / , / ' are taken into account, one of the considered tours uses exactly those edges / = / , / ' = / ' that CQPT uses. This is why the algorithm outputs a tour of cost at most
c(/) + c(/') + \c{P) =
{OTG,
just as in the proof of Lemma 3.
- c{P)) + \c{P) = OTG, + \c{P)
, D
Using the same arguments as in the proof of Corollary 1, the preceding lemma yields the following corollary. Corollary 2. There is a ^-approximation algorithm for the subproblem of LM-Zi-TSP where edges may only become more expensive. D 2.3 The N e a r - M e t r i c Case The algorithm outlined in Lemma 3 can be generalized to graphs which are not necessarily metric, but only near-metric, i.e., where the metricity constraint is relaxed by a factor of /3. Since it will pay off later, let us pay extra attention to the fact that input instances for all the problems from Definition 2 contain two distinct graphs, potentially obeying relaxed triangle inequalities according to different values of /?. Notice that the parameter /? need not be greater for the graph with the costlier edge. Under some circumstances, it might even decrease when we modify the cost of a single edge. In the following generalization of Lemma 1, the convention is therefore that ci is the cost function of the less expensive graph, C2 that of the more expensive one, and both Cj obey the Zi^^-inequality, i G {1,2}. Lemma 6. Let Gi = {V, E, ci) and G2 = {V, E, C2) be graphs such that Ci obeys the Afj^-inequality for i S {1,2} and some values j3i,(32 > 1 and such that c\ and C2 coincide, except for one edge e £ E. By convention, let ci(e) < C2(e). Then, every edge adjacent to e has a cost of at least '^^ ^ ^ " 3 ' ! ^ • Proof. Analogous to Lemma 1.
D
Note that for relatively small changes, the value C2(e) — /?i/32Ci(e) may well be non-positive, rendering Lemma 6 trivial in such a case. The algorithm from Lemmas 3 and 4 should be adjusted to accommodate for the relaxation of the triangle inequality. More precisely, in order to find a Hamiltonian path between a given pair of vertices in a /3-metric graph, we will employ the algorithm by Forlizzi et al. [11], a variation of the path-matching Christofides algorithm (PMCA, see [5]) for the path version of near-metric TSP, which yields an approximation guarantee of |/3^. This gives us Algorithm 1.
260
H.-J. Bockenhauer et al.
Algorithm 1 Input: An instance {GO,GN,C)
of LM-zi/3-TSP where Go = {V,E,co)
and GN =
{V,E,CN).
1. Let e £ E he the edge where co{e) ¥" <^N{e)Let S be the set of all unordered pairs {/, f'} Q E where f y^ f are edges adjacent to e such that if co{e) < CN{e): / fi / ' n e is a singleton; and i f c o ( e ) > C i v ( e ) : / n / ' = 0. 2. For all {f,f'} € S, compute a Hamiltonian path between the two vertices from ( / U / ' ) \ e o n the graph G \ ( e n ( / U / ' ) ) , using the PMCA path variant by Forlizzi et al. [11]. Augment this path by edges / , / ' , and, if co{e) > cjv(e), edge e to obtain the cycle Cyj>y. 3. Let C be the least expensive of the cycles in the set {C} U {C^fj'y \ {/, / ' } e £}. Output: The Hamiltonian cycle C
L e m m a 7. Algorithm
1 achieves an approximation
guarantee of
15/3,^ + 5 A - 6 '^'^^
10/32 + 3/3U/3H + 3/3H - 6
^ '
for input graph pairs {GO,GN) such that Go obeys the Ap^-inequality and GN obeys the Apj^-inequality and where PI := mm{po,pN} and j3„ := maxlpoj^w}Proof. Adhering t o the convention of Lemma 6, set {01,02} = {co,cjv} such t h a t ci(e) < C2(e) for all edges e e E. In other words, we have C2 = c^v if an edge becomes more expensive and ci = cjv otherwise. We m a y assume t h a t optimal T S P tours in GN = {V, E, CN) use t h e edge e iff CJV = ci; otherwise, C is an optimal solution, and we are done. F i x one such optimal tour COPT in GN, and let { / , / ' } € £ be such t h a t COPT uses both / and / ' . By P, denote the p a t h t h a t results from COPT by removing edges / , / ' , and, potentially, e. Set ^(^) a := ——— OTG^
^, . f
K
•.
and let,' tor brevity, "
9
««
15(31 +
u ': = ^PLPH '^"
5(3,-6
10/?2 + 3A/3H + 3/3H - 6
denote t h e approximation guarantee claimed in (1). In t e r m s of a, Algorithm 1 always achieves an approximation guarantee of 1 - a edges / , / ' , (potentially) e are chosen optimally
+
5 -^(3^a
,
P will be approximated
even if we did not have C at our disposal. (Note t h a t t h e strategy t o approximate P m a y rely on t h e Ap^_ inequality, i. e., t h e less relaxed one of t h e two because this strategy removes the edge e from t h e graph.) Hence, unless
Reusing Optimal TSP Solutions for Locally Modified Input Instances
261
^ - 1
we are done. Let use therefore assume t h a t (2) holds. B y Lemma 6, we have -in{c(/),c(/')} > ^ ^ ^ t ' / f r ^ ' ^
^
c,ie)-^Me)
PIP2 + P2
PLPH + PH
and hence ^ ""-
2.(c2(e)-/?,/?HCi(e)) 0TG«.(A/3„+/?H)
•
P u t t i n g this together with (2), we know t h a t 1
•d
^
2.(c2(e)-/3,/?HCi(e))
| / ? 2 - l -
O T G „ - ( A / 3 „ + /3„)
which yields C2(e) - /?L/3HCi(e) ^ /?,/3H + /?H
OTG^
-
(^ - 1) • {PL/^H +
2
M
f/3?-2
By adding {/3L/3H — 1 ) ^ ^ ^ t o b o t h sides, we are given: C2(e)-ci(e) AAi+An OTG^ 2
(^-1)-(^L/3H+/?H) f/32-2
, ,^ ^ '^'^"
.x c i ( e ) ' OTG, <1
and thus, substituting t h e value (1) for d, C2(e)-ci(e) ^ 3
_ 3 .
_
1
1^
.
(^ - 1) • ( / 3 A + A )
(/3L/3H • loffff 3/35H^+3^H-6 - ^)(/^^/^" + M
— TTPLPH + TTPH — -L —
(tedious calculations)
X5/J2 _|_ 5/5 _ g = • • • = /3L/3H • in^2_LQ/? ^ 1 Q/?
R - 1 = ?? - 1 .
IOPL^ + 3/3LPH + S/i^H - 6
Since, by t h e same reasoning as t h a t of Lemmas 2 a n d 4, reusing t h e input optimal solution C inflicts a deviation from the new optimum by at most C2(e) — ci(e) < {'d — 1) • OToff, Algorithm 1 is a t?-approximation algorithm. D Hence, whenever t h e /? values of Go and GN coincide, we have Theorem 4. T h e o r e m 4 . T/iere «s a (polynomial-time) algorithm for LM-Zi/j-TSP.
0^ •
X5/52 _|_ 5/5 15/3^ + 5 / 3_- g 6 —-—--approximation 13/32 + 3/3 - 6 '
262
H.-J. Bockenhauer et al.
- / ^ V + /3
Approximation guarantee 13-1
Cor. 3 1
1.5
2
2.5
3
3.5 Parameter /9
Fig. 2. Approximation guarantees of various algorithms, depending on (3
Interestingly, Algorithm 1 achieves a better approximation guarantee not just t h a n P M C A [5], but also t h a n Bender's and Chekuri's 4/3-approximation algorithm [3] for the most practically relevant values of ^ . T h e turning point is about at (3* « 3.34899. More to the point, Andreae's (/3^+/3)-approximation [1], which performs better t h a n 4/3 only when /5 < 3, always performs worse t h a n Algorithm 1 in the interval /? £ (1,/?*). These observations are illustrated in Figure 2. Another practical special case is t h a t where (3^_ = l,\.e., where we start with a metric graph, b u t changing the cost of an edge will violate the Z\-inequality. C o r o l l a r y 3. LM-Z\/3-TSP, restricted mits a 27^-approximation.
to those inputs where Go is metric,
adD
3 Deadline TSP In this section, we will analyze the approximability of local-modification variants of T S P with deadlines. To begin with, let us define this problem formally. D e f i n i t i o n 3 . Let G = iy,E) he a complete graph weighted by c: E ^ N"*". We call ( s , D , d ) a deadline set for G if s e V,D CV \ {s} and cZ: £» ^ N + . A vertex v £ D is called deadline vertex. A path {vo,vi,... ,Vn) satisfies the deadlines iff s = VQ and, for all Vi G D, we have Yl\^ic{{vj-i,Vj}) < d{vi). A cycle {vo,vi,... ,Vn,vo) satisfies the deadhnes iff it contains a path (VQ, vi, ..., Vn) satisfying the deadlines. D e f i n i t i o n 4. The problem Z \ / 3 - D L T S P is defined as follows: For a given complete graph G — {V,E) with edge weights c: E —^ N"*" satisfying the Ap-
Reusing Optimal TSP Solutions for Locally Modified Input Instances
263
inequality, deadlines {s, D, d) for G, and a Hamiltonian cycle satisfying the deadlines^, find a minimum-weight Hamiltonian cycle satisfying all deadlines. If \D\ is a constant k, the resulting subproblem is fc-Zi^-DLTSP. We set Z \ - D L T S P := zii-DLTSP and fc-Z\-DLTSP := A ; - Z \ I - D L T S P for all k. In the case of T S P with deadlines, we will regard it as a local modification to change a single deadline although the LM operation from the previous section would let us obtain exactly the same results. The connection between these two LM operations will be presented in detail in the journal version of this paper. Definition 5. The optimization problem L M - D L T S P is defined as: Input: A complete weighted graph G = {V,E,c), deadlines O = {s,D,do) for G with a minimal Hamiltonian cycle satisfying the deadlines O, new deadlines N = (s, D, djv) such that do and d^ differ in exactly one vertex, and a Hamiltonian cycle satisfying N. Problem: Find a minimum-cost Hamiltonian cycle satisfying N. By LM-fc-DLTSP, LM-Zi-DLTSP, LM-A;-Z1-DLTSP, hU-Afj-DhHSF, LMfc-Zi/3-DLTSP, we denote the canonical special cases of L M - D L T S P . For our proofs, we will need some reductions from the following problem, which can easily be shown to be NP-hard analogously to the proof of the NPhardness of the restricted Hamiltonian cycle problem, as presented, e.g., in [16]. Definition 6. For a given graph G = {V,E), s, t € V and a given Hamiltonian path P from s to t, the problem R H P is to decide whether G contains a Hamiltonian path starting in s, but ending in some vertex v ^t. 3.1 Bounded Number of Deadline Vertices We start with the case where only few deadline vertices occur. Note that k-AD L T S P can be approximated within a ratio of 2.5 [6, 7]. Furthermore, a lower bound of 2 — £ on the approximability, for every £ > 0, can be proved [6, 7]. We will show that this lower bound also holds for LM-fc-Z\-DLTSP. Theorem 5. Let e > 0. There is no polynomial-time (2 — e)-approximation algorithm for the subproblem of L M - A ; - Z \ - D L T S P where one deadline is increased by S, time units, £,>!, unless P = NP. Proof. By means of a reduction, we will show that such an approximation algorithm could be used to solve R H P . Let £ > 0. Let (G', P) be an input instance for R H P where G' = {V, E'), \V'\ = n + 1 , s',t' £ V, and P is a Hamiltonian path from s' to t'. Pick a 7 > ^ ^ ^ (which
^ Requiring a feasible Hamiltonian cycle as part of the input ensures that the problem is in NPO. Otherwise, it would even be a hard problem to find a feasible solution. For details, see [6, 7].
264
H.-J. Bockenhauer et al 7
Fig. 3. Increasing a deadline. All vertices v' ^ V' \ {s',t'} are connected like v.
We construct a complete weighted graph G — (V, E, c) as part of an input for LM-fe-Z\-DLTSP as shown in Figure 3: We set V := V'0{s,Di,D2}, and, for any edge e between two vertices wi,W2 G V, let c(e) = 1 if e G -E' and c(e) = 2 otherwise. All edges depicted in Figure 3 have the indicated costs while non-depicted edges obtain maximal possible costs. For these deadlines, one optimal solution C is the cycle s, Di,D2,t',... ,s',s, which uses the Hamiltonian path P from s' to t' in G'. It costs exactly 7 — 1 + 7 + 7 + n-t-7 = 47 + n — 1. All other feasible solutions visit some vertices in V between s and Di, but cost at least the amount of 1 more. Now, we increase d{Di) by ^. If G' contains a Hamiltonian path P from s' to some vertex v ^ t', a. new optimal solution is s, P,Di,D2,s, and it costs 7 + n + 1 + 7 + 2n = 27 + 3n + 1. If G' does not contain such a path, it is not possible to visit all vertices in V before reaching Di and D2. As c{{t', Di}) > 2, we cannot follow the given Hamiltonian path P because this would violate the deadline d{D2)- Similar arguments hold for every other possibility. Hence, C remains an optimal solution in this case. Thus, we could use any approximation algorithm with an approximation guarantee better than 47-
27 + 3n + 1
>2
to solve R H P . This is why approximating this subproblem of LM-fc-/i-DLTSP within 2 - e is NP-hard for all fc > 2. • Theorem 6. Let e > 0. There is no polynomial-time (2 — e)-approximation algorithm for the subproblem of LM-A;-zi-DLTSP where one deadline is decreased by ^ time units, ^ >l, unless P = NP. Proof. Let £ > 0. Like in the preceding proof, we will use a reduction from RHP. Let (G", P) be an input instance for R H P where G' = (V"', E'), \V'\ = n + 1 , s',t' G V, and P is a Hamiltonian path from s' to t'. Pick some 7 such that 27+8n -^ ^
*"•
We construct a complete weighted graph G = {V, E, c) as part of an input for LM-fc-Z\-DLTSP as shown in Figure 4: We set V := V'U{s, Di,D2, -D3, D4}, and, for any edge e between two vertices vi, V2 ^ V, let c(e) = 1 if e e -E' and
Reusing Optimal TSP Solutions for Locally Modified Input Instances Di =2n
265
7-1
:==f<'
\
„ D3 = f + 5n
D4 = 27 + 5n
Fig. 4. Decreasing a deadline. All vertices v' €V' \ {s',t'} are connected like v.
c(e) = 2 otherwise. All edges depicted in Figure 4 have the indicated costs while non-depicted edges obtain maximal possible costs. The initial deadlines are depicted in Figure 4. In this setting, an optimal solution is the cycle s,D2,Di,t',...,s',D3,D4,s, which contains the Hamiltonian path from s' to t'. This path costs 2n + 7 — 1 on its way to G', spends n on the path from t' to s', and reaches s at time 27 + 8n — 1. Now, we decrease the deadline d{Di) by S,, whereby the old optimal solution becomes infeasible. Any new solution must visit £>i before Dg- If we try to reuse the Hamiltonian path from t' to s', we have to spend 2n + 7 + 1 on the way to t'. Therefore, we cannot reach D3 if we follow the complete Hamiltonian path. Furthermore, we cannot visit any vertex v G V between visiting D3 and D4 because D3 is not reached before in + 7, going back to V would cost another 2n, and the cheapest path from V to D4 costs more than 7. This is why any solution using a Hamiltonian path between s' and t' violates one of the deadlines diDs), d{Di). If G' contains a Hamiltonian path P from s' to some v ^ t', the new optimal solution contains this path in reverse on its way to D3. The path s, Di,D2,P, D3 visits all vertices in V between v and s' and reaches D3 at time 7+5n. Therefore, this new optimal solution costs 27 + 8n. If G' does not contain such a Hamiltonian path, the optimal solution cannot visit all vertices in V before reaching D3 or even D4, and consequently, it is more expensive than 47. Thus, we could use an approximation algorithm with an approximation guarantee better than 47
27 + 8n
>2-e
to solve R H P . Hence, approximating this subproblem of LM-fc-Z\-DLTSP within 2 - e is NP-hard. D 3.2 Unbounded Number of Deadline Vertices When the number of deadline vertices is unbounded, we can show a linear lower bound on the approximability of L M - Z \ - D L T S P . Our reduction from RHP involves two steps. A first construction will guarantee that an optimal path becomes shorter by a constant factor if a Hamiltonian path exists in the RHP
266
H.-J. Bockenhauer et al.
instance. A second construction inflates this advantage. Tours which start at time X, different from those that start between times X + g and X + (g, may spend some extra time to visit a group of vertices which, unless visited early, will cause belated tours to run k times zigzag across a huge distance 7. The following lemma describes the construction in detail. See Figure 5 for an overview. Lemma 8. Let X, g,k,^,( G N such that k is even, C > 1 o-i^d 7 > g. Let G' = {V',E') be a graph with deadline set {s,D',d') such that any Hamiltonian path in G' respecting the deadlines ends in the same vertex t. Then, we can construct a complete graph G D G' and deadlines {s, D, d) such that D D D', d^jy = d' and any path that reaches t in time X can be extended to a Hamiltonian cycle which costs at most X + (A; + 2C - 4)5 + 27 , while any path that reaches t after X + g, but before X + (g can only be extended to a Hamiltonian cycle which costs at least k-2,
X
+ C 5 + ^7
Proof. We construct G = {V, E) with V = V U {Ei,. ..Ek} and edge costs as depicted in Figure 5, where b := ^(C— ^)- To aU other edges, we assign maximal possible costs. Note that the edge {t,Ei} costs exactly the same as the path Ek-\,Ek-3, • • • ,Ei. We set the deadlines
G'
p,
Ek - 1
• '^^ 9
^7
9
7
Ek
i '1 ( 2
a \ 9
E2 [
\ ^ t
/
Ek-i
7
E& \
Ei
b
^T 7
9
^7 7
b
V
s"
1 ^)9
9
\EZ/
d(Bi) = X + Cs + ( ^
7
,*,1
i ^ + 09 9
Ei I; 9 ^7 7
+ C)ff
b Bi
Fig. 5. The zigzag construction for the proof of Lemma 8. The left-hand side shows the optimal path if t is reached at time X. The right-hand side shows the optimal solution if t is reached after X + g. We set b := g{(^ — | ) and d(Di+i) := d(Di) + 7.
Reusing Optimal TSP Solutions for Locally Modified Input Instances
d{Ei):=X
+ Cg+(^+c)g
d{Ei+i) :=^ diEi) + J
267
and
for alH e { 1 , . . . ,fc - 1} .
If a path reaches t after X+g, it must proceed immediately to Ei. Note that it cannot use any other edge since it would have to use an edge of an additional cost of at least b = g{( — 5) > ff(C ~ 1)) then. Together with even the shortest path to El, this would violate this deadline. But then, it is forced to follow the sequence E2, En,,..., Ek to reach every deadline since even if we visited £^3 before £'2, we would incur an extra cost of 6, and this would violate the deadline of £^2- Hence, the Hamiltonian cycle costs at least X + g + ( ^ ^ + C,)g + ^7. A path that visits t before X can visit Ek-i,Ek^3,..., S3 before Ei because this path to Ei costs at most
X + b+{^-2)g
+ b- X +
Cg+{'^+C]9
Closing the cycle to s, we obtain a cost of at most X + C9 +
k
+ ( 9 +
1 U + 27 = X + (fc + 2C - 4)5 + 27 D
We will now employ Lemma 8 to prove the desired lower bound. T h e o r e m 7. Let e > 0. There is no polynomial-time ((^ — e) • \V\)-approximation algorithm for the subproblem of LM-Zi-DLTSP where one deadline is increased by ^ >1, unless P = NP.
do{Dx)
= 3n - 1
= 4n
.» do{D^)
= lOn
dNiDi)
= 3n-l
+ i
n do{Di)
== 6n 2n
doiDi)
=-- 8n
2n do(De)
2n
2n
= Un
Fig. 6. Increasing a deadline: If the deadline for the vertex Di is increased, using a Hamiltonian path from s to v leads to a new optimal solution.
268
H.-J. Bockenhauer et al.
Proof. By means of a reduction, we will show that such an approximation algorithm could be used to solve R H P . Let ( C , P) be an input instance for R H P , where G' = {V, E'), \V'\ = n + 1, s,t e V, and P is a Hamiltonian path from s to t. We construct a complete weighted graph G = {V, E, c) as part of an input for the L M - Z \ - D L T S P as shown in Figure 6: We set V = V U {Di,... ,De} and, for any edge e between two vertices t;i,t;2 G V, c(e) = 1, if e G E', and c(e) = 2 otherwise. To the other edges, assign costs as depicted in Figure 6, and maximal possible costs to the non-depicted edges, and set the deadlines do{Di) according to Figure 6. Pick some suitable 0 < (5 < 1 and 0 < o; < 1 such that -^^ ^ ^ "~ £. We use the zigzag construction defined in Lemma 8 with parameters X = lOn, g = 2n, C = 2, fc > (n -t- 7) j £ ^ , and 7 > M^iliOn ^ obtain the graph Go of our input instance. This guarantees 2kn + lOn < 5"f and k > a{k + n + 6). The given optimal Hamiltonian tour C in Go starts in s, uses the given Hamiltonian path in G' to t, and afterwards follows the sequence Di, D2, -D3, D4, Ds, DQ. Hence, it reaches DQ in time 13n. Following the zigzag construction, this leads to a cost of at least lOn + ( ^ ^ + C) 9 + ^7- In G^, we change the deadline for Di to d^^Di) = 3n — 1 + ^ for some ^ > 1. C remains a feasible solution. If G" contains a Hamiltonian path from s to some vertex u ^ i, an optimal solution uses this path and follows the sequence D2, Di, D^, D^, D4, DQ. This solution reaches DQ in time lOn. By Lemma 8, this cycle costs lOn + (fc + 2C - 4)5 + 27. If G' does not contain any Hamiltonian path to such a vertex v, C remains the optimal solution in the case where ^ = 1. If ^ > 2, an optimal solution follows P to t and afterwards uses the sequence D2, Di, D^, D4, D5, DQ. This solution reaches DQ in time 12n + 1 > X + g. By Lemma 8, we obtain a cost of lOn + ( ^ ^ -I- ()g + k^. This leads to a ratio of at least 10n + ( ^ - 2 ) 2 n + fc7 ^ kj > 10n + {k + i - 4)2n + 27 2kn + lOn + 27
Hence, a polynomial-time (^ -e)|T/|-approximation algorithm could be used to solve RHP. D Theorem 8. Let e > 0. There is no polynomial-time ( ( | — e) \V\)-approximation algorithm for the subproblem of L M - Z \ - D L T S P where one deadline is decreased by ^ > 1 unless P — NP. Proof idea. The proof can be done in a way similar to the proof of Theorem 7. The relevant construction is illustrated in Figure 7. Details will be given in a journal version of this paper. D Corollary 4. Let e > 0. There is no polynomial-time ((^ — e)\V'\)-approximation algorithm for L M - Z \ - D L T S P unless P = NP. D
Reusing Optimal TSP Solutions for Locally Modified Input Instances
doiDi)
= 4n
dN{D2) =
if do(D2) = 3n >n - 1
'V/^
269
3n-$
• 1
n'^^lj do{D4) = 7n
Fig. 7. Decreasing a deadline: If the deadline for the vertex D2 is decreased, the old optimal solution (depicted on the left-hand side) becomes infeasible. If G' contains a Hamiltonian path from s to v, we obtain the depicted new optimal solution. If no such Hamiltonian path exists, the new optimal solution must follow D2,Di,D3,Dz,Di,De.
4 Conclusion In this work, we have introduced and successfully applied the concept of reusing optimal solutions when input instances are locally modified. In the case of metric T S P , we are able to improve on the previously-known upper bound of 1.5, as achieved by Christofides' algorithm (applied to the new instance, ignoring the given optimal solution), with non-trivial extensions t o the near-metric case. As for T S P with deadlines, which is remarkably hard [6], we have been able t o reestablish almost all known lower bounds on the approximability of its variants in the setting of local modifications. As an open problem, we state t h e question how hard it is to approximate LM-A;-Zi/3-DLTSP. Another open problem is whether the N P - h a r d LM-Z\-TSP is also APX-hard.
References T. Andreae: On the traveling salesman problem restricted to inputs satisfying a relaxed triangle inequality. Networks 38, 2001, pp. 59-67. T. Andreae, H.-J. Bandelt: Performance guarantees for approximation algorithms depending on parameterized triangle inequalities. SIAM Journal on Discrete Mathematics 8, 1995, pp. 1-16. M. Bender, C. Chekuri: Performance guarantees for TSP with a parameterized triangle inequality. Information Processing Letters 73, 2000, pp. 17-21.
270
H.-J. Bockenhauer et al.
4. H.-J. Bockenhauer, J. Hromkovic, R. Klasing, S. Seibert, W. Unger: Approximation algorithms for TSP with sharpened triangle inequality. Information Processing Letters 75, 2000, pp. 133-138. 5. H.-J. Bockenhauer, J. Hromkovic, R. Klasing, S. Seibert, W. Unger: Towards the notion of stability of approximation for hard optimization tasks and the traveling salesman problem. Theoretical Computer Science 285, 2002, pp. 3-24. 6. H.-J. Bockenhauer, J. Hromkovic, J. Kneis, J. Kupke: On the parameterized approximability of TSP with deadlines. Theory of Computing Systems, to appear. 7. H.-J. Bockenhauer, J. Hromkovic, J. Kneis, J. Kupke: On the approximation hardness of some generalizations of TSP. Proc. SWAT 2006, to appear. 8. H.-J. Bockenhauer, S. Seibert: Improved lower bounds on the approximability of the traveling salesman problem. RAIRO Theoretical Informatics and Applications 34, 2000, pp. 213-255. 9. N. Christofides: Worst-case analysis of a new heuristic for the travelling salesman problem. Technical Report 388, Graduate School of Industrial Administration, Carnegie-Mellon University, Pittsburgh, 1976. 10. J.-F. Cordeau, G. Desaulniers, J. Desrosiers, M. M. Solomon, F. Soumis: VRP with time windows. In; P. Toth, D. Vigo (eds.): The Vehicle Routing Problem, SIAM 2001, pp. 157-193. 11. L. Forlizzi, J. Hromkovic, G. Proietti, S. Seibert: On the stability of approximation for Hamiltonian path problems. Algorithmic Operations Research 1(1), 2006, pp. 31-45. 12. H. Greenberg: An annotated bibliography for post-solution analysis in mixed integer and combinatorial optimization. In: D. L. Woodruff (ed.): Advances in Computational and Stochastic Optimization, Logic Programming, and Heuristic Search, Kluwer Academic Publishers, 1998, pp. 97-148. 13. N. Guttmann-Beck, R. Hassin, S. KhuUer, B. Raghavachari: Approximation algorithms with bounded performance guarantees for the clustered traveling salesman problem. Algorithmica 28, 2000, pp. 422-437. 14. J. A. Hoogeveen: Analysis of Christofides' heuristic: Some paths are more difficult than cycles. Operations Research Letters 10, 1978, pp. 178-193. 15. J. Hromkovic: Stability of approximation algorithms for hard optimization problems. Proc. SOFSEM'99, Springer LNCS 1725, 1999, pp. 29-47. 16. J. Hromkovic: Algorithmics for Hard Problems. Introduction to Combinatorial Optimization, Randomization, Approximation, and Heuristics. Springer 2003. 17. M. Libura: Sensitivity analysis for minimum Hamiltonian path and traveling salesman problems. Discrete Applied Mathematics 30, 1991, pp. 197-211. 18. M. Libura, E. S. van der Poort, G. Sierksma, J. A. A. van der Veen: Stability aspects of the traveling salesman problem based on fc-best solutions. Discrete Applied Mathematics 87, 1998, pp. 159-185. 19. Ch. Papadimitriou, K. Steiglitz: Some examples of difficult traveling salesman problems. Operations Research 26, 1978, pp. 434-443. 20. Y. N. Sotskov, V. K. Leontev, E. N. Gordeev: Some concepts of stabihty analysis in combinatorial optimization. Discrete Appl. Math. 58, 1995, pp. 169-190. 21. S. Van Hoesel, A. Wagelmans: On the complexity of postoptimality analysis of 0/1 programs. Discrete Applied Mathematics 91, 1999, pp. 251-263.
Spectral Partitioning of Random Graphs with Given Expected Degrees Amin Coja-Oghlan^, Andreas Goerdt^, and Andre Lanka-^ ^ Humboldt Universitat zu Berlin, Institut fiir Informatik Unter den Linden 6, 10099 Berlin, Germany COj aOinf ormat ik.hu-berlin.de
^ Fakultat fiir Informatik, Technische Universitat Chemnitz Strafie der Nationen 62, 09107 Chemnitz, Germany {goerdt, lanka}@informatik.tu-chemnitz.de
A b s t r a c t . It is a well established fact, that - in the case of classical random graphs like (variants of) Gn,p or random regular graphs spectral methods yield efficient algorithms for clustering (e. g. colouring or bisection) problems. The theory of large networks emerging recently provides convincing evidence that such networks, albeit looking random in some sense, cannot sensibly be described by classical random graphs. A variety of new types of random graphs have been introduced. One of these types is characterized by the fact that we have a fixed expected degree sequence, that is for each vertex its expected degree is given. Recent theoretical work confirms that spectral methods can be successfully applied to clustering problems for such random graphs, too provided that the expected degrees are not too small, in fact > log® n. In this case however the degree of each vertex is concentrated about its expectation. We show how to remove this restriction and apply spectral methods when the expected degrees are bounded below just by a suitable constant. Our results rely on the observation that techniques developed for the classical sparse G„,p random graph (that is p = c/n) can be transferred to the present situation, when we consider a suitably normalized adjacency matrix: We divide each entry of the adjacency matrix by the product of the expected degrees of the incident vertices. Given the host of spectral techniques developed for Gn,p this observation should be of independent interest.
1 Introduction For definiteness we specify the model of random graphs to be considered first. This model is very similar to t h a t considered and convincingly motivated in [9]. (In particular, we refer to Subsection 1.3 of t h a t paper where the model is defined.)
Please use the following format when citing this chapter: Coja-Oghlan, A., Goerdt, A., Lanka, A., 2006, in International Federation for Information Processing, Volume 209, Fourth IFIF International Conference on Theoretical Computer Science-TCS 2006, eds. Navarro, G., Bertossi, L., Kohayakwa, Y., (Boston: Springer), pp. 271—282.
272
A. Coja-Oghlan, A. Goerdt, and A. Lanka
1.1 The model Our random graphs with planted partition and given expected degree sequence are generated as follows. Let V = { 1 , . . . ,n} be the set of nodes. Partition V into k disjoint subsets V\,... ,Vk, where k is fixed. We assume that the size of each set \Vj\ > 6n for some arbitrarily small but constant 5 > 0. For i GV we let V'(i) denote the number of the subset i belongs to, that is i € V^(i). We fix some symmetric k x A;-matrix D = [dij) with non-negative constants as entries. Moreover, we assign some weight Wi to each node i GV. We let W^ = ^ Wi and w = W/n be the arithmetic mean of the WiS. We construct the random graph G = {V,E) by inserting each edge {i,j} independently with probability Wi • Wj • d^{i),ip{j) /W. Of course the parameters should be chosen such that each probability is bounded above by 1. (It has some mild technical advantages to allow for loops as we do.) Depending on the matrix D, we can model a variety of random instances of clustering problems. For example we can generate 3colourable graphs, then the Vj are the colour classes, or graphs having a small bisection, in which case the Vj are the two sides of the bisection, or graphs with subsets of vertices which are very dense or sparse... The algorithmic problem is to efficiently reconstruct the Vj (or large parts thereof) given such a random G. Note that the model from [9] allows for directed edges where the minimum expected in- and out-degree of each vertex is log n. We restrict our attention to undirected graphs. We denote the expected degree of vertex i by w'^, then ,
Wi
sr^
jev
In order for our algorithm to work properly we impose the following restrictions on the model's parameters: 1. The matrix D has full rank. 2. We have Wi > e -w fox all i, where e is some arbitrarily small constant. 3. w > d, where d = d{£,D,5) is a sufficiently large constant. Our asymptotics is such that n gets large, while D,k,e,S,d are fixed. On the other hand the weights Wi can be picked arbitrarily subject to our restrictions (in particular depending on n) and the subsets Vj with \Vj\ > Sn are arbitrary, too. Our restrictions 2. and 3. imply that I • Wi < w"^ < u • Wi ior constants I = l{e,D,5) and u = u{£,D,5) that is w^ = 0{wi). This shows the extent to which we consider graphs with given expected degree sequence. Note that depending on the weight Wi 2. and 3. allow w'^ among others to be constant, independent of n. 1.2 Motivation and related literature The analysis of large real life networks, like the internet graph, social or bibliographical networks is one of the current topics not only of Computer Science.
Spectral Partitioning of Random Graphs with Given Expected Degrees
273
Clearly it is important to obtain efficient algorithms adapted to the characteristics of these networks. One particular problem of interest is the problem of detecting some kind of clusters, that is subsets of vertices having extraordinarily many or few edges. Such clusters are supposed to mirror some kind of relationship among its members (= vertices of the network). Heuristics based on the eigenvalues and eigenvectors of the adjacency matrix of the network provide one of the most flexible approaches to clustering problems applied in practice. See for example [15] or the review [19] or [18]. Note that the eigenvalues and eigenvectors of symmetric real valued matrices, first are real valued and second can be approximated efficiently to arbitrary precision. The relationship between spectral properties of the adjacency matrix of a graph on the one hand and clustering properties of the graph itself on the other hand is well established. Usually this relationship is based on some separation between the (absolute) values of the largest eigenvalues and the remaining eigenvalues. It has a long tradition of being exploited in practice, among others for numerical calculations. However, it is in general not easy to obtain convincing proofs certifying the quality of spectral methods in these cases, see [23] for a notable exception. Theoretically convincing analyses of this phenomenon have been conducted in the area of random graphs. This leads to provably efficient algorithms for clustering problems in situations where purely combinatorial algorithms do not seem to work, just to cite some examples [2], [3], or [4], or the recent [20] and subsequent work such as [14]. In particular [3] has lead to further results [10], [11]. The reason for this may be that [3] is based on a rather flexible approach to obtain spectral information about random graphs [12]: Spectral information directly follows from clustering properties known to be typically present in a random graph by (inefficient) counting arguments. We apply this technique here, too. In order to explain the success of spectral algorithms to detect clustering properties of large real life networks the preceding results do not seem to be readily applicable. As opposed to classical random graphs such networks are well known to have many vertices whose degree deviates considerably from the average degree, that is the degree distribution has a "heavy tail", or it seems to follow a "power law" , see for example [1] . And in fact in [21] it is shown that the largest eigenvalues of a random graph with power law degree distribution are proportional to the square root of the largest degrees, and thus do not reveal any non-local information about the graph. This result looks somehow related to the fact that the largest eigenvalue of a sparse random graph Gn,p where p = c/n is always the square root of the largest degree of the graph and that there is an unbounded number of eigenvalues of this size, see [16]. However, in the case of classical random graphs it helps to delete the vertices of highest degree as observed by [3] leaving the clustering properties of the graph essentially unchanged. However, in the case of a degree distribution with a heavy tail this trick is not useful, because significant parts of the graph may
274
A. Coja-Oghlan, A. Goerdt, and A. Lanka
just be ignored in this way. Thus, the adjacency matrix itself does not seem appropriate to represent graphs with heavy-tailed degree distributions. To come to terms with varying degrees the Laplacian matrix is considered, see [5] for a nice exposition of the relationship of the Laplacian spectrum to clustering properties of general graphs. It is also used in practical applications, cf. [22]. However, for randomly generated graphs it is more difficult to handle theoretically than the adjacency matrix. As far as classical random graphs are concerned it is already a major difficulty to get insight into the Laplacian spectrum, at least in the interesting sparse case. The difficulty stems from the fact that in this case the graph is not asymptotically regular. See however [6] for very recent progress in this direction. Clustering problems in the denser case can be treated with the help of the Laplacian even for random graphs modelling real networks as our model does (which allows for arbitrary, in particular heavily tailed degree distributions): In [9] it is shown that the Laplacian eigenvalues allow to find the partition in the model considered here, too (provided that the average degree is ;§> In n). Laplacian eigenvalues of random graphs with given expected degree sequence are also investigated in [8]. Both papers rely on [13] and in part on [17] to obtain information about the spectrum. This makes it inevitable that the degree is > log n, in fact > log^ n in the case of [9]. The case of small expected degrees as considered here is interesting because the actual degree of a vertex is not any more concentrated at the expected degree. It is also mentioned in the concluding section of [9]. Independently of its applications to graph partitioning problems, we have also investigated the Laplacian eigenvalues of sparse graphs with given expected degrees in [7]. 1.3 Techniques and result We consider the following algorithm to reconstruct the Vj for random graphs as generated by our model. Only for technical simplicity we restrict our attention to A; = 2. It poses no substantial difficulties to extend the algorithm to arbitrary, yet constant k: Instead of the two eigenvectors 82,83 we use k eigenvectors S2, • • • ,Sfc+i. The sufficiently large constants Ci,C2,C3 depend on the actual partioning problem. The values can be calculated with the knowledge of D, s and 5. Algorithm 1. Input: The adjacency matrix A of some graph G — {V, E) generated in the above model and the expected degree sequence w'l,... ^w'^. Output: A partition VI, V^ of V. 1. Calculate the expected average degree, w' = Yll^=i ^ i / ^ 2. Construct R = {rij) with rij = w'^ • aij/{w[ -w'^)3. Let 81 — R-1 where 1 is the all one's vector. 4. Let [/ = {i e F : ^ ^ =1 Tij < Ci • w'} for some sufficiently large constant Ci. 5. Construct R* from R by setting all entries rij with i ^ U or j ^ U to 0.
Spectral Partitioning of Random Graphs with Given Expected Degrees
275
6. Calculate the eigenvectors of R*. 7. Let S2,S3 be two eigenvectors of R* belonging to different occurrences of eigenvalues which are > C2 -w' in absolute value. 8. At least one of the si, 52,^3 turns out to have the property that all but C3 • {n/w') entries are close to two sufficiently different values ci, C2. Let V! be all the entries close to Cj for i = 1,2. Distribute the remaining entries arbitrarily among the V!. Some remarks are in order. First observe that the algorithm besides the graph needs the expected degree sequence as additional information. Note that the algorithm of [9] even gets the Wi themselves. The main idea is to use the normalized adjacency matrix R, where we divide each entry of the adjacency matrix by the expected degrees of the incident vertices (the additional factor of wJ'^ is only for technical convenience.) It is this choice of the matrix which makes our analysis possible. Of course, a natural idea is to divide the entries by the actual degrees rather than the expected degrees, in order to remove the requirement that w^,... w^ are given at the input. In fact, it turns out that this approach can be carried out successfully, i.e., the resulting matrix is suitable to recover the planted partition as well. Nonetheless, since the analysis is technically significantly more involved, we omit the details from the present extended abstract (the complete analysis will be given in the full paper version of this work). In fact using R we get a situation formally rather similar to the case: classical sparse random graph with a planted partition and adjacency matrix, the situation as considered in [3] or [20]. Note that all entries rtj with the same (•0(i), V'(i)) have the same expected value which makes the analogy possible. In particular we can apply [12]. The vector si is necessary in order to recognize partitions which can be readily recognized just from the row sums of R. Step 5. has the analogous effect on the spectrum of R as has the deletion of high degree vertices in the case of sparse random graphs on the spectrum of the adjacency matrix. Being eigenvectors of different occurrences of eigenvalues, S2 and S3 are orthogonal to each other. Notions "vague" up to now, like "close" or the d, Ci in the algorithm are made precise through the subsequent proof of Theorem 2. Let D, e, 5 as defined above. There exists constants Ci,C2,C3 with Ci = Ci{D,s,6) such that the following property holds: Let G be some graph generated in the above model. With probability 1 — o(l) with respect to G Algorithm 1 produces a partition which differs from the original partition V\.,V2 only in 0(n/w') vertices. Note that the number of vertices not classified correctly is 0{n/w') = 0{n/W) and thus decreases linearly in w. We present the proof of Theorem 2 in the following two sections. The proof in section 3 is based on some notions and lemmas used throughout. These are presented in section 2.
276
A. Coja-Oghlan, A. Goerdt, and A. Lanka
2 Notation and basic facts We use the following notation. 1. II • II denotes the Z2-norm of a vector or matrix. 2. The transpose of a matrix or vector M is written as M*. 3. For U C.'N and a vector v we construct the vector v\u by setting the ith component oi V\ij to Vi if i G U and to 0 if i 0 [/. If {7 is clear from the context, we write simply v*. For a matrix M we obtain M* by setting all entries rriij := 0 ii i ^ U or j ^ U. For a set of vectors S we define S* = {v* :ve S}. 4. We abbreviate ( 1 , . . . , 1)* by 1. 5. For a matrix M = {rriij) we define SM{X,Y)
= ^
rrixy.
xex yeY
The Courant-Fischer characterization of eigenvalues reads Fact 3. Let A € K"^" be some symmetric matrix with eigenvalues Ai > . . . > A„. Then Xi+i =
min A\mU=j
\n-i
=
max dimU=i
max x^Ax \\x\\ = l
min x^Ax \\x\\ = \
where U^ denotes the orthogonal complement to U. The next two lemmas are slight generalizations of two lemmas from [3]. Lemma 1 is proved as Lemma 3.4 in that paper for 0 — 1 random variables. Our generalization can be derived analogously. Lemma 1. Let xi,...,Xn independent random variables each having exactly two possible values from the interval [0, b] and the same expectation /x, such that for all i Pr[xi = 0] = l-pi
and
P r [xj 7^ 0] = P r [xj =/i/pi] = pj.
Let a i , . . . , a„ real numbers from [—a, a] and Z = Y17=i ^i' ^i- V foi^ S, D and some constant c > 0 n
Y^af
and
S < c-e" • D •/j/a
i=l
hold, then Pr[\Z -E[Z]\
> S] <2e^>^~-^-D>'.
Spectral Partitioning of Random Graphs with Given Expected Degrees
277
Let R be some n x n-matrix with random entries r^ and let V = { 1 , . . . , n} be the set of indices. We assume either that all r^ are independent or that the only dependence is due to symmetry. We assume that the collection of the Tij's otherwise has the same properties as the Xi's in Lemma 1, in particular E [rjj] = iJ,. The subsequent Lemma 2 is as Lemma 3.6 in [3]. Its proof is analogous. A similar lemma occurs as Lemma 2.5 in [12]. Lemma 2. With probability 1 — o(l) for any pair {A,B) of sets A,BCV following holds: Ifm^ max{|A|, \B\} < n/2 then 1.SR{A,B)
= 0{E{SR{A,B)])
the
or
^•«i^(AS)-lngggIj=0(m.ln^). Let R he a, random matrix as above and .B > 1 be some constant. For symmetric Rlet U CV he given by u £ U if and only if S}i{V, {u}) =
SR{{U},
V) <
B
• fi • n.
For non-symmetric R we define U = {u&V
: max(sfl({M}, V), SR{V, {U}))
The following lemma is at the heart of our results. It is a transfer of Lemma 3.3 in [3] and Theorem 2.2 in [12]. In contrast to [3] and [12] we require that only the vector y is perpendicular to 1. The proof is similar to [3] and [12]. In particular recall item 3. of the notation as introduced above. Lemma 3. For R and U as above with probability 1 — o(l) we have for all unit vectors x,y G (K")* with y ± 1 that |a:'i?y| = 0 ( ^ / i • n).
3 The analysis of the algorithm Let G = (V,-E), D, Vi, V2 and wi,.. .,Wn as in Subsection 1.1. Let di he the actual degree of i in G. For W QV we define ^{W) = "^Zi^w'"'» '^^'^ abbreviate ^i := ${Vi)/${V). Since al\wi>e-w = i?(wJ) and \Vi\ = J7(n) we have
^{V)
wn
wn
n
and each ^i are bounded away from 0 by some constant. For i GVI we have E [d,] = «;^ = 5 ^ d u • ^ ^ ^ +^d^2w•n -^
^ ^ ^ = Wi . ( d n ^ i + di2^2) w•n
jevi
and for i e V2 we get
'w[=Wi-
{di2$i + 0(22^2)•
278
A. Coja-Oghlan, A. Goerdt, and A. Lanka
Since D is of full rank, we have no row containing only 0. So, each wj is 7^ 0 and w[ = 0{wi). The expected average degree w' in G is n
,
I
•^ n
^
i=i
ieVi
= w • (dn^l
n
^—^ n ieV2
n + 2 • di2^i^2 + d22^l) = 0{w).
Let A be the adjacency matrix of G. We construct R by multiplying each entry Uij with w''^/{wl • w'j) — Q{vP'j{wi • Wj)) = 0 ( l / e ^ ) . So each entry in R is bounded by some constant. We have for i,j e Vi E[rijJ = d i i • - = — ' - • — j,= w-n w[-w'-'
du
w-n
(dii
for i € V^i, j G V2 or the other way round uJ'2 E [vij] ^ di '•^ ^^ w-n
{dn^i + ^12^2) • (^12^1 + d22^2)'
and finally for i,j G V2
•'
w'^ w-n
{di2^i
+d22^2Y
We obtain a symmetric 2 x 2-matrix M = {niij) of expectations such that E [vij] = m^{i),^{j)- With X
(dii#l+dl2^2)"^ 0 0 {di2^i + d22<^2) - 1
we get M = ^-X-('{'''{''~]-X w-n \ui2 "22/
=
w•n
^-X-D-X
If e = (ei 62) is some eigenvector of D, then ( e i / x n 627x22) is an eigenvector of X • £) • X with the same eigenvalue. So, the eigenvalues oi X - D - X are determined only by D, and are ^ 0. We divided the entries of e by the xu. This makes the entries larger, but at most by some constant factor independent of w' or n. So, the normalized eigenvectors oi X • D - X have entries, that are bounded away from 0 by some constant. We need this fact later. We summarize, M has 2 eigenvalues, whose absolute value is Q{w'^/{wn)) ^
fi{w'/n)
Spectral Partitioning of Random Graphs with Given Expected Degrees
279
and all the entries of the normalized eigenvectors are Q{1). The expected row-sum sji{{i},V) for some i £Vi is
w -n
\
xf 1
xii • 0:22
and for i G V2 W'^ ( di2\Vi\ , ^221^2 w • n \ x i i • X22+ -^ff^ a;22
= 0(^')-
(2)
The number of rows with SR{{i}, V^) > 5 • E [si?({i}, V)] is with high probability e-^(^') • n. This can be shown as follows: Use Lemma 1 to calculate the probability that a fixed i is such a row. This probability is e-^^""'). So, we have an expected number of such rows bounded by e^^^'" •* • n. Since the dependence between any two rows is small, we have a relatively small variance and Chebycheff's inequaltity gives the result. If (1) and (2) differ by a factor of at least 25, we can simply detect large parts of Vi and V2 by partitioning the rows by the value of sii{{i},V). This is the reason for si in the algorithm. If (1) and (2) are closer, then both are relatively near to the average row-sum, which is 0{w'). Now, let U be the set of all i, with SR{{'>-}J y) ^ C • w'. The exact value of C depends on D, e and the lower bound S on |l^|/n. A similar calculation as above shows, that \U\ > (1 — e"^'^'^ )) • n. L e m m a 4. With high probability for any set X CV have SR(X, V) = Q-^^"^'^ • n. Proof. Let Xi = X nVi.We
with \X\ = e"^^'^^ • n we
have that 2
sn{X,V)=
J2SR{X,,VJ).
If we can show, that with high probability for each summand the bound g-fi(«)) . ^ holds, then the assertion follows. We give the proof for SR{XI,VI) explicitly. The remaining cases follow analogously. Fix some set Xi C Vi with \Xi\ = Sn = e""^"^ • n, where ci is some arbitrarily small constant. Then FI[SR(XI,VI)] = 0{mii • \Xi\ • \Vi\) = 0{w' • |Xi|)=e-^(^')-n. Let t — \Xi\- \Vi\. We use Lemma 1. For {u, v} C Xi we set Xj in the lemma to ruv with u < V and ai to 2, because such entries are counted twice in the sum. For the other terms in SR{XI, VI), namely ruv with u & Xi and v ^ Xi we let Xi = ruv and a^ = 1. This gives for the lemma, that a = 2, D <2t and jj, = mil. We choose 5 = c • e"^ • mn -t = c-e'^ • 0(w' • Sn) = e"^^"' ^ • n for some constant c determined later. Then Pr{\sR{Xi,Vi)-mn-t\>S]<2'
-n{S^/{mii-e''-t)) = 2 • e~^(<= «"•'""•*) ^ 2 . g-«(c^'e°-tu'-i5n)
280
A. Coja-Oghlan, A. Goerdt, and A. Lanka
The number of sets Xi possible is bounded by f\Vi\\
< /^"^ <
/'£y"^gfc-5in5.n^gfc+0(fe.i«')
A union bound gives that the probabihty for the existence of a set Xi contradicting the claim is
if c is large enough (but still constant). For sets Xi with cardinality < 5n the same bounds for SR{XI, Vi) and the probability hold, since we can fill them up until they contain exactly 5n elements without decreasing SR{XI, VI). U By the above lemma we see that the sum of the entries we loose by building R* is bounded e-'"^^') • n. Thus, we have that ||i? - i?* || < e-"^"^'^ • n. And for all unit vectors f,gwe have max/,g \f{R - R*)g\ < \\R - i?*|| = e-^(^') • n. Let e = (ei 62) be some normalized eigenvector of M and xii X2 be the characteristic vectors of 14, V2 (XiiJ) = 1 if j G 1^ and 0 otherwise) and a = |Vi| /n, /? = IV2I / n . Let g = e\ • 0 • xi + ^2 • oi • X2 • Then ll^ll = Vefa/32n + e'ia^pn = 0 ( V ^ ) . We have with probability 1 — o(l) that asymptotically g'Rg = el • /3''SR{VI, VI) + 2eie2 • a/3sR{Vr,V2) + elsR{V2, V2) = e\ • a^0^ • n^ • m n + 2eie2 • a^/3^ • n^ • mu + el • a^/3^ • n^ • m22 = a^/3^ • n^ • (el • m n + 2eie2 • mi2 + 6^77122) =
a^(3'.n'.{e,e2)-M.(llj.
Since all eigenvalues of M are in absolute value 0(w'/n) \9'R*9\ > \9*Rg\-e'"'-^"^
we get
-n = a'^13'^ -n^ -Qiw' /n)-e-"^'^'^
-ein) = Q{w' -n),
by using the triangle inequality. Thus, using the 2 eigenvectors of M, we can construct 2 orthogonal vectors g and h for R* such that 9l_ T,* _9_ M • • M
n{w')
and
h'
h
F n r - ^R* *-¥I¥ \\h\\ "
m
=^(w').
By Fact 3 we obtain, that at least two eigenvalues of R* are f2{w') in absolute value. It is important that all the other eigenvalues of R* are bounded by O ( v ^ ) in absolute value. Let u and v some unit-vectors with u perpendicular to g and h. Because both g and h are linear combinations of xi and X2, u is also perpendicular to xi and X2We partition u into ui, U2 as V is partitioned into Vi, V2- By the same principle we construct iij, -Rj^- and R*i,y Then
Spectral Partitioning of Random Graphs with Given Expected Degrees 2
max \v*R*u\ — max uA.g,h
281
2
"S " ^i^**.i"i t>,*J?*j oW, < max \>" \v^R*i jUj ^uA . Yl u±g,h
«,i=i
(3)
i,j=i
If u and t; maximize the above terms, we can assume that u = u* and v = v*. Then the Uj = Wj* are perpendicular to 1. In addition we have v\-R*i^j -Uj = Vj** • Rij • Uj*. By the construction of R we have for all Rij that the entries are bounded by some constant and the expectation of each entry is the same, namely 0{dij -w'/n). Lemma 3 allows us to bound each term in the above sum by 0{\w'). Fact 3 can be used to bound the remaining eigenvalues of R* by O(V^). Finally we show that it is possible to obtain Vi and V2 by investigating the eigenvectors of R*. For this let vi, V2 be two orthonormal eigenvectors of R* with eigenvalue Q{w') (in absolute value). Then Vi can be written as Vi = Ci • rrii + di • Ui with 11 Will = 11 Will = 1 and cf + df = 1. rrii comes from the space spanned by g and h, and Ui comes from the orthogonal complement. Then by the bound for (3) \v^R*Ui\ = n{w') • \vl • Ui\ = Q{w') • \di\ = and \di\ must be 0{l/^/W). l-0(l/v^). Since
0{\/^),
As |ci| + \di\ > c? + rf? = 1, we have |cj| =
0 = v\v2 = ciC2m\m2 + Cid2m\u2 + C2diu\m2 + d\d2u\u2 we have \c1C2m\m2\ = \c1d2m\u2 + C2diu\m2 + did2u\u2\ < \c1d2m\u2\
+ \c2d1u\m2\
+ |(ild2WiW2|
= \did2u\u2\ < \did2\ = 0{l/w'). Together with Cj = 1 — 0{1/Vw') we can follow that mi and 1712 must be almost perpendicular. We write rrii = ji- Xi/\/n-\-5i • X2/V^- For at least one i we have |7i — 5i| > e for some small constant e, otherwise TOI and m2 could not be almost perpendicular. Taking this nii, we have that the entries belonging to Vi differ from the other entries by at least e/i/n. This gives us the chance to identify the Vi, V2 by the entries of rrij. Unfortunaly, we have only Vi and not mj. But we can assume, that in Cj • rrii the distance of e/{2y/n) still holds, because Cj > (1 — 0{l/w')) > 1/2. It is possible, that some entries j in u change the value of Cj • mi{j), such that we put j into the wrong partition. This may happen, if the value is changed by at least £/(4y^). But such entries are relatively rare. The entry in Wj must have an absolute value of J7(vw) • e/{4^/n), because \di\ = 0 ( 1 / V w ) is small. The number of such entries is bounded by 0{n/w') since u has length 1. We obtain, that we are able to partition at least (1 — 0{l/w')) • n vertices correctly by visiting the eigenvector Vi of R*. This finishes our proof of Theorem 2.
282
A. Coja-Oghlan, A. Goerdt, and A. Lanka
References 1. Aiello, W, Chung, F., Lu, L.: A random graph model for massive graphs. Proc. 33rd. SToC (2001), 171-180. 2. Alon, N. Spectral techniques in graph algorithms. Proc. LATIN (1998), LNCS 1380, Springer, 206-215. 3. Alon, N., Kahale, N.: A spectral technique for coloring random 3-colorable graphs. SIAM J. Comput. 26 (1997) 1733-1748. 4. Boppana, R.B.: Eigenvalues and graph bisection: An average case analysis. Proc. 28th FoCS (1987), 280-285. 5. Chung, F.K.R.: Spectral Graph Theory. American Mathematical Society (1997). 6. Coja-Oghlan, A.: On the Laplacian eigenvalues of Gn,p- Preprint (2005) http://wvirw.informatik.hu-berlin.de/~coja/de/publikation.php. 7. Coja-Oghlan, A., Lanka, A.: The Spectral Gap of Random Graphs with Given Expected Degrees. Preprint (2006). 8. Chung, F.K.R., Lu, L., Vu, V.: The Spectra of Random Graphs with Given Expected Degrees. Internet Mathematics 1 (2003) 257-275. 9. Dasgupta, A., Hopcroft, J.E., McSherry, F.: Spectral Analysis of Random Graphs with Skewed Degree Distributions. Proc. 45th FOCS (2004) 602-610. 10. Feige, U., Ofek, E.: Spectral Techniques Applied to Sparse Random Graphs. Random Structures and Algorithms, 27(2) (2005), 251-275. 11. Flaxman, A.: A spectral technique for random satisfiable 3CNF formulas. Proc. 14th SODA (2003) 357-363. 12. Friedman, J., Kahn, J., Szemeredi, E.: On the Second Eigenvalue in Random Regular Graphs. Proc. 21th STOC (1989) 587-598. 13. Fiiredi, Z., Komlos, J.: The eigenvalues of random symmetric matrices. Combinatorica 1 (1981) 233-241. 14. Giesen, J., Mitsche, D.: Reconstructing Many Partitions Using Spectral Techniques. Proc. 15th FCT (2005) 433-444. 15. Husbands, P., Simon, H., and Ding, C : On the use of the singular value decomposition for text retrieval. In 1st SIAM Computational Information Retrieval Workshop (2000), Raleigh, NC. 16. Krivelevich, M., Sudakov, B.: The largest eigenvalue of sparse random graphs. Combinatorics, Probability and Computing 12 (2003) 61-72. 17. Krivelevich, M., Vu, V.H.: On the concentration of eigenvalues of random symmetric matrices. Microsoft Technical Report 60 (2000). 18. Lempel, R., Moran, S. Rank-stability and rank-similarity of link-based web ranking algorithms in authority-connected graphs. Information retrieval, special issue on Advances in Mathematics/Formal methods in Information Retrieval (2004) Kluwer. 19. Meila, M., Varna D.; A comparison of spectral clustering algorithms. UW CSE Technical report 03-05-01. 20. McSherry, F.: Spectral Partitioning of Random Graphs. Proc. 42nd FoCS (2001) 529-537. 21. Mihail, M., Papadimitriou, C.H.: On the Eigenvalue Power Law. Proc. 6th RANDOM (2002) 254-262. 22. Pothen, A., Simon, H.D., Liou, K.-P.: Partitioning sparse matrices with eigenvectors of graphs. SIAM J. Matrix Anal. Appl. 11 (1990) 430-452 23. Spielman, D.A., Teng, S.-H.: Spectral partitioning works: planar graphs and finite element meshes. Proc, 36th FOCS (1996) 96-105.
A Connectivity Rating for Vertices in Networks Marco Abraham^, Rolf Kotter^^, Antje Krumnack^, and Egon Wanke^ ^ Institute of Computer Science, Heinrich-Heine-Universitat Diisseldorf, D-40225 Diisseldorf, Germany ^ C. & O. Vogt Brain Research Institute, Heinrich-Heine-Universitat Diisseldorf, D-40225 Dusseldorf, Germany 3 Institute of Anatomy II, Heinrich-Heine-Universitat, Dusseldorf, D-40225 Dusseldorf, Germany
A b s t r a c t . We compute the influence of a vertex on the connectivity structure of a directed network by using Shapley value theory. In general, the computation of such ratings is highly inefficient. We show how the computation can be managed for many practically interesting instances by a decomposition of large networks into smaller parts. For undirected networks, we introduce an algorithm that computes all vertex ratings in linear time, if the graph is cycle composed or chordal.
1 Motivation and Introduction This work is originally motivated by the analysis of networks t h a t represent neural connections in a brain. T h e cerebral cortical sheet can be divided into many different areas according to several parcellation schemes [4, 9, 20]. T h e primate cortex forms a network of considerable complexity depending on the degree of resolution. Information forwarding is usually accompanied by the possibility to respond. Thus, t h e corresponding networks are generally strongly connected. Prom a systems point of view, it is a great challenge t o analyze the influence of a single area to the connectivity structure of the hole system. Such information could be helpful to understand the functional consequences of a lesion. We measure the influence of a vertex on the connectivity structure of a directed graph G = {VG, EG) by a function > based on the Shapley value theory, which was originally developed within game theory^, see [16]. Our function 0 is parameterized by a so-called characteristic function denoted by / Q . It counts for a set of vertices V C VG the number of strongly connected components in the subgraph of G induced by the vertices of V. In general, a characteristic function is a mapping from the subsets of a set of abstract objects A'^ to the real numbers R. T h e application of Shapley value computations to graphs was first done by Myerson in [10], who considered only undirected graphs. For a characteristic function h : 2^° —> R defined on vertex sets, Myerson analyzed ^ In game theory literature the argument of (/> is a game (usually denoted by letter v) over an abstract set of players A'' and the result is a vector of R^. Since we consider graphs, we prefer to use letter v for vertices rather for functions. Please use the following format when citing this chapter: Abraham, M., Kotter, R., Krumnack, A., Wanke, E., 2006, in International Federation for Information Processing, Volume 209, Fourth IFIP International Conference on Theoretical Computer Science-TCS 2006, eds. Navarro, G., Bertossi, L., Kohayakwa, Y., (Boston: Springer), pp. 283-298.
284
M. Abraham et al.
the function that computes for a given vertex set V the sum of all h{V"), where V" is a vertex set of a connected component in the subgraph of G induced by v . That is, for undirected graphs, our function i?!)/^ is equivalent to the function defined by Myerson (called Myerson value) for the case that h{V") = 1 for all V" C VG. Several authors have already analyzed the computation of Shapley values defined for vertices in graphs. Owen shows in [12] how to compute Myerson values for trees. Gomez et al. prove in [7] a simple separation property for undirected graphs that can be used to compute some Myerson values more efficiently. Van den Brink and Borm analyze in [18] a characteristic function for vertex sets of directed graphs and show that the Shapley values for this function can be computed efficiently. However, this characteristic function covers only a local property of the vertices. Deng and Papadimitriou consider in [2] a characteristic function that sums up the weights of all edges between two vertices of V. The paper is organized as follows. In Section 2, we recall the definitions we need from Shapley value theory [16]. In Section 3, we introduce a binary relation on vertices called strong separability. If two vertices u, v are strongly separable then the rating 4>f^ (u) is independent of the existence of v and vice versa, that is, (pfaiu) = 4>fG-{v}(^) ^'^^ 4'fai''^) = 'Pfa-iuy (''^)' where G — {u} is graph G without vertex u and G—{v} is graph G without vertex v. This allows us to decompose a directed graph into subgraphs such that the ratings of the vertices in the original graph are computable by the ratings of the vertices in the subgraphs (Theorem 1). We also show that deciding whether two vertices u,v are not strongly separable is NP-complete (Theorem 2) and deciding (?!>/c (u) < 'Pfa (^) foi' t'^0 given vertices u, v is NP-hard. This implies that an algorithm for the computation of 4>f^ can be used to decide an NP-hard as well as a co-NP-hard decision problem. In Section 4, we consider undirected graphs as a special case of directed graphs where undirected edges are represented by directed edges oriented against each other. Definition 1 applied to undirected graphs yields that two vertices are strongly separable if and only if there is no chordless cycle passing u and V. The extension of Theorem 1 to undirected graphs (Theorem 4) allows us to compute the rating 4>fa{u) for all vertices in linear time if G is cycle composed (Theorem 5) or chordal (Theorem 6). Although some of the results shown in this paper can be extended to a much more general case, we restrict ourself to the one characteristic function fo- This reduces the mathematical notations and keeps the proofs as simple as possible.
2 T h e Shapley value Let N be any set of abstract objects. A characteristic function / is a mapping from the subsets of A'" to the real numbers R with /(0) = 0. A carrier of / is a set C C A?" such that f{S) = f{S 0 C) for every S Q N. Any superset of
A Connectivity Rating for Vertices in Networks
285
a carrier C of / is again a carrier of / . The objects outside a carrier do not contribute anything to the computations by / . The sum (superposition) of two characteristic functions / and g, defined by (/ + 9){S) = f{S) + g{S), is again a characteristic function. Let TT be any permutation of A'', that is, TT is a one to one mapping of N to itself. For a set 5 C A'' let n{S) = {^{x) \ x e S) he the image of S under TT. Let /,r be the characteristic function defined by /^(S') = /(7r~^(5)). To rate the objects of N with respect to a characteristic function / , we use a function <> / that associates with every characteristic function / a rating function (f>f : N -^R such that
(Axiom 1:) for every permutation n oi N and all x G N,
(Axiom 2:) for every carrier C of / ,
x;>/(:r) = /(c), xec
and (Axiom 3:) for any two characteristic functions / and 5, (l^f+a ='Pf + ' 'gShapley has shown in [16] that function
*,M= E
"^1' "X'-1^1" (/(.)-/(5-M)), '
SCN, xes
(1)
'•
where l^l and |A''| denote the size of S and C, respectively, or alternatively by 1 •^Z^^) = IM E ifirr^i^'^) U W) - fimiT^,^))),
(2)
TTGil/V
where 11N is the set of all one to one mappings (enumerations) w : N {!,..., |iV|} and m('K,x) = {y E N \ ^(y) < 7r(x)} is the set of all y G A^ arranged on the left side of x.
3 A vertex rating for directed graphs We now define a characteristic function fa to rate the vertices in directed graphs. The rating will measure the influence of a vertex on the connectivity
286
M. Abraham et al.
structure. The smaller the rating of a vertex the greater its importance to the connectivity. Let G = {VG,EG) be a finite directed graph, where VG is a finite set of vertices and EG C VG X VG is a finite set of directed edges. A path in G is a sequence p = {vi,... ,Vk), k > 1, oi distinct vertices such that (vi,Vi+i) G EG for i = 1 , . . . , A; — 1. We say, p is a path of length k from vi to Vk- A path is called a cycle of G if G additionally has edge {vk,vi). We will consider only simple paths and cycles in which all vertices are distinct. For a vertex set V C VQ, let G\v' be the subgraph of G induced by the vertices o f y , that is, G|K' = (VQ', Ec) where VQ' =V' undEo' =-EnV^'xV^'. G is strongly connected if for every pair of vertices u,v G VG there is a path from u to u in G. A strongly connected component of G is a maximal strongly connected subgraph of G. Let SCC(G) be the set of all strongly connected components of G, and / G be a function from the subsets of VG to the real numbers R (here we need only the set of non-negative integers) such that for every subset V C VG, / G ( n = |SCC(G|vOIThat is, / G ( ^ ' ) is the number of strongly connected components in the subgraph of G induced by the vertices of V. Note that / G is a characteristic function, because / G ( 0 ) is always zero. The complete vertex set VG is always the only carrier of / G for every directed graph G. By Axiom 2, we have
J2haiv)=fG{VG)
= \SCG{G)\.
veVa
Figure 1 shows an example of the vertex rating (j)f^ for a directed graph G with vertex set VG = {f i, ^'2, ^3, V4, v^, VQ, v-r, v^}. Since G is strongly connected, we get fciVo) = Y^veVa'^foi'") = 1- Following the computation of (j)fc by Equation 2, vertex vs has rating (j)f^{v8) = 5, because /G("^(7'',U8) U {VS}) — /G(m(7r, Vg)) = 0 if and only if 7r(v6) < 7r(z;8). Otherwise, we have fG{m{TT, vs)D {t^s}) —/G(TO('?r, Vg)) = 1, which happens for half of all 8! enumerations n. Vertex vi has rating (pfa{vi) = | , because fG{'m{Tr,vi) U {vi}) — /GC^^C""",fi)) = 0 if and only if 7r(f2) < 7r(vi) and 7r(i;3) < 7r(wi). Otherwise, we have /G(m(7r, fi) U {vi}) — fGi'm{n,vi)) = 1. Here the second case happens for two third of all 8! enumerations TT. Let G = {VG,EG) and G' = {VG',EG') be two directed graphs. We call G and G' isomorphic if there is a one to one mapping 6 : Vcj —» VG' such that for every pair of vertices z^i, 112 € VG, {vi,v2)e
EG <S=> {b{vi),b{v2))
eEG'.
Such a mapping b is called an isomorphism between G and G'. If G and G' are isomorphic then / G ( ^ ' ) = fG'{b{V')) for every vertex set V C VG- Here
A Connectivity Rating for Vertices in Networks
287
Fig. 1. The vertex rating (j>f^ for a directed graph G with 8 vertices. The smaller the rating of a vertex the greater its importance to the connectivity of the graph. h{y') = {h{u) I u G V'} is the image of V under b. This implies 4'fai''^) = 4'ja' (^(^)) f^'^ ^"^ vertices v € V. Let V C VQ be any set of vertices of G. Graph G is called V-symmetric if for every pair of vertices vi,V'2 S V there is an isomorphism 6 of G to G itself such that b{yi) = V2- In ^'-symmetric graphs all vertices v E V have the same rating. If two vertices Vi, V2 have the same neighborhood, i.e., if {u \ {u,vi) G EQ} = {u | {u,V2) € EG} and {u I {vi,u) G EG} = {u I (i>2, u) G EG}, then G obviously is {wi, wgj-symmetric. Figure 2 shows some examples of partially symmetric graphs.
Fig. 2. The graph to the left is {i)i,'i;3,t;5,ii7}-symmetric and {v2,V4,ve,vs}symmetric, the graph in the middle is {iii,i)2,t'3}-symmetric, and the graph to the right is {iiiji^aji'a, V4, «5, V6}-symmetric. The computation of a vertex rating 0/^ {v) by Equation 1 or Equation 2 is highly inefficient. The number of subsets and the number of enumerations increase exponentially in the number of vertices of G. To handle the computation of (j)f^ for many practically interesting instances we will introduce a method to decompose a large graph into smaller parts. This decomposition will allow us to compute efficiently the ratings of vertices of the original graph by using the ratings of the vertices of smaller subgraphs. Our decomposition method will be introduced by the following two lemmas and Theorem 1. The first lemma shows that the computation of a rating 4>fa{v) for which the arguments of fa are restricted to vertices of a subset V C VG yields the computation of 0/^. ^ (v).
288
M. Abraham et al.
Lemma 1. Let G = {VG,EG) be a graph, V C VQ, and G' = G\v'- Let Ilva be the set of all enumerations n : VG —»• { 1 , . . . , | V G | } . Then for every vertex veV ha' (^) = riTTl E
(fG(.{rn{n, v) U {v}) n V) - /G(m(7r, v) D V')).
Proof. Let Lfv be the set of all enumerations TT' : V —> { 1 , . . . , | y |}. First we show that for every enumeration TT' e Uv there are (|V''| + l ) - ( | y | + 2 ) \VG\ unique enumerations 7r e LIVG ^^ch that for every pair of vertices vi,f2 € V, n'{vi) < TT'{V2) if and only if 7r(ui) < IT{V2). Let p = {vi^,.. .,Vi^^,^) be the sequence of vertices of V in the order defined by TT', that is n'ivi,)
If we consider the vertices of VG — V in an arbitrary order, then the first vertex of VG — V can be placed at | y | + 1 positions at sequence p to get a sequence with \V'\ + 1 vertices. After that the next vertex can be placed at | y | + 2 positions in the resulting sequence to get a sequence with | y | + 2 vertices, and so on. The final vertex of VG — V can be placed at | VQ | positions in the sequence obtained by the preceding placement to get a sequence of all |VG| vertices of G. For all these ( | y I + 1) • (|T^'| + 2) |VG| enumerations TT defined for enumeration TT' we have fG'im{TT',v) U {v}) fG'{m{n',v)) = / G ' ((m(7r, v) U {t;}) n V) - fG' (m(7r, v) n V) for every vertex v £V', and thus -^/o'W = WvX.'en^XfG'{m(.ir',v)VJ{v})-fG'{m{'K',v))) _ _1_Y- \V'\\ ^^enva
= ^
(/»/ ((m(7r,i;)U{-»})nV')-/„, {m{-K,v)nV')) {\V'\+l)-{\V'\+2) \VG\
E^envG ifaiimin,
v) U W ) n ^ ) - fcimi-,,
v) n F'))-
The last equaUty follows from the fact that fG'{V" n V) = fG{V" n V) for every subset V" CVQ• It is easy to see that the rating of a vertex in a graph G depends only on the connectivity structure of the strongly connected component the vertex belongs to, as the following observation shows. If G' = {VG',EG') is a strongly connected component of G = (VG, EG) then for every vertex v G VG' and every vertex set V" C VG, faiiV" U {v}) n VG') - faiV" n VG') - fG{V" U W ) and thus by Lemma 1, (pj^, (f) = ^/(,(v).
fG{V"),
A Connectivity Rating for Vertices in Networks
289
We will now define a property of a vertex pair u, v that allows us to compute independently the rating for two vertices u and v. That is, the rating of M in G will be equal to the rating of u in graph G without v. Definition 1. Let G = (VQ, EQ) he a directed graph and u,v £VG be two nonadjacent vertices, that is, neither {u,v) nor {v,u) is an edge ofG. Vertex u and vertex v are strongly separable in G if for every strongly connected induced subgraph H = {VH,EH) of G which contains u and v there is a strongly connected subgraph J = {Vj,Ej) of H without u and v such that H\VH-VJ has no path from u to V and no path from v to u. For the proof of the next lemma we need the notion of an undirected graph. In an undirected graph G = iVc, EG) the edge set is a subset of {{u, v} \u,v & VG, U ^ v}. Analogously to the definitions for directed graphs, an undirected path of length A;, fc > 1, is a sequence p = (vi,... ,Vk) of fc distinct vertices such that {vi, Vi+i} S EG iov i = 1,... ,k — 1. An undirected path is called an undirected cycle if G additionally has edge {vk,vi} and the path has at least three vertices. The subgraph of G induced by a vertex set V Q VG has edge set EG r\{{u,v} \ U,V G V, U y^ V}. A graph is connected if there is a path between every pair of vertices, a connected component is a maximal connected subgraph, a forest is an undirected graph without cycles, and a tree is a connected forest. L e m m a 2. Let G = {VG,EG) be a directed graph and VH,VJ Q VG be two vertex sets such that VH U Vj = VG and for every edge (^1,112) G EG both vertices are in VH or in Vj, or in both sets. Let H = G\VH, J = G\vj, and I = G|y„nVj • V every pair of vertices u G VH — Vj, v £ Vj — VH is strongly separable in G, then for every vertex set V C VG, foiV)
= fniV
n VH) + fj{V' n Vj) - fj{V' n Vi).
Proof. Let V C VG be any set of vertices of G. Consider the following undirected graph T — (Vr, ET) with vertex set VT == SCC{H\v') U SCC(J|yO such that two vertices of VT are connected by an undirected edge if and only if the two strongly connected components have at least one common vertex. If two distinct strongly connected components of VT are connected by an undirected edge in T then one of them has to be from SCC{H\v') and the other has to be from S C C ( J | K ' ) - Furthermore, for every strongly connected component C of SCC{I\v'), there is exactly one strongly connected component Ci of SCC{H\v') and exactly one strongly connected component C2 of S C C ( J | v ) , and the common vertices of Ci and C2 are exactly the vertices of C. Since every pair of vertices u GVH — Vj, v €Vj — VH ^s strongly separable in G, the undirected graph T has no cycles, that is, T is a forest. The number of connected components of T (the number of trees of forest T) is equivalent to the number of strongly connected components of G. The number of connected
290
M. Abraham et al.
components in a forest is always equivalent to its number of vertices minus its the number of edges. Since T has exactly one edge for every strongly connected component of S C C ( / | v ) and exactly one vertex for every strongly connected component of SCC(iJ|y') and S C C ( J | y ) , we get /G(V')
= fniV n VH) + fj{v' n Vj) - fiiV n Vj). a
The following theorem states how ratings of vertices of G can be computed by the ratings of the same vertices in certain subgraphs of G. Theorem 1. Let G = (VCEG) be a directed graph and VH,VJ Q VQ be two vertex sets such that VH U Vj = VQ and for every edge (vi,'y2) € EQ both vertices Vi,V2 are in VH or in Vj, or in both sets. Let H — G\VH, J = G\vj, and I = GlvnnVj • If every pair of vertices u GVH — VJ, V € VJ — VH is strongly separable in G, then 1. for every vertex w GVH (^ Vj, 4>f^ {w) = (f)f^ (w) + (pfj {w) — 4>fi (w), 2. for every vertex w &VH — Vj, 4>fG (^) — 4'fH (^)» ^''^'^ 3. for every vertex w GVJ — VH, (/>/G(W) = (f)fj{w). Proof. Let w be any vertex of VQ- By Lemma 2, for every vertex set V fciV
U {w}) - faiV)
=
ifHiiV
CVG,
U M ) n VH) - fniV' n VH))
+ {fj{{v'yj{w])nvj) -{fi{{V'yj{w))nVi)
-fj{V'nVj)) -fj{v'nVi)).
If w e VH n Vj, then by Lemma 1 we get 4>ia (w) = */« i.w) + (i)fj {w) - 4)f,
If w is a vertex of VH-VJ, V r\Vi, and thus fciV
{w).
then (V' U {w}) nVj = V'nVj and {V U{w})nVi
U {w}) - faiV)
=
=
fH{{V'U{w})nVH)-fH{V'nVH),
which implies by Lemma 1
A Connectivity Rating for Vertices in Networks
291
Fig. 3. Four graphs G = (VG,-EG), H = G\v„, J = G\vj, and I = G\v„nVj such that VH,VJ C VG, VH U VJ = VQ, and for every edge (vi, V2) £ EG both vertices are in VH or in Va, or in both sets. Vertex pair vi & VH — Vj, ve G Vj — VH is strongly separable in G. polynomial time algorithms which decides whether two vertices in a directed graph are not strongly separable, unless P = NP. The NP-hardness follows by a simple reduction from the satisfiability problem. The terms we use in describing this problem are the following. Let X = {xi,..., x„} be a set of Boolean variables. A truth assignment for X is a function t : X —^ {true, false}. If t{xi) = true we say variable Xj is true under t; if t{xi) = false we say variable Xi is false under t. If Xi IS Si variable of X, then x, and xj are literals over X. Literal Xi is true under t if and only if variable Xj is true under t; literal xj is true under t if and only if variable Xi is false under t. A clause over X is a set of literals over X, for example {xi,xj, X4}. It represents the disjunction of literals which is satisfiedhy a truth assignment t if and only if at least one of its literals is true under t. A collection C of clauses over X is satisfiable if and only if there is a truth assignment t that simultaneously satisfies all clauses of C. The satisfiability problem, denoted by SAT, is specified as follows. Given a set X of variables and a collection C of clauses over X. Is there a satisfying truth assignment for C? This problem is NP-complete even for the case that every clause of C has exactly three distinct literals (3-SAT, for short). T h e o r e m 2. The problem to decide whether two vertices u,v of a directed graph G are not strongly separable is NP-complete. Proof. Let us first illustrate that the problem belongs to NP. Two vertices u and V are not strongly separable in G if and only if G has a strongly connected induced subgraph G' = (VG',EG') that includes u and v such that G"|VQ,_{„_„} has no strongly connected subgraph G" = (VG",EG") such that in G'\v^,-Va>i there is no path from u to v and no path from v to u. Without loss of generality we can assume that G" is a strongly connected component of G' | y^, _ |„_^,}. So we can non-deterministically consider every strongly connected subgraph G' of G that includes u and v. Then we can verify in polynomial time for every strongly connected component G" — {VG",EG") of G'\v^,-^u,v} whether G'\v^,-Va'' has no path from u to v and no path from v to u. Thus, the problem to decide whether two vertices u, v are not strongly separable belongs to NP.
292
M. Abraham et al.
The NP-hardness follows by a simple transformation from 3-SAT. Let X = { x i , . . . , Xn} be a set of n Boolean variables and C = { C i , . . . , Cm} be a collection of m clauses. We define a graph G{X, C) with two vertices u, v such that there is a truth assignment t for X that satisfies every clause of C if and only if u and v are not strongly separable in G{X,C). Figure 4 shows an example of such a construction for four variables a;i,a;2,X3,X4 and four clauses { X 2 , X 3 , X i } , {xi,X^,X4},
{xl,X^,X^},
{xT,X2,Xs}.
Graph G{X,C) has six vertices u,a,b,v,c,d, two literal vertices Xj, x7 for every variable Xi, 1 < i < n, and three literal vertices Cj^i, Cj,2, Cj,3 for every clause Cj = {cj,i,Cj,2,Cj,3}, I < j < rn. G{X,C) has the edges {u,a), (a,xi), (a,xl), the edges (xi,Xi+i), ( x i , x ^ ) , (x7,Xi+i), ( x 7 , x ^ ) for i = 1 , . . . , n 1, the edges (x„,6), (x^^, &), {b,v), {v,c), (c,ci,i), (c,ci,2), (c,ci,3), the edges {cj^k,Cj+i,i) for j = l , . . . , m — 1 and k,l G {1,2,3}, and the edges {cm,i,d), {cm,2,d), {cm,3,d), {d,u), and {d,a). Additionally, there are a so-called cross edges from every literal vertex Xj (x7) for variable Xi to every literal vertex xj (xj, respectively) for some clauses. In Figure 4, the cross edges are drawn as dotted arcs.
literal vertices for variables
literal vertices for clauses
Fig. 4. The graph G{X,C) for X = a;i,a;2,a;3,a:4 and C = {a;2,a;3,a;4}, {xi,0:2,2:4},
Every cycle of G{X, C) that includes vertex u and v consists of two vertex disjoint path pi = {u,a,..., b, v) and p2 = {v,c,..., d, u). Path pi passes exactly one literal vertex for every variable, and defines in this way an assignment t for the variables, where path p2 passes exactly one literal vertex for every clause. Assume there is a truth assignment t for X that satisfies every clause. Then there is an induced subgraph G' of G{X, C) that includes vertex u and v but no cross edge, for example the subgraph of G{X, C) induced by u, v, a, b, c, d and all true literal vertices. In this case, it is not possible to destroy all paths between u and V and all paths between v and u by removing a strongly connected subgraph of G'. Thus u and v are not strongly separable. Assume there is no truth assignment for X that satisfies every clause. Then every strongly connected induced subgraph G' of G that includes u and v has
A Connectivity Rating for Vertices in Networks
293
at least one cross edge («', v'). In this case it is easy to destroy all paths from u to V and all path from v to M by removing a cycle that includes the edge (d, a) and the cross edge {u',v'). Thus u and v are strongly separable. D Theorem 2 can be used to prove that deciding whether two vertices have a different rating is NP-hard. Consider again the graph G{X, C) with the two vertices u and v constructed for an instance {X, C) of 3-SAT as in the proof of Theorem 2. Let G'{X,C) be the graph G{X,C) without the vertex v and its incident edges. Then 4'fo(x,c) (") ~ ^fa'tx o (^) ^^ ^ ^^^ ^ ^^^ strongly separable in G, and (l>fg,x c) (•") < 'PSG'IX O (") '^^ " ^'^'^ ^ ^^^ '^°^ strongly separable in G. Theorem 3. The problem to decide whether (pf^ (u) < (pf^ {v) for two vertices u,v of a directed graph G is NP-hard. Thus, an algorithm for the computation of 4>f^ can be used to decide an NP-hard as well as a co-NP-hard decision problem.
4 A vertex rating for undirected graphs The vertex rating (j)f^ for directed graphs can simply be extended to undirected graphs. For an undirected graph G let dir(G) be the directed graph we get if we replace every undirected edge {u,v} by two directed edges {u,v) and {v,u). Let fa now be the function from the subsets of VQ to the real numbers R such that for every V CVG, / G ( ^ ' ) is the number of connected components in the subgraph of G induced by the vertices of V. That is, the rating of a vertex v in an undirected graph G is equal to the rating of v in the directed graph dir(G). Figure 5 shows an example of the vertex rating cpf^ for an undirected graph G with vertex set VQ = {VI,V2,V3,V4,V5,VQ,V7,V8}.
Fig. 5. The vertex rating (j)f^ for an undirected graph G with 8 vertices. It is easy to verify that two vertices u, v of dir(G) are not strongly separable if and only if G has a chordless cycle that includes u and v. A chord for a cycle c = ( u i , . . . ,Uk) is an edge {ui,Uj} such that 2 < |i — j | < k — 2. The problem of determining whether an undirected graph G contains a chordless cycle can be solved in linear time [3, 15, 17]. This is the well-known chordal
294
M. Abraham et al.
graph recognition problem. A graph G is a chordal graph if any cycle of G of length at least four has at least one chord, or alternatively, if G has no chordless cycle, see [8]. The problem of determining whether G contains a chordless cycle of length fc > 5 can be solved in 0 ( | V G | + |-EG|^) time on 0 ( | V G | • \EG\) space, see [11]. Theorem 1 applied to undirected graphs yields the following theorem which is a more general version of Proposition 2 of [7]. Theorem 4. Let G — (VcEa) be an undirected graph and VH,VJ C VG he two vertex sets such that V/f U Vj = VG and for every edge {vi,U2} G EG both vertices ui,U2 are in VH or in Vj, or in both sets. Let H = G\VH, J = G\vj, and I = G\vHnVj- If G has no chordless cycle with a vertex ofVn — Vj and a vertex of Vj — VH, then 1. for every vertex w £ VH r\Vj, 0/^ (w) = (pf„ (w) + (j)fj (w) — (j)fj (w), 2. for every vertex w GVH — Vj,
An example of a class of graphs for which the rating (j>f^ is efficiently computable is the class of cycle composed graphs which can recursively be defined as follows. The cycle C„ with n > 3 vertices is cycle composed. Let G = (VG, EG) be a cycle composed graph and ei = {ui, ui} be an edge of G. Let C„ = {Vc„,Ecn) be a cycle with n> 3 vertices and 62 = {w2, ^"2} be edge of Cn- Then the graph obtained by the vertex disjoint union of G and C„ and the identification of U2 with Ml and V2 with vi is cycle composed. That is, the composed graph has vertex set VcjUVcn -{u2,V2} and edge set {{h{u),h{v)} \ {u,v} € EQUEC^}) where h{u) — u for every M G VG U Vc„ — {^2,^2}, and h{u2) = MI and h{v2) = vi. Cycle composed graphs are biconnected and have tree-width at most 2, see [13, 1] for a definition of tree-width. Graphs of tree-width at most 2 can be recognized in linear time by removing vertices of degree at most 2. When a vertex u of degree 2 is removed then the two neighbors of u will be connected by an edge if they are not adjacent. A graph has tree-width 2 if and only if it can completely be reduced by removing vertices of degree at most 2 in the way described above, see for example [19]. Let C be the set of vertex sets of the cycles used to compose a cycle composed graph G, that is, C has a vertex set C for every cycle used to compose G. The
A Connectivity Rating for Vertices in Networks
295
vertex rating 0(w) for all vertices w of G is computable in linear time by the following simple procedure. 1. for every u E V do { 2. let<^/^(u):=(deg(u)-2)*(-i);} 3. for every C £ C do { 4. for every u £ C do { 5. let (l)f^(u) := (pfa(M) + 1^; } } Since a vertex u is involved in degr(u) — 2 vertex identifications, the rating for u can be initialized by (deg('u) — 2) * (—|). After that the algorithm adds for every cycle C the fraction j ^ to the ration of every vertex of C. Since the number of vertices in the sets of C is ^cec 1^1 ~ 2|£^G| — \^G\, the rating for all vertices in cycle composed graphs can be computed in linear time, if C is given. The vertex sets of the cycles can be computed by the following algorithm. We assume that an empty vertex list is initially assigned to every edge. That is, every edge {u,v} is initially represented as a pair ({u,u},0). An edge e = {{u,v},L) with a non-empty vertex list L represents a path between u and v passing the vertices of L. If G has a vertex u of degree 2 such that the two neighbors v,w of M are not adjacent, we remove vertex u and its two incident edges {{u,v},Li), {{u,w},L2) and insert a new edge {{v,w},Li U L2 U {u}) between u and v. If G has a vertex u of degree 2 such that the two neighbors VjW of u are adjacent, the vertices of a cycle can be reported. Let {{u,v},Li), {{u,w},L2)-, {{v, w}, L3) be the three edges between the vertices u, v and w. The algorithm then reports vertex set Li U L2 U L3 U {u,v,w}. If graph G has no further edges than the three edges above, then all cycles are reported and the algorithm finishes. If graph G has some further edges and L3 is non-empty, then the graph is not cycle composed. In any other case the algorithm removes the two edges {{u,v},Li), {{u,w},L2) and so forth. If this processing ends because there are no further vertices of degree 2, then the graph is also not cycle composed. This algorithm computes the vertex sets of all cycles used to compose a cycle composed graph. The running time of this algorithm is 0 ( | V G P ) because we have to check for every vertex whether its two neighbors are adjacent. However, this problem can be eliminated by a simple trick which is also used in [19] for the recognition of outerplanar graphs. The trick is to check whether the two neighbors v, w of u are adjacent at the time when one of these two vertices V, w gets a degree of 2 or less. At that point the test can be done in a fixed number of steps and either a new edge is inserted or a cycle is reported. This modification yields a linear time algorithm for the computation of all cycles of a cycle composed graph. The following example shows a possible implementation.
296
M. Abraham et al.
create-new-edge (vertex u) { let ei = {{u,v},Li),e2 = {{u,w},L2) € EG be the two edges incident to u; insert {{v, w}, Li U -L2 U {u}) into Enew', remove ei and 62 from EG; if (deg^^ (u) = 2) then insert i; into M; if (deg£;^(w) = 2) then insert w into M; } raove-new-edge (edge enew = {{u,v},Lnew)) { if there is an edge e = {{u, v}, L) G EG then { o u t p u t L U Lnew U {u, v]]
remove Cnew from Enewl if ( | £ G | = 1) and (l^newl = 0) then halt " all cycles reported"; else if (L ^ 0) then halt " G is not cycle composed"; else { remove enew from -Enew; insert Cnew into EG] if (deg^;^ (u) = 3) then remove u from M; if {deg^^iy) = 3) then remove v from M; }
} compute-cycles (graph G = {VG,EG)) { let M := 0; for every u GVQ do { a (degE^iu) = 2) then { insert u into M; } } while (M 5^ 0) { let u€ M; if there is an edge enew S -Enew incident to u then move-new-edge (e else { if (deg£;^(u) = 2 ) then create-new-edge (u); remove u from M; } } halt " G is not cycle composed"; }
A Connectivity Rating for Vertices in Networks
297
The algorithm above stores in a set M all vertices of degree 2. Note that the degree of a vertex is always determined by the edges of EQ • For every vertex u adjacent with exactly two vertices v,w a. new edge is inserted into a set denoted by -Bnew but not yet into edge set EG of graph G. Whenever a vertex w of M is considered for processing it is first checked whether there are edges incident to u in set -Bnew If -E'new has an edge e incident to u then e will either be inserted into EG (if the two vertices of e are not adjacent by some edge of EG), or a cycle is reported (if the two vertices of e are adjacent by some edge of EQ)- The test whether the two vertices of e are adjacent by some edge of EG can be done in time 0(1) because u is one of the end vertices of e and has vertex degree 2. This proves the following theorem. Theorem 5. The vertex rating 4>f^{u) for all vertices u of a cycle composed graph G is computable in linear tim,e. The vertex rating (l>f^ is also computable in linear time for chordal graphs. An interesting characterization of chordal graphs is the existence of a perfect elimination order. Let p = ( u i , . . . , u„) be an order of the \VG\ = n vertices of G = {VG,EG), and let N{G,p,i) for i = 1 , . . . ,n be the set of neighbors Uj of vertex Ui with i < j , N{G,p,i)
:= {uj I {ui,Uj} € EG A i < j}.
The vertex order p — (ui,..., w„) is called a perfect elimination order (PEO) if the vertices of N{G,p, z) for i = 1 , . . . , n — 1 induce a complete subgraph of G. Dirac [3], Fulkerson and Gross [5], and Rose [14] have shown that a graph G is chordal if and only if it has a perfect elimination order. Rose, Tarjan, and Lueker have shown in [15], that a perfect elimination order can be found in linear time if one exists. If a perfect elimination order p = {vi,..., Vn) of the vertices of G = (VQ, EQ) is given, then the vertex rating (j)f^ can be computed with Theorem 4 by the following algorithm. Note that, in a complete graph G with n vertices, I/I/Q (V) = - for every vertex of G, because G is Vc-symmetric. 1. let (pfoivn) ••= 1;
2. for i = n — 1 , . . . , 1 do { 3.
l e t (Pfa{Vi)
4.
for a l i v e A/'(G,p,j) do {
: = |;v(G,p,i)|+i'
5.
let (t>Sc{v) ••= 'Pfaiv)
+ \N{G,l,i)\ + l -
\NiG,p,i)V
>>
The running time of this algorithm is linear in the size of G, because the assignment of Line 3 is done exactly | VG | — 1 times and the assignment of line 5 is done exactly |£^G| times. Since the perfect elimination order can be found in linear time, we get the following theorem. Theorem 6. The vertex rating 4>fah^) f°''~ ^^^ vertices v of a chordal graph G is computable in linear time.
298
M. Abraham et al.
References 1. H.L. Bodlaender. A partial fe-arboretum of graphs with bounded treewidth. Theoretical Computer Science, 209:1-45, 1998. 2. X. Deng and C.H. Papadimitriou. On the complexity of cooperative solution concepts. Methods of Operations Research, 19(2):257-266, 1994. 3. G. Dirac. On rigid circuit graphs. Ahh. Math. Sem. Univ. Hamburg, 25:71-76, 1961. 4. D.J. Felleman and D.C. Van Essen. Distributed hierarchical processing in the primate cerebral cortex. Cerebral Cortex, 1:1-47, 1991. 5. D.R. Fulkerson and O.A. Gross. Incidence matrices and interval graphs. Pacific J. Math., 15:835-855, 1965. 6. M.R. Garey and D.S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman and Company, San Francisco, 1979. 7. D. Gomez, E. Gonzalez-Arangiiena, C. Manuel, G. Owen, M. del Pozo, and J. Tejada. Splitting graphs when calculating Myerson value for pure overhead games. Mathematical Methods of Operations Research, 59:479-489, 2004. 8. A. Hajnal and J. Suranyi. Uber die Auflosung von Graphen in vollstandige Teilgraphen. Ann. Univ. Sci. Budapest, Eotvos Sect. Math., 1:113-121, 1958. 9. R. Kotter and E. Wanke. Mapping brains without coordinates. Philosophical Transactions of the Royal Society London, Biological Sciences, 360(1456) :751766, 2000. 10. R.B. Myerson. Graphs an cooperations in games. Methods of Operations Research, 2:255-229, 1977. 11. S.D: Nikolopoulos and L. Palios. Hole and antihole detection in graphs. In Proceedings of the ACM-SIAM Symposium on Discrete Algorithms, pages 850-859. ACM-SIAM, 2004. 12. G. Owen. Values of graph-restricted games. SIAM Journal on Algebraic and Discrete Methods, 7(2):210-220, 1986. 13. N. Robertson and P.D. Seymour. Graph minors II. Algorithmic aspects of tree width. Journal of Algorithms, 7:309-322, 1986. 14. D.J. Rose. Triangulated graphs and elimination process. J. Math. Analys. AppL, 32:597-609, 1970. 15. D.J. Rose, R.E. Tarjan, and G.S. Lueker. Algorithmic aspects of vertex elimination on graphs. SIAM Journal on Computing, 5:266-283, 1976. 16. L.S. Shapley. A value for n-person games. In H.W. Kuhn and A.W. Tucker, editors. Contributions to the Theory of Games II, pages 307-317, Princeton, 1953. Princeton University Press. 17. R.E. Tarjan and M. Yannakakis. Simple linear-time algorithms to test chordality of graphs, acyclicity of hypergraphs, and selectively reduce acyclic hypergraphs. SIAM Journal on Computing, 13:566-579, 1984. 18. R. van den Brink and P. Borm. Digraph competitions and cooperative games. Theory and Decision, 53:327-342, 2002. 19. M. Wiegers. Recognizing outerplanar graphs in linear time. In Proceedings of Graph-Theoretical Concepts in Computer Science, volume 246 of LNCS, pages 165-176. Springer-Verlag, 1987. 20. K. Zilles. Architecture of the Human Cerebral Cortex. Regional and Laminar Oganization. In G. Paxinos and J.K. Mai, editors, The Human Nervous System, pages 997-1055, San Diego, CA, 2004. Elsevier. 2nd edition.
On PTAS for Planar Graph Problems Xiuzhen Huang ^ a n d Jianer Chen'^ ^ Department of Computer Science, Arkansas State University, State University, Arkansas 72467. Email: [email protected] ^ Department of Computer Science, Texas A&M University, College Station, TX 77843. Email: [email protected]** A b s t r a c t . Approximation algorithms for a class of planar graph problems, including PLANAR INDEPENDENT SET, PLANAR VERTEX COVER and
PLANAR DOMINATING SET, were intensively studied. The current upper bound on the running time of the polynomial time approximation schemes (PTAS) for these planar graph problems is of 2°'-''/^'n°^^\ Here we study the lower bound on the running time of the PTAS for these planar graph problems. We prove that there is no PTAS of time 20(\/1A)„0(1) £QJ. PLANAR INDEPENDENT SET, PLANAR VERTEX COVER and PLANAR DOMINATING SET unless an unlikely collapse occurs in parameterized complexity theory. For the gap between our lower bound and the current known upper bound, we specifically show that to further improve the upper bound on the running time of the PTAS for PLANAR VERTEX COVER, we can concentrate on PLANAR VERTEX COVER on pla-
nar graphs of degree bounded by three.
1 Introduction There is intensive research work on a class of planar graph N P - h a r d optimization problems, such as PLANAR I N D E P E N D E N T S E T , P L A N A R V E R T E X C O V E R a n d
PLANAR DOMINATING SET. Approximation algorithms for these planar graph problems and related problems were studied by researchers such as Bar-Yehuda and Even [5], Lipton a n d Tarjan [25], Baker [4], Eppstein [16], Grohe [20], K h a n n a and Motiwani [24], and Cai et al. [7]. T h e current upper bound on t h e running time of t h e polynomial time approximation scheme (PTAS) for these planar graph problems is of 2°(^/^)n'-'^^' [4, 25]. In this paper, we study the lower bound on t h e running time of t h e P T A S algorithms for these planar graph problems. O u r work follows some recent research progress in parameterized complexity theory [10, 11], where strong computational lower bound results on the running time of the algorithms for W[^]-hard problems are derived, t > 1. This research is supported in part by US NSF under Grants CCR-0311590 and CCF-0430683. Please use the following format when citing this chapter: Huang, X., Chen, J., 2006, in International Federation for Information Processing, Volume 209, Fourth IFIP International Conference on Theoretical Computer Science-TCS 2006, eds. Navarro, G., Bertossi, L., Kohayakwa, Y., (Boston: Springer), pp. 299-313.
300
X. Huang and J. Chen
Our research work here is focused on the computational lower bounds on the running time of the algorithms for the parameterized problems that are fixedparameter tractable (in FPT). We first give a brief review on parameterized complexity theory and the recent research results in [10, 11]. A parameterized problem Q is a decision problem consisting of instances of the form {x,k), where the integer fc > 0 is called the parameter. The parameterized problem Q is fixed-parameter tractable [15] if it can be solved in time f{k)\x\'^^^\ where / is a recursive function^. Certain NP-hard parameterized problems, such as VERTEX COVER, are fixedparameter tractable, and hence can be solved practically for small parameter values [12]. On the other hand, the inherent computational difficulty for solving many other NP-hard parameterized problems with even small parameter values has suggested that certain parameterized problems are not fixed-parameter tractable, which has motivated the theory oi fixed-parameter intractability [15]. The ly-hierarchy lJj>o W[t] has been introduced to characterize the inherent level of intractability for parameterized problems. A large number of parameterized problems have been proved to be hard or complete for various levels in the VF-hierarchy [15]. Examples of iy[l]-hard problems include many wellknown NP-hard problems such as CLIQUE, DOMINATING SET, SET COVER, and WEIGHTED CNF SATISFIABILITY. The theory of parameterized intractability has found important applications in a variety of areas such as database systems and model checking [20, 27]. The M^[l]-hardness of a parameterized problem provides a strong evidence that the problem is not fixed-parameter tractable, or equivalently, cannot be solved in time f{k)n'-"'^^ for any function / . Recent investigation has derived much stronger computational lower bounds on the running time of the algorithms for well-known NP-hard parameterized problems [10, 11]. For example, it has been shown that unless an unlikely collapse occurs in the parameterized complexity theory, any algorithm solving the iy[l]-hard CLIQUE problem takes time at least n^^''\ Note that this lower bound is asymptotically tight in the sense that the trivial algorithm that enumerates all subsets of k vertices in a given graph to test the existence of a chque of size k runs in time 0{n''). Similar lower bound results could be shown for other VF[i]-hard problems, t > 1. A method for deriving lower bounds on the running time of approximation algorithms for NP-hard combinatorial optimization problems is designed. It was proved in [11] that unless an unlikely collapse occurs in parameterized complexity theory, the VF[l]-hardness of the parameterized problem under the linear fpt-reduction implies the nonexistence of polynomial time approximation schemes of running time f{\/e)n°^^/'^^ for the original optimization problem, where / is any recursive function. ^ In this paper, we always assume that complexity functions are "nice" with both domain and range being non-negative integers and the values of the functions and their inverses can be easily computed. For two functions / and g, we write /(n) = o{g{n)) if there is a nondecreasing and unbounded function A such that /(n) < g{n)/\{n). A function / is subexponential if /(n) = 2°^"^
On PTAS for Planar Graph Problems
301
2 Terminologies in Approximation For a reference of the theory of approximation, the readers are referred to the book [3]. In this section, we provide some basic terminologies for studying approximability and its relationship with parameterized complexity. An NP optimization problem Q is a four-tuple {IQ,SQ, fQ,optQ), where 1. JQ is the set of input instances. It is recognizable in polynomial time; 2. For each instance x G IQ, SQ{X) is the set of feasible solutions for x, which is defined by a polynomial p and a polynomial time computable predicate n {p and TT only depend on Q) as SQ{X) = {y : \y\ < p{\x\) and iT{x,y)}; 3. fQ{x,y) is the objective function mapping a pair x G IQ and y £ SQ{X) to a non-negative integer. The function fg is computable in polynomial time; 4. optq € {max, min}. Q is called a maximization problem if optg = max, and a minimization problem if optg = min. An optimal solution yo for an instance x £ / Q is a feasible solution in SQ{X) such that fQ{x,yo) = optQ{fQ{x,z) | z £ SQ{X)}. We will denote by optQ{x) the value optQ{fQ{x,z) \ z € SQ{X)}. An algorithm A is an approximation algorithm for an NP optimization problem Q = {IQ, SQ,fQ,optQ) if, for each input instance x in IQ, A returns a feasible solution yA{x) in SQ{X). The solution yA{x) has an approximation ratio r{n) if it satisfies the following condition: optQ{x)/fQ{x,yA{x)) fQ{x,yA{x))/optQ{x)
< r{\x\) if Q is a maximization problem < r{\x\) if Q is a minimization problem
The approximation algorithm A has an approximation ratio r{n) if for any instance x in IQ, the solution yA{x) constructed by the algorithm A has an approximation ratio bounded by r(|a:|). Definition 1. An NP optimization problem Q has a polynomial-time approximation scheme (PTAS) if there is an algorithm AQ that takes a pair {x,e) as input, where x is an instance of Q and e > 0 is a real number, and returns a feasible solution y for x such that the approximation ratio of the solution y is bounded by 1 -\- e, and for each fixed e > 0, the running time of the algorithm AQ is bounded by a polynomial of \x\.* An NP optimization problem Q has a fully polynomial-time approximation scheme (FPTAS) if it has a PTAS AQ such that the running time of AQ is bounded by a polynomial of \x\ and 1/e. "* There is an alternative definition for PTAS in which each e > 0 may correspond to a different approximation algorithm Ae for Q [19]. The definition we adopt here may be called the uniform PTAS, by which a single approximation algorithm takes care of all values of e. Note that most PTAS developed in the literature are uniform PTAS.
302
X. Huang and J. Chen
Observe that the time complexity of a PTAS algorithm may be of the form 0(2^/^|a:|'^) for a fixed constant c or of the form 0(1x1^/"^). Obviously, the latter type of computations with small e values will turn out to be practically infeasible. This leads to the following definition [9]. Definition 2. An NP optimization problem Q has an efficient polynomial-time approximation scheme (EPTAS) if it admits a polynomial-time approximation scheme whose time complexity is bounded by 0(/(l/e)|a;|'^), where f is a recursive function and c is a constant. An NP optimization problem Q can be parameterized in a natural way as follows. Definition 3. Let Q = {lQ,SQ,fQ,optQ) be an NP optimization problem. The parameterized version of Q is defined as follows: (1) If Q is a maximization problem, then the parameterized version of Q is defined as Q> = {{x, k) | a; € / Q A optQ{x) > k]; (2) If Q is a minimization problem, then the parameterized version of Q is defined as Q< = {{x,k) | x € IQ A optQ{x) < k). The above definition offers the possibility to study the relationship between the approximability and the parameterized complexity of NP optimization problems. However, there is an essential difference between the two categories: an approximation algorithm for an NP optimization problem constructs a solution for a given instance of the problem, while a parameterized algorithm only provides a "yes/no" decision on an input. To make the comparison meaningful, we need to extend the definition of parameterized algorithms in a natural way so that when a parameterized algorithm returns a "yes" decision, it also provides an "evidence" to support the conclusion (see [6] for a similar treatment). Definition 4. Let Q = {IQ,SQ, fQ,optQ) be an NP optimization problem. We say that a parameterized algorithm AQ solves the parameterized version of Q if (1) in case Q is a maximization problem, then on an input pair {x, k) in Q>, the algorithm AQ returns "yes" with a solution y in SQ{X) such that fQi^^y) ^ k> o,nd on any input not in Q>, the algorithm AQ simply returns "no"; (2) in case Q is a minimization problem, then on an input pair {x, k) in Q<, the algorithm AQ returns "yes" with a solution y in SQ{X) such that fQ{x,y) < k, and on any input not in Q<, the algorithm AQ simply returns "no".
3 Lower Bound on Running Time of P T A S for P l a n a r G r a p h Problems Suppose e > 0 is the given error bound, and n is the number of vertices of a planar graph. Lipton and Tarjan [25] designed an EPTAS approximation
On PTAS for Planar Graph Problems
303
algorithm of time 0(2°(^/'')n°(^)) for PLANAR INDEPENDENT SET, as an application of a separator theorem on planar graphs. Based on the outer-planarity of planar graphs, Baker [4] designed EPTAS algorithms of time 0{2'-'^^/'^^n) for several famous NP-hard optimization problems on planar graphs, such as PLANAR VERTEX COVER, PLANAR INDEPENDENT SET, and PLANAR DOMINATING SET. In [6], Cai and Chen proved that if an optimization problem has a fully polynomial-time approximation scheme (FPTAS), then the corresponding parameterized problem is fixed-parameter tractable (in FPT). Later this result was extended in [9] by Cesati and Trevisan: All optimization problems that have efficient polynomial time approximation schemes (EPTAS) have their parameterized problems in FPT. Therefore, the parameterized versions of these aforementioned optimization problems, PLANAR VERTEX COVER, PLANAR INDEPENDENT SET, and PLANAR DOMINATING SET, are in FPT. Alber et. al [2] designed parameterized algorithms of time 2'^^^''^n'^^^^ for the parameterized versions of the above NP-hard optimization problems. A lot of research has been done on these problems to try to further improve the time complexity of the parameterized algorithms. Interested readers are referred to [1, 23, 17, 18]. Cai et. al [8] proved the following lower bound result for the parameterized algorithms of these problems: Lemma 1. (Lemma 5.1 in [8]) PLANAR VERTEX COVER, PLANAR INDEPENDENT SET, and PLANAR DOMINATING SET do not have parameterized algorithms oftime2°^^^n'^^'^\ unless VERTEX COVER-3 has 2"'^''^n'-"^'^^-time parameterized algorithms. The class SNP introduced by Papadimitriou and Yannakakis [26] contains many well-known NP-hard problems including, for any fixed q > 3, CNF q-SAT, q-COLORABILITY, q-SET COVER, and VERTEX COVER, CLIQUE, and INDEPENDENT SET [22]. It is commonly believed that it is unlikely that all problems in SNP are solvable in subexponential time. Impagliazzo, Paturi and Zane [22] studied the class SNP and identified a group of SNP-complete problems under the serf-reduction, such that if any of these SNP-complete problems is solvable in subexponential time, then all problems in SNP are solvable in subexponential time. This group of SNP-complete problems under the serf-reduction includes t h e p r o b l e m s CNF q-SAT, q-COLORABILITY, q-SET COVER, a n d VERTEX COVER, CLIQUE, a n d INDEPENDENT SET.
We have: Lemma 2. (Theorem 3.3 in [13]) The VERTEX COVER-3 problem can he solved in 2°('^)n'^'^^^ time if and only if the VERTEX COVER problem can be solved in 2o(fc)^o(i) ^-^g^
Therefore Lemma 1 could be restate as:
304
X. Huang and J. Chen
L e m m a 3 . PLANAR VERTEX COVER, PLANAR INDEPENDENT SET, anrf PLANAR
DOMINATING SET do not have parameterized algorithms of time 2°^^'°)n'-'^^^, unless all SNP problems are solvable in subexponential time. We prove the following lower bound results on the running time of the EPTAS algorithms for those planar graph problems: T h e o r e m 1. PLANAR VERTEX COVER, PLANAR INDEPENDENT SET, and PLA-
NAR DOMINATING SET have no EPTAS of running time 2°(VVe)n'-'(^), where e > 0 is the given error bound, unless all SNP problems are solvable in subexponential time. Proof We provide the proof for
PLANAR VERTEX COVER.
Let Q be the mini-
mization problem of PLANAR VERTEX COVER.
Prom the EPTAS algorithm AQ for the PLANAR VERTEX COVER problem Q, we provide the parameterized algorithm A< shown in Fig. 1 for the parameterized version Q< of the PLANAR VERTEX COVER problem Q. Algorithm A<: Input: An instance (G, k) of Q<, where G is a planar graph. Output: If the minimum vertex cover Go has the size |Go| < k, then Output "yes"; otherwise Output "no". 1. On the instance {G,k) of Q<, call the EPTAS algorithm AQ on G and e = l/(2fc + 1). Suppose that the algorithm AQ returns a vertex cover G. 2. If \C\ < k, then return "yes"; otherwise return "no".
Fig. 1. Algorithm A<. We verify that the algorithm A< solves the parameterized problem Q<. Since the PLANAR VERTEX COVER problem Q is a minimization problem, if \C\ < k then obviously |Co| < k. Thus, the algorithm A< returns a correct decision in this case. On the other hand, suppose \C\ > k. Since \C\ is an integer, we have \C\> k + 1. Since AQ is a EPTAS for the PLANAR VERTEX COVER problem Q and e = l/(2fc -f-1), we must have
|C|/|(7oi
On PTAS for Planar Graph Problems
305
VERTEX COVER problem Q. The running time of the algorithm A< is dominated by that of the algorithm AQ, which is bounded by 2°^Vy'^)n^W = 2°(^)n'^W. Thus, the parameterized version Q< of the PLANAR VERTEX COVER problem is solvable in time 2°^^''^n'-^^^\ Therefore, the result in the theorem follows from Lemma 3. T h e p r o o f s for PLANAR INDEPENDENT SET a n d PLANAR DOMINATING SET
are similar and hence are omitted. C o r o l l a r y 1. PLANAR VERTEX COVER, PLANAR INDEPENDENT SET, and
PLA-
NAR DOMINATING SET have no PTAS of running time 2 ° ( v ^ ) n ° ( ^ ) , where € > 0 is the given error bound, unless all SNP problems are solvable in subexponential time. By a comparison with the upper bound on the running time of the EPTAS algorithms for these planar graph problems in Baker [4], which is 2^^^^'^^nP^^^ (also in Lipton and Tarjan [25]), we can see that there is a gap between the upper bound result and our lower bound result in Theorem 1. To come up with new approaches to improve the upper bound on the running time of the EPTAS algorithms in [4] will be interesting research. To study this issue, we concentrate on the PLANAR VERTEX COVER problem in the next section.
4 U p p e r Bound on Running Time of P T A S for P l a n a r Vertex Cover In this section, we study the PTAS algorithms for the VERTEX COVER problem on planar graphs of degree bounded by 3, abbreviated as P-vc-3. The VERTEX COVER problem on general planar graphs is abbreviated as P-VC. Prom the proof of Theorem 1, we get the following lemma: L e m m a 4. The P-vc-3 problem has no EPTAS of running time 2''(viA)n°(^), where e > 0 is the given error bound, unless the P-vc-3 problem has a parameterized algorithm of time 2°'^^^^n'~"^^\ It is well known that a planar embedding of a planar graph can be constructed in linear time [21]. We define an operation, called the unfolding operation, based on a planar embedding of a planar graph. Definition 5. Suppose that G is a planar graph with a planar embedding i^{G), and that v is a degree-d vertex in G, where d > 3, with neighbors vi, v^, • • •, Vd, such that when one traverses around the vertex v on the embedding 7r(G), the edges incident to v are in the cyclic order [v,vi], [v,V2], •••, [v,Vci]. The unfolding operation on the vertex v will do the following: remove the vertex v from TT{G), and add a path of length 2d — 5: Pv = {yi,xi,y2,X2,
•••
,yd-3,Xd-3,yd-2}
306
X. Huang and J. Chen
where each vertex Xi is of degree 2 and adjacent to the vertices yi and yi+i, and each vertex yi is of degree 3 such that j/i is adjacent to {ui, i;2, Xi}, yd-2 is adjacent to {vd-i,V(i,Xd.-3}, and yi is adjacent to {vi+i,Xi-i,Xi}, for 2 3, where y<3 is the set of vertices whose degree is less than or equal to 3, y>3 is the set of vertices whose degree is greater than 3. We apply the unfolding operation on a vertex v G V>3. We get a new planar graph G2 = (V2, E2), where G2 has one fewer vertex of degree larger than 3, compared with Gi. We first consider a vertex cover C2 of the graph G2. - Suppose for some i, 1 < i < d — i, the three vertices Xj, j/j, and yj+i are all in C2. Then we simply remove Xi from C2. It is obvious that C2 — {xi} is still a vertex cover of G2, with one fewer vertex compared with C2. Call this operation clean-one. - Suppose for some i, 1 < i < d — 3, exactly two of the three vertices Xi, yi, and j/j+i are in C2- If one of these two vertices is Xi, then we can replace the two vertices by j/j and j/j+i, resulting in a new vertex cover of the same size. Call this operation clean-two.
V3
V
Vl
V2
Fig. 2. Unfolding operation on the vertex v (with degree 6). Note that at least one of the three vertices Xi, y^, and yj+i must be in the vertex cover C2 in order to cover the edges [xi,yi] and [xi,yi+i]. Therefore, besides the above cases, the only remaining case is that for the three vertices Xi, yi, and y^+i, only one of them is in C2. In this case, this vertex in C2 must b e Xi.
On PTAS for Planar Graph Problems
307
In the following discussion, cleaning a vertex cover C2 means that we apply the processing of clean-one and clean-two on C2. After the cleaning process, we say that the vertex cover C2 is clean. By the above discussion, in a clean vertex cover C2 of the graph G2, we have Claim. Either all d — 3 vertices Xi, 1 < i < d — 3, are in C2 and none of the d — 2 vertices yj, 1 < j < d — 2, is in C2; or all d — 2 vertices yj, 1 < j < d — 2, are in C2 and none of the d — 3 vertices Xi, 1 < i < d — 3, is in C2. Let Ci be any vertex cover of the graph Gi such that Ci has ki vertices. If V G Ci (so V covers the d edges [^,^1], ..., [v,Vd] in G), then by replacing v in Ci by the d—2 vertices j/i, 2/2, • • •, yd-2 in G2, we obviously get a clean vertex cover C2 for the graph G2. The vertex cover C2 has ki + {d — 3) vertices. On the other hand, if v is not in Ci (so the edges [f, vi], ..., [v, Vd] must be covered by the vertices vi, ..., v^ in Ci), then by adding the d — 3 vertices xi, X2, • • •, Xd-3 to Ci, we get a clean vertex cover C2 for the graph G2 and C2 contains k\ + {d — 3) vertices. In conclusion, from a vertex cover of fei vertices for the graph Gi, we can always construct a (clean) vertex cover of k\ + [d — 3) vertices for the graph G2. Conversely, suppose that we are given a clean vertex cover C2 of the graph G2, where C2 has k2 vertices. If C2 contains the d — 2 vertices j/i, 2/2, • • •, yd-2, then replacing the d — 2 vertices yi, y2, ..., yd-2 in C2 by a single vertex v gives a vertex cover of k2 — {d — 3) vertices for the graph Gi. On the other hand, if C2 contains the d — 3 vertices xi, X2, . •., Xd-3, then removing these d — 3 vertices from C2 gives a vertex cover of k2 — {d — 3) vertices for the graph Gi. In conclusion, from a vertex cover of ^2 vertices for the graph G2, we can always construct a vertex cover of k2 — [d- 3) vertices for the graph Gi. Now suppose that the set of vertices of degree larger than 3 in the graph Gi is y>3 = {ui,U2,.. • ,Ur-}. Denote by deg{u) the degree of the vertex u. Inductively, suppose that the graph Gj+i is obtained from the graph G, by unfolding the vertex Uj, for 1 < i < r. Note that the graph Gr has its degree bounded by 3, and we say that the graph Gr is obtained from the graph Gi by unfolding all vertices of degree larger than 3. Let C\ be a vertex cover for the graph Gi with \Gi\ = ki. By the above discussion, we can construct from Gi a vertex cover G2 of ki + {deg{ui) — 3) vertices for the graph G2; then from G2, we can construct a vertex cover G3 of ki + (deg{ui) — 3) -f {deg(u2) — 3) vertices for the graph G3, , and finally we construct a vertex cover Cr of fci -t- '}2\^i{deg{ui) — 3) vertices for the graph GrOn the other hand, let Cr be a vertex cover of kr vertices for the graph GrFirst we clean Cr to get a clean vertex cover C'r for Gr. Since cleaning does not increase the size of the vertex cover, we have |G^| < \Cr\ = kr. Now by the above discussion, we can get a vertex cover Cr-i of |C^| — {deg{ur) — 3)
308
X. Huang and J. Chen
{deg{ur-i) — 3) vertices for the graph Gr-2, , finally, we will construct a vertex cover of at most kr — ^l^i{deg{ui) — 3) vertices for the graph G\. In particular, the above discussion enables us to derive a relation between the minimum vertex covers for the graphs G\ and Gr- Let h\ and k^ be the sizes of minimum vertex covers of the graph G\ and Gr, respectively. By the above discussion, from a minimum vertex cover for the graph G\, we can construct a vertex cover of k\ + ^[=i(c?e(7(w,) — 3) vertices for the graph Gr- Therefore, fci + X)[=i(^65(^i) ~ 3) > ky. On the other hand, from a minimum vertex cover of the graph G^, we can construct a vertex cover of no more than kr — Si=i('^65(^i) ^ 3) vertices for the graph G\, thus kr — J2l=i(.deg{ui) — 3) > fci. Combining these two relations, we get fci + YA=i{deg{ui) — 3) = krSummarizing the above discussion, we get the following: Claim. Let Gi be a graph in which the set of vertices of degree larger than 3 is V'>3. Let Gr be a graph obtained by unfolding all vertices of degree larger than 3 in Gi. Then from a vertex cover Ci for the graph Gi, we can construct in polynomial time a vertex cover of |Gi| + Yluev id^9i'^) " 3) vertices for the graph Gr', and from a vertex cover Cr for the graph Gr, we can construct in polynomial time a vertex cover of at most \Cr\ — X)uev ideg{u) — 3) vertices for the graph Gi. Moreover, the size of a minimum vertex cover of the graph Gr is equal to the size of a minimum vertex cover of the graph Gi plus Using the unfolding operations, we can prove Lemma 5. The P-vc-3 problem has no parameterized algorithm of time 2°^^^^n'-'^^\ unless the P-VC problem has a parameterized algorithm of time 2°^'^''^n'^^^\ Proof. Suppose the P-VC-3 problem has a parameterized algorithm A of time 20(^^)7^0(1). We have the following algorithm A' shown in Fig 3 for the P-VC problem. We prove the algorithm A' is correct. By Claim 4, OPTi is a vertex cover for the graph Gi with \0PT2\ — J2uev i^^di'^) " 3) vertices and OPTi is computable in time n'-'^^\ Since OPT2 is a minimum vertex cover for the graph G2, by Claim 4 again, a minimum vertex cover for the graph Gi contains IOPT2I — X^^jgy {deg{u) — 3) vertices. In conclusion, OPTi is a minimum vertex cover for the graph Gi. We analysis the running time of A' in the following. For the graph Gi = {Vi,Ei), Vi = V<3 Uy>3, where l^il = n and \Ei\ = m, we can always assume \OPTi\ > n/2 by applying the NT-theorem [12]. That is, the parameter k > n/2. After applying the unfolding operation on each V G V>3, we get the new planar graph G2 = (V2, i?2) with degree bounded by 3. The construction of G2 can be done in polynomial time. For a planar graph with n vertices and m edges, we have [14]: m < 3n — 6.
(1)
On PTAS for Planar Graph Problems
309
Algorithm A' Input: A planar graph Gi = {Vi,Ei), Vi = V<3UV>3, and an integer k > 0. Output: Output "Yes", if the size of the minimum vertex cover OPTi of Gi satisfies jOPTil
Fig. 3. Parameterized algorithm for PLANAR VERTEX COVER.
By Equation 1, for the graph Gi, the total degree of all its vertices satisfies: ^
deg(v) = 2m< 2(3n - 6) < 6n,
(2)
veVi
We have IV2I = \V<s\ + J2 ^(deg{v) - 3) + {deg{v) - 2))
V&V>3
<\Vi\+2Ydeg{v) veVi
n + 12n = 13n = 0(n). Therefore, the calls to the algorithm^ on the graph G2 takes time 2''^v'^^'^|V2|'^'^^ 2oiV^)j^oii) ^ 2°(^)n°(^). All the other steps of the algorithm A' takes polynomial time n'^^^\ Therefore the algorithm A' has running time 2°^^''^n^^^\ Therefore, from Lemma 4, Lemma 5 and Theorem 1, we have Theorem 2. The P-vc-3 problem has no EPTAS of running time 2"^^^"^ n'-"^^\ where e > 0 is the given error bound, unless all SNP problems are solvable in subexponential time.
310
X. Huang and J. Chen
Theorem 2 implies t h e difficulty of improving t h e E P T A S algorithm for t h e P - v c - 3 problem. Baker [4] provided an E P T A S algorithm of time 2'^'^^/^'>p{n) for t h e P-VC problem. B y applying t h a t algorithm, we get an E P T A S algorithm of time 2'-'^^/^^p[n) for t h e P - v c - 3 problem. Since t h e P - v c - 3 problem seems simpler, one might suspect t h a t we could have a better E P T A S algorithm for it t h a n t h a t for t h e P-VC problem. In t h e following we show t h a t if we can improve t h e E P T A S algorithm for the P-VC-3 problem, then we can improve t h e E P T A S algorithm for t h e P-VC problem. T h e o r e m 3 . If the P-VC-3 problem has an EPTAS of running time then the P-VC problem has an EPTAS of running time f{13/e)n'-'^^\ is a recursive function and e > 0 is the given error bound.
f{l/e)n^^^\ where f
Proof Given an E P T A S algorithm A of running time f(l/e)n°^^^ for t h e P-VC3 problem, we provide an E P T A S algorithm B of running time /(13/e)n'^^^) for t h e P-VC problem. T h e description of algorithm B is given in Fig. 4. Algorithm B Input: A planar graph Gi = {Vi,Ei),
and a constant e > 0.
Output: A vertex cover Ci for Gi, such that |Gi| < (1 + e) * | O P r i | . 1. Let V>3 be the set of all vertices of degree larger than 3 in the graph G i . Unfold all vertices of degree larger than 3 in G i , let the resulting graph be G2 = {V2,E2), whose degree is bounded by 3. 2. Run the algorithm A with e' = e/13 on the graph G2. We get a vertex cover G2 for the graph G2. 3. From G2 construct a vertex cover Gi of at most IG2I — ^^^y vertices for the graph Gi.
('^sff('") " 3)
4. Return Gi.
Fig. 4. EPTAS algorithm for PLANAR VERTEX COVER.
We claim t h a t t h e vertex set C i is t h e required vertex cover for t h e graph By Equation 1 and Claim 4, we have
IOPT2I = lOPTil + Yl (^e5(w) - 3) u€V>3
u6Vi
On PTAS for Planar Graph Problems
311
< \OPTi\+&n < |(9PTi| + 12|OFTi| < 13|0PTi|. Therefore, \0PT2\ < 13|0PTi|.
(3)
By Claim 4, we have lOPTil = IOPT2I -
^
{deg{u) - 3)
USV>3
and •ueK>3
Therefore, we have |C2|-|Ci|>|OPT2|-|OPri! or equivalently |C2|-|OPT2|>|Ci|-|OPri| Prom this, we derive immediately |Ci|/|OPTi|-l = (|Ci|-|OPTi|)/|OPTi| <(|C2i-|OPT2|)/|OPTi| < 13(|C2| -
\OPT2\)/\OPT2\
= 13(|C2|/|OPr2| - 1) < 13*(e/13)
Here we have used the assumption that C2\/\OPT2\ < 1 + e' = 1 + e/13, and the fact IOPT2I > 13|0PTi|. The call of the algorithm A on the graph G2 takes time f{l/e')n^^^\ All the other steps of the algorithm B take polynomial time n'-'^^\ Therefore, the running time of the algorithm B is f{13/e)n'-^^^\ and the approximation ratio for the algorithm P is 1 + e.
5 Summary In this paper, we have proved lower bound results on the running time of the PTAS algorithms for a class of planar graph problems including PLANAR INDEPENDENT SET, PLANAR VERTEX COVER and PLANAR DOMINATING SET. We pointed out that there is a gap between our lower bound result and the current
312
X. Huang and J. Chen
known upper bound result on t h e running time of the P T A S algorithms for these planar graph problems. We then studied t h e P T A S algorithms for PLANAR VERTEX COVER problem. Based on our study of t h e relationship between PLANAR VERTEX COVER and PLANAR VERTEX COVER on planar graphs of degree bounded by three, we showed t h a t to further improve the upper bound on the running time of the P T A S algorithms for P L A N A R V E R T E X C O V E R , we
could concentrate on t h e PLANAR VERTEX C O V E R on planar graphs of degree bounded by three. Closing t h e gap and further improving t h e upper bound on the running time of the P T A S algorithms for these planar graph problems are nice open problems inviting further research.
References 1. Alber J, Bodlaender HL, Fernau H, Kloks T, and Niedermeier R (2002) Fixed parameter algorithms for dominating set and related problems on planar graphs. Algorithmica 33:461-493 2. Alber J, Fernau H, Niedermeier R (2004) Parameterized complexity: exponential speed-up for planar graph problems. J. Algorithms 52:26-56 3. Ausiello G, Crescenzi P, Gambosi G, Kann V, Marchetti-Spaccamela A, and Protasi M (1999) Complexity and Approximation, Combinatorial Optimization Problems and Their Approximability Properties. New York, Springer-Verlag 4. Baker BS (1994) Approximation algorithms for NP-complete problems on planar graphs. Journal of the ACM 41:153-180 5. Bar-Yehuda R and Even S (1982) On approximating a vertex cover for planar graphs. Proceedings of the fourteenth annual ACM symposium on Theory of computing, pp.303-309 6. Cai L and Chen J (1997) On fixed-parameter tractability and approximability of NP optimization problems. Journal Of Computer and System Sciences 54:465-474 7. Cai L, Fellows M, Juedes D, Rosamond F (2006) The complexity of polynomialtime approximation. Theory of Computing Systems, to appear. 8. Cai L and Juedes DW (2003) On the existence of sub-exponential time parameterized algorithms. Journal of Computer and System Sciences 67:789-807 9. Cesati M and Trevisan L (1997) On the efficiency of polynomial time approximation schemes. Information Processing Letters 64:165-171 10. Chen J, Chor B, Fellows M, Huang X, Juedes DW, Kanj I and Xia G (2004) Tight lower bounds for parameterized NP-hard problems. Proc. of the 19th Annual IEEE Conference on Computational Complexity, pp. 150-160 11. Chen J, Huang X, Kanj I and Xia G (2004) Linear F P T reductions and computational lower bounds. Proc. of the 36th ACM Symposium on Theory of Computing, pp. 212-221 12. Chen J, Kanj I, and Jia W (2001) Vertex cover: further observations and further improvements. Journal of Algorithms 41:280-301 13. Chen J, Kanj I, Xia G (2003) A note on parameterized exponential time complexity. Tech. Report, DePaul University 14. Diestel R (2000) Graph theory. New York: Springer 15. Downey RG and Fellows MR (1999) Parameterized complexity. Springer, New York
On PTAS for Planar Graph Problems
313
16. Eppstein D (2000) Diameter and treewidth in minor-closed graph families, Algorithmica 27:275-291 17. Fomin FV and Thilikos DM (2003) Dominating sets in planar graphs: branchwidth and exponential speed-up. Proc. of the Fourteenth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 168-177 18. Fomin FV and Thilikos DM (2004) A simple and fast approach for solving problems on planar graphs. Lecture Notes in Computer Science 2996:56-67 19. Garey M and Johnson D (1979) Computers and intractability: a guide to the theory of NP-Completeness. W. H. Freeman, New York 20. Grohe M (2003) Local tree-width, excluded minors, and approximation algorithms, Combinatorica 23:613-632 21. Hopcroft JE and Tarjan RE (1974) Efficient planarity testing. Journal of the ACM 21:549-568 22. Impagliazzo R, Paturi R, Zane F (2001) Which problems have strongly exponential complexity? Journal of Computer and System Sciences 63: 512-530 23. Kanj I, Perkovic L (2002) Improved parameterized algorithms for planar dominating set. Lecture Notes in Computer Science 2420:399-410 24. Khanna S, Motwani R (1996) Towards a Syntactic Characterization of PTAS, STOC 1996: 329-337 25. Lipton RJ, Tarjan RE (1980) Applications of a planar separator theorem. SIAM J. Comput. 9:615-627 26. Papadimitriou CH, Yannakakis M (1991) Optimization, approximation, and complexity classes. Journal of Computer and System Sciences 43: 425-440 27. Papadimitriou CH and Yannakakis M (1999) On the complexity of database queries. Journal of Computer and System Sciences 58:407-427
Index
Abraham, Marco 283 Arenas, Marcelo 3 Bockenhauer, Hans-Joachim Bloom, Stephen 231 Bortolussi, Luca 91 Brodnik, Andrej 103 Caromel, Denis 165 Chen, Jianer 299 Coja-Oghlan, Amin 271
Jeron, Thierry
251
Kotter, Rolf 283 Karlsson, Johan 103 Kiwi, Marcos 9 Kneis, Joachim 251 Kralovic, Rastislav 131 Krumnack, Antje 283 Kupke, Joachim 251 Kutrib, Martin 151 Lanka, Andre
d'Orso, Julien 213 Dean, Brian 65 Di Lena, Pietro 185 Dobrev, Stefan 131 Esik, Zoltan
231
Fabris, Prancesco 91 Flocchini, Paola 131 ForHzzi, Luca 251 Goemans, Michel 65 Goerdt, Andreas 271 Gruska, Jozef 5,17 Gutierrez, Claudio 7 Guttmann, Walter 77
197
271
Malcher, Andreas 151 Marchand, Herve 197 Matsuzaki, Kazutaka 115 Maucher, Markus 77 Munro, J. Ian 103 Nilsson, Andreas
103
Policriti, Alberto 91 Prencipe, Giuseppe 47 Proietti, Guido 251 Rusu, Vlad
197
Santoro, Nicola 11,47,131 Sei, Yuichi 115
Henrio, Ludovic 165 Honiden, Shinichi 115 Hromkovic, Juraj 251 Huang, Xiuzhen 299
Wanke, Egon 283 Widmayer, Peter 251
Immorlica, Nicole
Yannakakis, Mihalis
65
Touili, Tayssir
213
13