An O(n^2) Time Algorithm for Alternating B"uchi Games
Computing the winning set for B{\"u}chi objectives in alternating games on graphs is a central problem in computer aided verification with a large number of applications. The long standing best known upper bound for solving the problem is $\tilde{O}(…
Authors: Krishnendu Chatterjee, Monika Henzinger
An O ( n 2 ) T ime Algorithm for Alternati ng B ¨ uchi Games Krishnendu Chatterjee ∗ Monika Henzinger † Abstract Computing the winning set for B ¨ uchi objectives in alternating games on grap hs is a central p roblem in computer aided verification with a large n umber of application s. The l ong standing best known upper bou nd for solving th e problem is e O ( n · m ) , where n is the nu mber of vertices and m is th e num ber of edg es in the graph. W e are the first to break the e O ( n · m ) boundar y b y presentin g a ne w technique that reduces the running time to O ( n 2 ) . T his bound also leads to O ( n 2 ) time algor ithms for computing the set of almost-sure winning vertices for B ¨ uchi ob jectiv es (1) in a lternating g ames with prob abilistic transitions (improving an earlier bound of e O ( n · m ) ), (2) in concurre nt graph games with constant actions (improving an earlier bound of O ( n 3 ) ), and (3) in Markov decision processes (imp roving for m > n 4 / 3 an ea rlier bound o f O (min ( m 1 . 5 , m · n 2 / 3 ) ). W e also show that the same techn ique can be u sed to compute the maximal end- compo nent deco mposition of a graph in time O ( n 2 ) , which is an imp rovement over earlier b ound s for m > n 4 / 3 . Finally , we show h ow to maintain the winnin g set for B ¨ uchi objectives in alter nating games under a sequence of edge insertion s or a sequence of e dge deletions in O ( n ) amortized time p er ope ration. This is th e first dy namic algor ithm for this problem . Ke ywords: (1) Graph games; (2) B ¨ uch i objectives ; (3) Graph algorit hms; (4 ) Dynamic graph algorithms; (5) Computer -aided verificat ion. 1 Intr oduction Consider a direct ed graph ( V , E ) with a partition ( V 1 , V 2 ) of V and a set B ⊂ V of B ¨ uch i vertic es. This grap h is called a game graph . Let n = | V | and m = | E | . T wo play ers play the follo wing alternatin g game on the graph that forms an infinite path. They start by placing a tok en on an initial ver tex and then take turns indefinitely in movin g the token: At a v ertex v ∈ V 1 player 1 mo ve s the to ken along o ne of th e out-e dges of v , at a ve rtex u ∈ V 2 player 2 moves the token along one of the out-ed ges of u . A first questio n to ask is giv en a start verte x x ∈ V can player 1 guarantee that the infinite path visits a verte x in B at least once , no matter what choice s player 2 makes . If so player 1 ca n win from x and x belongs to the winnin g set o f playe r 1 . The q uestio n of compu ting the set of vertices from w hich player 1 can win (called the winning set ) is called the (alterna ting) r eac habili ty game pr oblem . The problem is PTIME-complete and the winning set of player 1 can be computed in time linear in the size of the graph [2, 19]. A second, more central question is whether player 1 can guaran tee that the infinite path visits a vert ex in B infinitely often , no m atter what choices player 2 makes. Computing the winning set of player 1 for t his setting is ca lled the (altern ating ) B ¨ uch i game pr oblem . The best kno wn algorithms for this pr oblem are algori thms that repeatedly compute the alternatin g reachability game solution on the graph after the remov al of specific vertice s. Their running time is e O ( n · m ) . W e present in this paper a ne w algorithmic technique for the alterna ting B ¨ uchi game problem which is inspired by dynamic graph algorith ms and which reduces the running time to O ( n 2 ) . T wo-play er games on graphs pl ayed by player 1 and the adversa ry play er 2 ar e central in many proble ms in comp uter scie nce, speci ally in ve rification and synthesis of sys tems such as the syn thesis of sys tems from ∗ IST Austria (Institute of Science and T echnology Austria) Email: krishnendu.c hatterjee@ist. ac.at † Researc h G roup Theory and Applicati ons of Algorithms, Univ ersity of Vi enna, Austria. E mail: monika.henzinge r@univie.ac.at specifica tions and synthe sis of reacti ve systems [11, 26, 27], verificat ion of open systems [1], checking interface compatib ility [14], well-formed ness of specificatio ns [15], and m any others. Besides their appli cation in ver ification, they ha ve also been studi ed in artifical intellig ence as AND-OR graphs [24], and in the context of altern ating Tur ing machines [6]. The class of B ¨ uchi or repea ted reachabil ity objec ti ve s was introduc ed in the seminal work s of B ¨ uch i [3, 4, 5] in the conte xt of automata o ver infinite words . The alterna ting B ¨ uc hi game pr oblem is o ne of th e core p roblems in ver ification and synth esis. For example, (a) the solut ion of the synth esis problem for determinis tic B ¨ uchi automata is achie ved throu gh solving the alternati ng B ¨ uchi game problem (se e [23] for the importance of determin istic B ¨ uchi automata ); and (b) the verifica tion of open systems with liv eness and weak fairness conditi ons (two key specifica tions used in verificatio n) is again solved through altern ating B ¨ uchi game proble m [1]. V ardi [30, 29] discus ses further applicati ons of the alternati ng B ¨ uchi game p roble m and its importance . The classic al algorithm for alternatin g B ¨ uchi games follo w s from the results of [16, 25, 31], its complexi ty is O ( n · m ) . The algorithm was improv ed in the specia l case of game graphs w ith m = O ( n ) to O ( n 2 / log n ) time in [9]. A generalizati on of the algorithm from [9] was presen ted in [8], and the new algorith m requires O (( n · m · log ∆) / log n ) time, where ∆ is th e maximum o ut-de gree. T hus the long standing best kno wn upper boun d for solvin g the altern ating B ¨ uchi game prob lem is e O ( n · m ) . In the design and verifica tion of open systems it is natural that the systems under ver ification are dev eloped incremen tally by addin g choice s or remov ing choice s for the system, which is represen ted by player 1. Howe ver the adv ersary , modeled by player 2, is the en vironment, and the syste m design has no control over the en vironme nt action s. H ence there is a clear motiv ation to obtain dynamic algorithms for the alternating B ¨ uchi game prob lem, when edges lea ving player -1 vert ices are inserted or deleted, while edges lea ving player -2 vertices remain uncha nged. Our contrib utions. In this work w e present improv ed static and the fi rst dynamic algorith ms for the alternating B ¨ uchi game prob lem using graph algorithmic technique s. O ur main resu lts are as follows. 1. W e presen t an O ( n 2 ) time algo rithm for the alternatin g B ¨ uchi game pr oblem, and thus break the long standi ng barrier o f e O ( n · m ) for the problem. It follo w s that in combination with the O ( n 2 / log n ) algorit hm for m = O ( n ) , we break the O ( n · m ) barrier for all cases. 2. W e presen t the first incremental and decremental algorithms for the alternati ng B ¨ uc hi game proble m for inserti on and deletio n of player -1 edges. Our al gorith m is based on the progress measure algorit hm of [20] and generalizes the Even-Shiloa ch algorithm for decrementa l reacha bility in undirected graphs [17]. The total time for all operat ions is O ( n · m ) , i.e., the amortiz ed time per operat ion is O ( n ) . 3. Using our tech nique s to solve alter nating B ¨ uchi games w e also show th at the maximal end-componen t decompo sition problem (a co re pr oblem in pr obabilisti c veri fication) can also be solv ed in O ( n 2 ) time (see [13] and other referenc es of [7] for the importanc e of the probl em). The best kno wn bound for this proble m was O (min( m 1 . 5 , m · n 2 / 3 )) [7]. T hus, our algori thm is faster for m > n 4 / 3 and we obtain an impro ved bound of O (min( m 1 . 5 , n 2 )) for the proble m. Decrementa l and inc remenal algorithms for computing the maximal end-componen t decomposit ion was giv en in [7]. Ho wev er , our algorithms ar e the fi rst dynamic algo rithms for the alternating B ¨ uchi game problem and complete ly diffe rent from [7]. Our result for altern ating B ¨ uchi games impro ves the bound s for other problems as well. W e list them belo w . 1. The problem of computin g the set of almost-sur e (or probabilit y 1) winning vertic es in alterna ting games with proba bilisti c transiti ons (aka simple stocha stic games [12]) and B ¨ uch i objecti ves can be so lve d in O ( n 2 ) time improvi ng the pre vious kno wn e O ( n · m ) bound: this follo ws from the linear reduction of [10] from simple stochastic games to altern ating B ¨ uchi games for almost-sure winning and our B ¨ uchi games algori thm. 2. The problem of comput ing the set of almost-sure (proba bility 1) and limit-sure (proba bility arbitraril y close to 1) winning vertices in con curren t graph games (aka games with simulta neous inte raction ) with consta nt action s w ith B ¨ uchi objecti ves can be solved in O ( n 2 ) time: this follo ws from the linear reduction from concur rent games to alternatin g B ¨ uchi games [21] and our B ¨ uchi algorithm. The best kno wn bound for concurrent graph games with constant actions with B ¨ uchi objecti ves was O ( n · | δ | ) , where | δ | is the number of transit ions which is O ( n 2 ) in the worst case. Thus, in the worst case the prev ious best kno w n bound was O ( n 3 ) . 3. As a conseq uence of our O ( n 2 ) algorit hm for B ¨ uchi games and the lin ear reducti on of [10], we also obtain an O ( n 2 ) algorithm for computing almost-sur e winning states for Marko v decision processe s with B ¨ uchi object i ve s. The best known bound for this proble m was O (min( m 1 . 5 , m · n 2 / 3 )) [7]. Thus, our algorithm is fas ter for m > n 4 / 3 and we obtain an improv ed bound of O (min ( m 1 . 5 , n 2 )) for the proble m. Our main technical contrib ution is twofold: (1) The classic al algorith m for alternatin g B ¨ uchi games repeat edly removes non-winn ing vertices from the game graph and then recomputes the player -1 winning set for the alternating reachability game proble m. Similar to the classical algorithm our algori thm repea tedly remov es non-winn ing verti ces from the game graph. Howe ver , it finds these verti ces more efficien tly using a hierarchi cal graph decomposition techn ique. This technique was used first by Henzinger et al. [18] for proces sing repeated edge deletions in undirected graphs. W e show how this technique can be extended to work for verte x deletions in (directed) game graphs. As a result we achie ve faster algorith ms for the alternating B ¨ uchi game proble m and for computing the maximal end-co mponen t decomp ositio n. Moreov er , eve n in sparse graphs, our techniq ue can be useful. If m = c · n and c is a lar ge consta nt, then our hiercharical decompositio n can be used with a small number of le ve ls, such as 2 or 3 , to speed up the algorith m in practi ce. (2) E ven and Shiloach [17] gav e a deletion s-onl y algorith m for maintaining re achab ility in undire cted gr aphs. W e sho w ho w to e xtend this algorithm to edge d eletio ns in di rected game gr aphs. A purely graph -theor etic proof of the correctne ss of th e ne w algorith m would be le ngthy . Ho wev er , by usi ng an ele gant arg ument based on fix-point s we gi ve a simple proof of the correctn ess and an analysis of the running time of the ne w algorithm. The new algor ithm is simple and, like the algorithm in [17], does not need any soph istica ted data structures . W e use a “dual” fix point ar gument to constru ct an incrementa l algorith m for alterna ting B ¨ uchi games . The paper is orga nized as follo ws: W e gi ve all necessary definitions in Section 2. Section 3 and Section 4 contai n the ne w stati c algori thms for th e alte rnatin g B ¨ uch i game and the max imal end- compon ent decompositi on proble m. Section 5 finally conta ins the ne w dynamic algorith ms. 2 Definitions Alternat ing Game graphs. An (alter natin g) ga me graph G = (( V , E ) , ( V 1 , V 2 )) consists of a directed graph ( V , E ) with a set V of n vertice s and a set E of m edges, and a part ition ( V 1 , V 2 ) of V into two sets. The ver tices in V 1 are player 1 vertices and the vertic es in V 2 are player 2 vertices . For a ver tex u ∈ V , we write O ut ( u ) = { v ∈ V | ( u, v ) ∈ E } for the set of succes sor vertices of u and I n ( u ) = { v ∈ V | ( v , u ) ∈ E } for the set of incoming edges of u . W e assume that ev ery vertex has at least one out-goin g edge. i.e., O ut ( u ) is non-emp ty for all vertices u ∈ V . Plays. A game is played by two players: player 1 and player 2, who form an infinite pat h in the game graph by m ovin g a token along edges. They start by placing the token on an initial verte x, and then they take mov es indefinit ely in the follo w ing way . If the token is on a vert ex in V 1 , then player 1 m ov es the token along one of the edges going out of the verte x. If the tok en is on a vertex in V 2 , then player 2 does like wise. T he result is an infinite path in the game grap h, called plays . W e write Ω for the set of all plays . Str ate gies. A strateg y fo r a player is a rule that specifies ho w to exte nd plays. Formall y , a stra te gy σ for player 1 is a function σ : V 1 → V such that σ ( v ) ∈ O ut ( v ) for all v ∈ V 1 , and analo gousl y fo r play er 2 strate gies 1 . W e write Σ and Π for the sets of all strate gies for player 1 and player 2, respecti vely . Giv en a 1 In general strategie s are defined as functions σ : V ∗ · V 1 → V that, giv en a finite sequence of ver tices (representi ng the history of the play so far) which ends in a player 1 verte x, chooses the next vert ex. The strategy must choose only av ailable successors, i.e., for all w ∈ V ∗ and v ∈ V 1 we hav e σ ( w · v ) ∈ O ut ( v ) . T he strategie s for player 2 are defined analogously . Ho wev er for all objecti ves considere d in the paper there exists a winning startin g verte x v ∈ V , a strategy σ ∈ Σ for player 1, and a strate gy π ∈ Π for player 2, there is a unique play , denote d ω ( v , σ, π ) = h v 0 , v 1 , v 2 , . . . i , which is defined as follows: v 0 = v and for all k ≥ 0 , if v k ∈ V 1 , then σ ( v k ) = v k +1 , and if v k ∈ V 2 , then π ( v k ) = v k +1 . Objective s. W e consider game graphs with a B ¨ uchi objec ti ve for player 1 and the complementar y coB ¨ uch i object i ve for player 2. For a play ω = h v 0 , v 1 , v 2 , . . . i ∈ Ω , we define Inf ( ω ) = { v ∈ V | v k = v for infinitely many k ≥ 0 } to be the set of vertices that occur infinitely often in ω . W e also define reach- ability and safety object i ves as they will be usefu l in the analysis of the algorithms. 1. Reachab ility and safety objective s. G i ven a set T ⊆ V of vertice s, the reachabil ity ob jecti ve Reac h ( T ) requir es that some verte x i n T be visited, and dually , the safety objecti ve Safe( F ) requir es th at only verti ces in F be visit ed. Formally , the sets of winning plays are Reac h ( T ) = {h v 0 , v 1 , v 2 , . . . i ∈ Ω | ∃ k ≥ 0 . v k ∈ T } and Safe( F ) = {h v 0 , v 1 , v 2 , . . . i ∈ Ω | ∀ k ≥ 0 . v k ∈ F } . The reachability and safety objecti ves are dual in the sense that Reac h ( T ) = Ω \ Safe( V \ T ) . 2. B ¨ uch i and coB ¨ uch i objectives. Given a set B ⊆ V of vert ices, the B ¨ uchi objecti ve Buchi( B ) requires that some verte x in B be visited infinitely often, and dually , the coB ¨ uchi objecti ve coBuc hi ( C ) requires that only vertices in C be visite d infinitel y often. Thus, the sets of w inning plays are Buchi( B ) = { ω ∈ Ω | Inf ( ω ) ∩ B 6 = ∅} and coBuc h i ( C ) = { ω ∈ Ω | Inf ( ω ) ⊆ C } . The B ¨ uchi and coB ¨ uchi objecti ves are dual in th e sen se that B uc h i( B ) = Ω \ coBuc hi ( V \ B ) . O bserv e that B ¨ uchi an d co B ¨ uchi objec ti ves are tail (or pr efix-inde pende nt) objecti ves, i.e., a play satisfies the objecti ve if and only if the play obtain ed by adding or deleting a finite prefix also satisfies the objec ti ve. W inning stra te gies and sets. Giv en an objecti ve Φ ⊆ Ω for player 1, a strate gy σ ∈ Σ is a winnin g stra te gy for pla yer 1 from a ve rtex v if fo r all pl ayer 2 strategie s π ∈ Π the play ω ( v , σ, π ) is w inning, i.e., ω ( v , σ, π ) ∈ Φ . The winning strate gies for player 2 are defined analogous ly by switching the role of player 1 and player 2 in the abov e definition. A v erte x v ∈ V is winning for player 1 with respect to the objecti ve Φ if pla yer 1 has a winning strate gy from v . Formally , the set of winn ing vertice s for player 1 with respect to the ob jecti ve Φ is W 1 (Φ) = { v ∈ V | ∃ σ ∈ Σ . ∀ π ∈ Π . ω ( v , σ, π ) ∈ Φ } the set of all w inning ver tices. Analog ously , the set of all winning vertices for playe r 2 with respect to an objecti ve Ψ ⊆ Ω is W 2 (Ψ) = { v ∈ V | ∃ π ∈ Π . ∀ σ ∈ Σ . ω ( v , σ, π ) ∈ Ψ } . T H E O R E M 2 . 1 . ( C L A S S I C A L M E M O RY L E S S D E T E R M I N A C Y [ 1 6 ] ) F or all game gr aphs G = (( V , E ) , ( V 1 , V 2 )) , all B ¨ uch i objective s Φ for player 1, and the complemen tary coB ¨ uch i objective Ψ = Ω \ Φ for player 2, we have W 1 (Φ) = V \ W 2 (Ψ) . Thus the theorem shows that e ver y vertex of V either belongs to the winning set of B ¨ uchi object i ve s of player 1 or to the win ning set of coB ¨ uc hi objecti ves for player 2. S ince we onl y consider this setting we simply say in the rest of the paper that e ve ry verte x either is winning for player 1 or winning for player 2 . The algori thmic question in alternat ing graph games with B ¨ uchi obje cti ve Φ is to comput e the set W 1 (Φ) . 3 Algorithms f or B ¨ uchi Games In this section we consider algorit hms for B ¨ uchi games, and when we mention winning vertices or strate gies we mean winning for B ¨ uc hi objecti ve s, unless expli citly mention ed othe rwise. In this section we p resen t the classical iterati ve algorithm for B ¨ uchi games to compute the w inning sets. W e then presen t our new algorith m. W e start with the notion of closed sets , attra ctor s , and alternatin g rea cha bility which are key notions for the analysis of the algorithm. W e prese nt the graph theor etic definitions , and then present w ell-kno wn facts that establish the conne ction of the graph definit ions and strategie s in altern ating game grap hs. memoryless strate gy for a player at a verte x v iff there exist s a winning s trate gy with memory for the player at v . Thus for simplicity we only consider the simpler class of memoryless strate gies. Closed sets. A set U ⊆ V of vertice s is a close d set for player 1 if the follo wing two conditi ons hold: (a) For all vertic es u ∈ ( U ∩ V 1 ) , we hav e O ut ( u ) ⊆ U , i.e., all success ors of player 1 ve rtices in U are again in U ; and (b) for all u ∈ ( U ∩ V 2 ) , we hav e O ut ( u ) ∩ U 6 = ∅ , i.e., ev ery player 2 vertex in U has a successo r in U . The closed sets for player 2 are defined analogousl y as abov e by exchang ing the roles of player 1 and player 2 (ex chang ing V 1 and V 2 ). Every closed set U fo r player ℓ ∈ { 1 , 2 } , induce s a sub-game graph, denoted G ↾ U . Fac t 1. Consider a game graph G , and a closed set U for pla yer 1. Then the follo wing assertions hold: 1. Player 2 ha s a winning stra teg y for the o bjecti ve Safe( U ) for all v ertices in U , i.e., play er 2 can ensur e that if the play starts in U , then the play ne ver lea ve s set U . 2. For all T ⊆ V \ U , we hav e W 1 (Reac h ( T )) ∩ U = ∅ , i.e., for any set T of vertices outside U , player 1 does not ha ve a strategy from ver tices in U to ensure to reach T . 3. If U ∩ B = ∅ (i.e., there is no B ¨ uch i ver tex in U ), then eve ry vert ex in U is winnin g for player 2. Attrac tor s. Give n a game graph G , a set U ⊆ V of tar get verti ces, and a player ℓ ∈ { 1 , 2 } , the set Attr ℓ ( U, G ) (called attr actor ) is the set of vertice s from which player ℓ has a strateg y to reach a ver tex in U against all strate gies of the other playe r; that is, A ttr ℓ ( U, G ) = W ℓ (Reac h( U )) . The set Attr 1 ( U, G ) can be defined induct i ve ly as follo ws: let R 0 = U ; let R i +1 = R i ∪ { v ∈ V 1 | O ut ( v ) ∩ R i 6 = ∅} ∪ { v ∈ V 2 | O ut ( v ) ⊆ R i } for all i ≥ 0; then Attr 1 ( U, G ) = S i ≥ 0 R i . T he induct i ve definition of Attr 2 ( U, G ) is analogous with V 1 replac ed by V 2 and vic e-v ersa. For a ll ve rtices v ∈ Attr 1 ( U, G ) , define r ank ( v ) = i if v ∈ R i \ R i − 1 , that is, r ank ( v ) denotes the least i ≥ 0 such th at v is inclu ded in R i . Define a memoryless s trate gy σ ∈ Σ for pla yer 1 as follo ws: for each v ertex v ∈ ( Attr 1 ( U, G ) ∩ V 1 ) with r ank ( v ) = i , choose a suc cesso r σ ( v ) ∈ ( R i − 1 ∩ O ut ( v )) (such a succes sor exist s by the inducti ve definitio n). It follo ws that for all vertex v ∈ Attr 1 ( U, G ) and all strate gies π ∈ Π for pla yer 2, t he p lay ω ( v , σ, π ) reaches U in at m ost | A ttr 1 ( U, G ) | transiti ons. Observe that for ℓ ∈ { 1 , 2 } , we ha ve U ⊆ Attr ℓ ( U, G ) , i.e., the set U alw ays belon gs to the attrac tor . Alternati ng r eac hability . For ℓ ∈ { 1 , 2 } , for a verte x u ∈ Attr ℓ ( U, G ) we say that u can alt ℓ -r each the set U . In other words, alt ℓ -reach denotes that player ℓ has a strateg y to reach the targ et set, irrespecti ve of the strategy of the other playe r . Fac t 2. For all game gra phs G , all players ℓ ∈ { 1 , 2 } , and all sets U ⊆ V of vertices, the follo wing holds: 1. The set V \ A ttr ℓ ( U, G ) is a closed set fo r pl ayer ℓ , i.e., no p layer ℓ verte x in V \ Attr ℓ ( U, G ) has an edge to Attr ℓ ( U, G ) and ev ery ver tex of th e other player in V \ Attr ℓ ( U, G ) has an edge in V \ Attr ℓ ( U, G ) . 2. The set Attr ℓ ( U, G ) can be compute d in time O ( | P v ∈ Attr ℓ ( U,G ) I n ( v ) | ) [2, 19]. C O RO L L A RY 3 . 1 . Every verte x in the set V \ Attr 1 ( B , G ) is w inning for playe r 2 and is not winning for playe r 1. 3.1 Classica l al gorithm for B ¨ uchi games In this subsection we present the classical algorithm fo r B ¨ uchi games. W e start with an informal descrip tion of the algori thm. Inf ormal description of classi cal algor ithm. The classical algorithm (Algorithm 1) works as follo ws. W e descri be an iteration j of the algorithm: the set of verti ces at iteration j is denote d by V j , the game graph by G j and the set of B ¨ uchi vertices B ∩ V j by B j . A t iteration j , the algorith m fi rst finds the set of vertices R j from which player 1 can alt 1 -reach the set B j , i.e., computes Attr 1 ( B j , G j ) . The rest of the vertices T r j = V j \ R j is a closed subset for player 1, and T r j ∩ B j = ∅ . Thus the set T r j is winning for player 2 (by Corollary 3.1). Then the set of verti ces W j +1 , from which player 2 can alt 2 -reach the set T r j , i.e., Attr 2 ( T r j , G j ) is comput ed. The set W j +1 is winning for player 2, and not for player 1 in G j and also in G . T hus, it is remove d from the ver tex set to obtain game graph G j +1 . T he algorith m then iterate s on the reduced game graph, i.e., proceeds to iterati on j + 1 on G j +1 . In e very ite ration a linear -time attractor c omputat ion is perfo rmed with the cur rent B ¨ uchi ver tices as tar get to fi nd the set of vertices w hich can alt 1 -reach the B ¨ uch i set. Each iteration takes O ( m ) time and the algorithm runs for at m ost O ( n ) iteration s, giving a total time of O ( n · m ) . The algorithm is formally descri bed as A lgorith m 1. The correct ness proof of the algorit hm sho ws that when the algori thm terminate s, all the remaining ver tices are winning for player 1 [25, 28]. Algorithm 1 Classica l algorithm for B ¨ uchi Games Input : A game graph G = (( V , E ) , ( V 1 , V 2 ) and B ⊆ V . Output: W ⊆ V . 1. G 0 := G ; V 0 := V ; 2. W 0 := ∅ ; 3. j := 0 4. repeat 4.1 W j +1 := AvoidSetClassi cal ( G j , B ∩ V j ) 4.2 V j +1 := V j \ W j +1 ; G j +1 = G ↾ V j +1 ; j := j + 1 ; until W j = ∅ 5. W := S j k =1 W k ; 6. retur n W . Pro cedur e AvoidSetCla ssical Input: Game graph G j and B j ⊆ V j . Output: set W j +1 ⊆ V j . 1. R j := Attr 1 ( B j , G j ) ; 2. T r j := V j \ R j ; 3. W j +1 := Attr 2 ( T r j , G j ) T H E O R E M 3 . 1 . ( C O R R E C T N E S S A N D RU N N I N G T I M E ) Given a game graph G = (( V , E ) , ( V 1 , V 2 )) and B ⊆ V the following assertio ns hold: 1. W = W 2 (coBuc hi ( V \ B )) and V \ W = W 1 (Buc hi ( B )) , wher e W is the output of A lgorith m 1 ; and 2. the running time of Algorithm 1 is O ( n · m ) . 3.2 New Algorithm In this section we presen t our new algo rithm for computing the winning set for game graphs with B ¨ uchi obje cti ves in time O ( n 2 ) . Notations. Giv en an alternat ing game graph G = (( V , E ) , ( V 1 , V 2 )) and a set B of B ¨ uchi vertices, we label the B ¨ uchi vertic es as priority 0 vertices, and the set V \ B as pr iority 1 vert ices. For ev ery v ertex v the inedges ha ve a fixed order such that all edges from priority 1 player -2 ver tices come before all other edges. W e mainta in log n graphs G i such that G i = ( V , E i ) . The set E i contai ns all edges ( u, v ) where (a) o utdeg ( u ) ≤ 2 i , where o utdeg ( u ) = | O ut ( u ) | or (b) the edge ( u, v ) belongs to the first 2 i inedge s of verte x v . Note that E i − 1 ⊆ E i since the order of the inedges is fixed. W e color eve ry player -1 verte x v in G i blue if o utdeg ( v ) > 2 i . W e color e ve ry player -2 verte x v in G i ora ng e if o utdeg ( v ) > 2 i . All other vertice s ha ve color white. For ev ery vertex v that is white in G i , all its outedges O ut ( v ) are containe d in E i . These edg es ad d up to 2 i · n ed ges to E i . Addition ally the first up to 2 i inedge s of ev ery ver tex belo ng to E i , addin g another up to 2 i · n edges to E i . Thus | E i | ≤ 2 i +1 · n . W e denote by G the full graph. Note that G = G log n and thus all vert ices in G log n are white. The new algorithm N E W A L G O . The ne w a lgorith m c onsist s of two neste d loops , an outer loop with loop c ounte r j and an inner loop with loop counter i . The algorithm will iterat i vel y delete verti ces from the graph, and we denote by D j the set of vertices deleted in iteratio n j , and by U the set of vertices deleted in all iterations upto the current iteration (initially U is empty). For j ≥ 1 , we w ill denote by G j i the sub-grap h of G i induce d after remov al of the set U of vertices at the beginn ing of iteration j , and G 0 i is G i (the initial graphs). W e den ote the vert ex set in iteration j as V j and the B ¨ uchi set as B j (i.e., B j := V j ∩ B ). The intuiti ve descriptio n of the algorithm is as follo ws: Starting fro m i = 0 the algorith m searche s in eac h ite ration j in ea ch gr aph G j i for a special player -1 closed set S j with no B ¨ uchi vertex and stop at the smal lest i at which such a closed set exi sts. Since S j ∩ B j = ∅ , Fact 1 implies that all the vert ices in S j are winning for player 2. Thus, by the same ar guments as for the classical algorithm the player -2 attractor Attr 2 ( S j , G j i ) are winning for player 2 in G j i and, as our correctness proof sho ws, also winning in G . T hus they are remov ed from the verte x set and the algorithm iterate s on the reduced game graph. Computin g S j tak es time O (2 i · n ) and, due to the fact that no such set was found in G j i − 1 we can show that S j it contain s at least 2 i − 1 ver tices. Thus, using amortized analysis we char ge O ( n ) to each of the 2 i − 1 ver tices in S j that are remov ed, giving a total running time of O ( n 2 ) . The details of N E W A L G O follow . 1. For j = 0 , let Y 0 := Attr 1 ( B , G 0 ) (where G 0 is the initi al game graph) ; X 0 := V \ Y 0 (i.e., X 0 is the set of ve rtices that cannot alt 1 -reach the B ¨ uchi ve rtices in the initia l game graph G ); and compu te D 0 := Attr 2 ( X, G ) using attractor computation . 2. Remove the vertices of D j from all log n graphs G j i to cr eate graphs G j +1 i ; j := j + 1 ; and U := U ∪ D j ; 3. i := 1 ; 4. repeat (a) Let Z j i be the ve rtices of V j that are (i) either orang e w ith no outed ges in G j i or (ii) blue in G j i . (b) Compute the set Y j i of vertic es in G j i that can alt 1 -reach the B ¨ uchi vert ices or Z i j , i.e., compute Y j i := Attr 1 ( B j ∪ Z j i , G j i ) using attracto r computati on. (c) S j := V j \ Y j i (i.e., V j \ Attr 1 ( B j ∪ Z j i , G j i ) ); i := i + 1 5. until S j is non-e mpty or i = log n 6. if S j 6 = ∅ , then D j := Attr 2 ( S j , G j ) and go to Step 2, else the whole algorithm termina tes and outputs V \ U . Let U ∗ be the set of vertic es remov ed from the graph ove r all iteratio ns and Y ∗ = V \ U ∗ be the output of the algorit hm. W e first show that Y ∗ ⊆ W 1 (Φ) , where Φ is the B ¨ uch i objecti ve , i.e., Y ∗ is winning for player 1. Then we show that U ∗ ∩ W 1 (Φ) = ∅ (i.e ., U ∗ is not winning for player 1). T ogether with Theorem 2.1 this sho ws that Y ∗ = W 1 (Φ) estabilis hing the correctn ess of the algorit hm. Finally we analyz e the running time of the algorit hm. L E M M A 3 . 1 . Let Y ∗ be the output of N E W A L G O , and let G ∗ and B ∗ be the game graph and the B ¨ uch i set on terminat ion, re spect ively (i.e., G ∗ is th e gra ph induce d by Y ∗ and B ∗ is B ∩ Y ∗ ). The follo wing assertio ns hold: 1. Y ∗ = Attr 1 ( B ∗ , G ∗ ) , i.e ., player 1 can alt 1 -r each the set B ∗ in G ∗ fr om Y ∗ . 2. Y ∗ is a player -2 closed set in the original game graph G . 3. Y ∗ ⊆ W 1 (Φ) , wher e Φ is the B ¨ uch i objec tive . Pr oof. W e pro ve the three parts belo w . 1. Consider the last iteratio n j ∗ of the outer loop of the algorith m. Since it is the last iterati on, th e set S j ∗ must be empty . It follo ws that i must ha ve been log n in the last iteration of the repeat loop, i.e., the last iterati on of the repeat loop consid ered G j ∗ log n = G ∗ . Let i = log n . Note that all vertic es are white in G ∗ , i.e., Z j ∗ i was empty . Hence we ha ve Y j ∗ i = Attr 1 ( B ∗ ∪ Z j ∗ i , G ∗ ) = Attr 1 ( B ∗ , G ∗ ) . Hence the fact that S j ∗ was empty at the end of the iterat ion implies that V j ∗ \ Y j ∗ i was empty , i.e., that all vertices of G ∗ belong to Attr 1 ( B ∗ , G ∗ ) . Hence Y ∗ = Attr 1 ( B ∗ , G ∗ ) . 2. Whene ver a set of vertices is delet ed in any iteration, it is an playe r -2 attractor . Hence if a vertex u ∈ Y ∗ ∩ V 2 would ha ve an edge to a verte x v ∈ U ∗ , then u would ha ve been included in U ∗ (where U ∗ = V \ Y ∗ ) . Similarly for a player 1 verte x u ∈ Y ∗ ∩ V 1 it must hav e an edge in Y ∗ , as we assume that it has at least one out -edge and if all it s ou t-edge s pointed to U ∗ it woul d ha ve been includ ed in U ∗ . It follo ws that Y ∗ is a player -2 closed set in G . 3. The result is obtaine d from the previo us two items. Consi der a memoryless attractor strate gy σ in G ∗ for player -1 that ensures that for all vertices in Y ∗ the set B ∗ is rea ched within | Y ∗ | steps against all str ateg ies of player -2. Moreo ver the st rate gy only choos es succe ssor in Y ∗ . Since Y ∗ is a pl ayer -2 closed set, it follo ws that against all strategi es of player -2 the set Y ∗ is ne ver left, thus it is ensured that B ∗ is visited infinitely often. Hence th e strategy σ ensure s that for all v ertices v ∈ Y ∗ and all strat egi es π we hav e ω ( v , σ, π ) ∈ Φ . It follo ws that Y ∗ ⊆ W 1 (Φ) . The desire d result follows. T o complete the correctn ess proof we need to sho w that if U ∗ = V \ Y ∗ , then U ∗ ∩ W 1 (Φ) = ∅ , where Φ is the B ¨ uchi objecti ve. W e w ill sho w the result by induct ion on the number of iteratio ns. Let us denote by U j the set o f v ertice s remo ved till iterati on j . The base case is tri vial as initial ly U is emptyset. By indu cti ve hypot hesis, we assume for j ≥ 1 we h a ve U j − 1 ∩ W 1 (Φ) = ∅ , and then sho w that U j ∩ W 1 (Φ) = ∅ . Let G j be the altern ating game grap h obtained after remov al of the set U j − 1 of verti ces. W e will sho w the follo wing claim. Claim 1. In G j , let S j be the non-e mpty set identi fied in iteration j , then Att r 1 ( B j , G j ) ∩ S j = ∅ . In the followin g two lemmata we first sho w ho w with C laim 1 we establis h the correct ness of our algorith m and finally pro ve Claim 1 to complet e the correctne ss proof. L E M M A 3 . 2 . The in ductiv e hypoth esis that U j − 1 ∩ W 1 (Φ) = ∅ and Claim 1 implies that S j ∩ W 1 (Φ) = ∅ . Pr oof. By Claim 1 we hav e Attr 1 ( B j , G j ) ∩ S j = ∅ , and it follo ws that if player 1 follo ws a strate gy from any ver tex in S j such that the set V j = V \ U j − 1 of vertices is ne ver left, then no B ¨ uchi ver tex is ev er reached. If the set V j is left afte r a finite number of steps, then the set U j − 1 is reache d, and by induct i ve hypoth esis U j − 1 ∩ W 1 (Φ) = ∅ , i.e., player 2 can ensure from U j − 1 that the set of B ¨ uchi vertices is visited finitely often. Since the B ¨ uchi objecti ve is independen t of finite prefixes, it follo ws that if V j is left and U j − 1 is reached , then player 2 ensure s that the B ¨ uchi obj ecti ve is not satisfied. It follo ws that S j ∩ W 1 (Φ) = ∅ . L E M M A 3 . 3 . The in ductiv e hypoth esis that U j − 1 ∩ W 1 (Φ) = ∅ and Claim 1 implies that U j ∩ W 1 (Φ) = ∅ . Pr oof. Observ e that U j \ U j − 1 is obtained as a player 2 att ractor to S j , and hence pl ayer 2 can ensur e from U j \ U j − 1 that S j is reached in fi nite number of steps. Since B ¨ uchi objecti ve is independe nt of finite prefixes, by inducti ve hypothes is U j − 1 ∩ W 1 (Φ) = ∅ , and by L emma 3.2 we ha ve that S j ∩ W 1 (Φ) = ∅ , it follows that U j ∩ W 1 (Φ) = ∅ . Hence to complet e the proof we need to establish Claim 1 an d this is achiev ed in the follo wing two lemmata . W e start with the notion of a separat ing cut. Separating cut. W e say a set S of vertic es induces a separati ng cut in a graph G i or G j i if (a) the only edges from S to V \ S come from player -2 vertic es in S , (b) eve ry player -2 verte x in S has an edge to another verte x in S , (c) ev ery player -1 verte x in S is white, and (d) B ∩ S = ∅ . Thus S is a player -1 clo sed set where ev ery player -1 verte x is white and which does not conta in a vert ex in B . L E M M A 3 . 4 . Let G = (( V , E ) , ( V 1 , V 2 )) be a game gr aph w her e ev ery verte x has at least outde gre e 1, and G ′ = (( V , E ′ ) , ( V 1 , V 2 )) be a sub-grap h of G with E ′ ⊆ E . Let Z be a set of blue player -1 and orang e player -2 vertice s of G ′ suc h that all orang e vertices have outde gr ee 0 in G ′ . If S induces a separa ting cut in G ′ , then no verte x of S belongs to Attr 1 ( B ∪ Z , G ) . Pr oof. W e first sho w that ev ery verte x in S ha s an edge to another verte x in S in G ′ . For player -2 vertices this follo ws from conditio n (b) of a separati ng cut. For player -1 vertices this follo ws since they hav e outdeg ree 1 in G , are white in G ′ , and cannot ha ve an edge to a ve rtex in V \ S . Note that S ∩ ( B ∪ Z ) = ∅ since S conta ins no blue vert ex of G i , e ve ry orang e verte x in S has outde gree at least 1 and B ∩ S = ∅ by condition (d) of a separati ng cut. By conditi on (a) for all player -1 vertices in S all out-go ing edges are in S . It follows th at S is a player -1 closed set, and since S ∩ ( B ∪ Z ) = ∅ , the re sult follo ws from Fact 1 . L E M M A 3 . 5 . W e have S j ∩ Attr 1 ( B j , G j ) = ∅ . Pr oof. Let v be a verte x in S j . By construc tion v cannot alt 1 -reach B j ∪ Z j i ∗ in G j i ∗ , where i ∗ was the last valu e of i in the repeat loop of iteration j . W e will sho w that v cannot alt 1 -reach B j in G j . If suf fi ces to show that S j induce s a separating cut in G j . Then w e can simply apply Lemma 3.4 w ith G = G j , G ′ = G j i ∗ , Z = ∅ , and S = S j to pro ve the lemma. 1. Condition (a). By con struc tion no player -1 verte x in S j has an edge to V j \ S j , other wise it would bel ong to the playe r -1 attract or of B j ∪ Z j i ∗ . Since all player -1 vertice s in S j are white in G j i ∗ , the outed ges of the player -1 vertic es in S j are the same in E j i ∗ and in E j . Thus condition (a) of a separatin g cut holds in G j . 2. Condition (b). E ver y player -2 verte x in S j must hav e an edge to an other verte x in S j , oth erwise all its edges would g o to vert ices in V j \ S j and thus it wou ld belong to Attr 1 ( B j ∪ Z j i ∗ , G j i ∗ ) . Since E j i ∗ ⊆ E j , the same holds in G j . Hence condit ion (b) of a separat ing cut holds in G j . 3. Condition (c). All vertices are white in G j . Thus condition (c) holds triv ially . 4. Condition (d). The condition (d), S j ∩ B j = ∅ holds, since otherwise a verte x of S j would belong to B j and, thus, to Att r 1 ( B j ∪ Z j i ∗ , G j i ∗ ) . Thus S j induce s a separating cut in G j . The desired result follo w s. Lemma 3.5 prov es C laim 1 and this completes the correct ness proof, and gi ves the follo w ing lemma. L E M M A 3 . 6 . Let Y ∗ be the outpu t of N E W A L G O . T hen we have Y ∗ = W 1 (Φ) , wher e Φ is the B ¨ uch i objec tive . Running time analys is. W e no w analyz e the runni ng time of the algorit hm. L E M M A 3 . 7 . Let G j i be a game gr aph in iteration j and let Z j i be th e set o f bl ue an d de gre e-0 ora ng e vertices of G j i as defined in iterati on j of the outer loop and i of the inner loop of the algori thm. If S induces a separ ating cut in G j i , then S ⊆ S j . Pr oof. None of the v ertices in S can alt 1 -reach B in G j by Lemma 3.5. By Lemma 3.4 none of the ver tices in S can alt 1 -reach B j ∪ Z j i . Hence we hav e S ⊆ V j \ Attr 1 ( B j ∪ Z j i , G j i ) . Thus S ⊆ S j . Since S j is a complement of a player -2 attracto r it is a player -1 closed set, all vertice s in S j are w hite, and there is n o B ¨ uc hi ve rte x in S j . Hence S j is a separ ating cut. The pre vious lemma sho ws that e very sep aratin g cut S is a subset of S j . It follo ws that S j is the lar gest (under set inclusi on) separatin g cut. L E M M A 3 . 8 . The to tal time spent by N E W A L G O is O ( n 2 ) . Pr oof. W e pre sent the O ( n 2 ) runnin g time analysis and we consider two cases. All other than the last iteratio n of the outer loop. Assume in iteration j the algorith m stops the repeat until loop at value i and this is not the last iteration of the algorith m. Then S j is not empty . N ote that all player -1 vertice s in S j are white, since Z j i contai ns all blue player -1 vertic es of V j and S j = V j \ Attr 1 ( B j ∪ Z j i , G j i ) . Thus, S j induce s a separating cut in G j i . Consider the set S j in G j i − 1 . There are 2 cases to conside r: Case 1: S j contai ns a player -1 ver tex x that is blue in G j i − 1 . Thus x has outdegree at least 2 i − 1 in G j i and none of these edge s go to ve rtices in V j \ S j in G j i . Thus, S j contai ns at least 2 i − 1 ver tices. Case 2: All player -1 vertice s in S j are white in G j i − 1 . Thus, their outedg es in G j i and G j i − 1 are identic al. Note that no priorit y-1 player -2 verti ces in V j \ S j point to v ertice s of S j in G j i . Since E j i − 1 ⊆ E j i it fol lo w s that no prio rity-1 player -2 vertic es in V j \ S j point to v ertice s in S j in G j i − 1 . Consider a player -2 vertex u in S j . Thus there exi sts an edge ( u, v ) ∈ E j i with v ∈ S j . There are two possibi lities. Case 2a: For all playe r -2 vertice s u ∈ S j there ex ists a ver tex v ∈ S j with ( u, v ) ∈ E j i − 1 . But the n S j would be a sepa rating cut in G j i − 1 . By Lemma 3.7 it follo ws that S j would be no n-empty in iteratio n i − 1 and thus the repeat loop would hav e stopped after iterati on i − 1 . This is not the case and thus the condition of Case 2a does not hold. Case 2b: There exists a player 2 verte x u ∈ S j that has an edge ( u, v ) ∈ E j i to a vertex v ∈ S j b ut this edge is n ot cont ained in E j i − 1 . This can on ly happen if u is ora nge in G j i − 1 and v has 2 i − 1 other ined ges in E j i − 1 . Since the edge ( u, v ) where u is a priority-1 player -2 verte x is not in G j i − 1 , all inedge s of v that are in G j i − 1 are from priority-1 player -2 vertices by the fi xed order of inedg es. It follo ws that none of the inedge s of v in G j i − 1 are from V j \ S j and, thus , S j must contain at least 2 i − 1 player -2 vertic es. Thus in either case S j contai ns at least 2 i − 1 ver tices and all these vert ices are deleted. The time spent for all the ex ecutions of the repeat loop in this iteration of the outer loop it the time spent in all graphs G 1 , G 2 , .. ., G i ∗ , which sums to O (2 i · n ) . W e char ge O ( n ) work to each d eleted ver tex . T his accou nts for all b ut the last iteratio n of the outer loop. As the algorit hm deletes at most n ver tices the total time spent ove r the whole algorithm other than the last iterati on is O ( n 2 ) . The last iter ation of th e outer loop. In the last iteration of the outer loop, when no verte x is del eted, the a lgorit hm works on all log n graphs, sp endin g time O ( n · 2 i ) in graph G i . S ince there are log n graphs, the total time is O ( n · 2 · 2 log n ) = O ( n 2 ) . An identical ar gument also sho ws that the time to built all the initial graphs G i is at most O ( n 2 ) . Hence the desired result follo w s. T H E O R E M 3 . 2 . Given a game graph G with n vertices, and an B ¨ uch i objectiv e Φ , algorith m N E W A L G O corr ectly computes the winning set W 1 (Φ) in time O ( n 2 ) . 4 Maximal End-component Decompositio n Algorithm In this section we present an algorit hm for the maximal end-compo nent decomposit ion problem that runs in O ( n 2 ) time. The maximal end-co mponen t probl em i s the core algorithmic p roblem in ver ification of proba bilist ic systems, and the graph theore tic descrip tion of the problem for game graphs is defined belo w . Maximal end-component decomposition. G i ven a game graph G = (( V , E ) , ( V 1 , V 2 )) , an end-compon ent U ⊆ V is a set of vertic es su ch t hat (a) the graph ( U, E ∩ U × U ) is strong ly con nected ; (b) for all u ∈ U ∩ V 2 and all ( u, v ) ∈ E we ha ve v ∈ U ; and (c) either | U | ≥ 2 , or U = { v } and there is a self-loop at v (i.e., ( v , v ) ∈ E ). In other words, an end-co mponent is a player -2 closed set that is strongly connecte d. Note that if U 1 and U 2 are end-co mponen ts with U 1 ∩ U 2 6 = ∅ , then U 1 ∪ U 2 is an en d-compo nent. A maximal end-compo nent (mec) is an end-compone nt that is maximal under set inclusi on. Every verte x of V belong s to at m ost one maximal end- compone nt. T he maximal end-compo nent (mec) decompos ition consist s of all the maximal end-comp onents of V and al l ver tices of V that do not be long to any maximal e nd-comp onent . Maxi mal end-c omponen ts generaliz e strong ly connected components (scc’ s) for directed graphs (with V 2 = ∅ ) and closed recurren t sets for Markov chains (with V 1 = ∅ ). Notations. Giv en a game graph G = (( V , E ) , ( V 1 , V 2 )) , w e will denote by R e achable ( X, G ) the set of vertices that can reac h a ve rtex in X in th e gra ph ( V , E ) . Note that X ⊆ R e achable ( X, G ) . W e maintai n log n graphs G i such that G i = ( V , E i ) and E i contai ns all edges ( u, v ) where o utdeg ( u ) ≤ 2 i . W e denote by G the full graph. W e co lor v ertices v in G i blue if o utdeg ( v ) > 2 i , i.e., Bl i = { v ∈ V | o utdeg ( v ) > 2 i } and all o ther v ertices are colore d white , i.e., Wh i = { v ∈ V | o utd eg ( v ) ≤ 2 i } . Note that G = G log n and thus all vertice s in G log n are white. T hus, none of the outedges of the blue vertices of G i belong to G i , i.e., all blue ver tices hav e outdeg ree 0 in G i . A bottom scc C of a graph is a scc that has no edge leavin g out of C . Ever y graph has a bottom scc and e ve ry bottom scc is a mec. Maximal end-component dec omposition alg orithm. The algori thm consists of tw o ne sted loops , an outer loop with loop counte r j and an inner loop with loop counter i . The algorit hm will iterati vely delete vertices from the graph, and we denote by D j the set of verti ces deleted in iteratio n j . W e w ill denote by G j i the sub-graph of G i at the beg inning of iteration j (as for N E W A L G O ) and the verte x set in iteration j is denoted as V j . T he set Bl j i is the set o f ve rtices in G j i with outde gree greater than 2 i in G j i . Basically the algo rithm is similar to N E W A L G O , and ins tead of se archin g for separatin g cuts, the algor ithm for mec de composi tion searches for bottom scc ’ s. The steps of the algorit hm are as follo ws and we refer the algorithm as N E W M E C A L G O . 1. Let D j be th e set of v ertices deleted in iter ation j . For j := 0 , let D 0 := Attr 2 ( X, G 0 ) , where X is the set of vert ices that are in the bottom scc’ s in the initial graph G . Every bottom scc is an mec and included in the mec decompo sition . 2. Remove the vertices of D j from all log n graphs G j i to create graph G j +1 i ; j := j + 1 . If all vertice s are remov ed, then the w hole algori thm terminates and outpu ts the mec decompositio n. 3. i := 1 ; 4. repeat (a) Compute all the ve rtices in G j i that can reach the blue ver tices using the standa rd linear -time algori thm for reachab ility . (b) Let S j = V j \ R e achable ( Bl j i , G j i ) be the set of v ertices that cannot reach the s et Bl j i blue v ertices in G j i ; i := i + 1 5. until S j is non-e mpty 6. if S j 6 = ∅ , then let D j := Attr 2 ( X, G j ) , where X is the set of vertice s that are in the bottom scc’ s in the sub-gr aph induce d by S j in G j i . Every bottom scc is an mec and includ ed in the mec decomposit ion. Go to Step 2. Basic corr ectness argument. L et us de note G j to be the remain ing ga me graph aft er iteration j . Let S j be the set identified at iteration j , and let the inner iterati on stop at i ∗ . All vertices in S j are white, sinc e S j = V j \ R e achable ( Bl j i ∗ , G j i ∗ ) and Bl j i ∗ ⊆ R e achable ( Bl j i ∗ , G j i ∗ ) . For all v ∈ S j , all outedges from v end in a verte x in S j : otherwise if there is an edge from v to R e achable ( Bl j i ∗ , G j i ∗ ) , then v would hav e been included in R e achable ( Bl j i ∗ , G j i ∗ ) . Hence any bottom scc in the subgr aph induced by S j in G j i ∗ is also a bottom scc of G j . The correctnes s of the identi fication th e bottom scc as an mec and remo val of the attrac tor fo llo ws from the follo wing two lemmata established in [7] (see Lemma 2.1 and L emma 2.2 of [7]). The first lemma belo w establ ishes th at the player -2 attracto r of a m ec and th e player -2 attractor of certain v ertices o f an scc do not b elong to any mec and that it, thus, can be remov ed without affec ting the mec decompositio n of the remaining graph. Hence, the lemma is used to identify vertice s that do not belong to any mec. The second lemma belo w sh o w s under which condit ion an scc is an m ec. T hus, it can be used to id entify ver tices that form a mec. It follo ws tri vially from the seco nd lemma that e very bottom scc is a mec. L E M M A 4 . 1 . ( [ 7 ] ) L et G = (( V , E ) , ( V 1 , V 2 )) be a game grap h, and let ( V , E ) be the graph . 1. Let C be a scc in ( V , E ) . Let U = { v ∈ C ∩ V 2 | O ut ( v ) ∩ ( V \ C ) 6 = ∅} be the player -2 vertices in C with ed ges out of C . L et Z = Attr 2 ( U, G ) ∩ C . Then for a ll n on-tri vial mec’ s X in G we have Z ∩ X = ∅ and for any edg e ( u, v ) with u ∈ X and v ∈ Z , u m ust belo ng to V 1 . 2. Let C be a mec in G . L et Z = Attr 2 ( C, G ) \ C . Then for all non-trivia l mec’ s X with X 6 = C in G we have Z ∩ X = ∅ and for any edge ( u, v ) with u ∈ X and v ∈ Z , u must belong to V 1 . L E M M A 4 . 2 . ( [ 7 ] ) L et G = (( V , E ) , ( V 1 , V 2 )) be a game graph, and let ( V , E ) be the graph . Let C be a scc in ( V , E ) such that for all v ∈ C ∩ V 2 we have O ut ( v ) ⊆ C . Then C is a mec. The correc tness of the algori thm follo ws. L E M M A 4 . 3 . Algo rithm N E W M E C A L G O corr ectly computes the m ec decompo sition of a game graph. Running time analys is. The crucial result of the runn ing time analysis dep ends on the follo wing lemma. It sho ws that in an outer iteratio n j , if the inner iteration stops at iteration i ∗ and X is the set of vertic es identified as botto m scc, then X ∩ B l j i ∗ − 1 is non-empty . L E M M A 4 . 4 . Cons ider an outer itera tion j of the algorithm, and let the inner iterat ion stop at iter ation i ∗ . L et X be hte set of vertices identi fied as bottom scc of the gr aph induced by S in G j i ∗ . Then X ∩ Bl j i ∗ − 1 6 = ∅ . Pr oof. Assume towar ds contr adicti on that there is a bottom scc C in the indu ced subgra ph of S in G j i ∗ such that C ∩ Bl j i ∗ − 1 = ∅ . No w we consider the iterati on i ∗ − 1 and then for e very vertex in C in G j i ∗ − 1 all outedg es end in a verte x in C . Since C do es not co ntain a verte x from Bl j i ∗ − 1 and C has no outgoing edge s, it follo ws that C ⊆ V j \ R e achable ( Bl j i ∗ − 1 , G j i ∗ ) . Since all edges of G j i ∗ − 1 are contai ned in G j i ∗ it follo ws that C ⊆ V j \ R e achable ( Bl j i ∗ − 1 , G j i ∗ − 1 ) . It follo ws that a non-empt yset S j would hav e been identified in iteration i ∗ − 1 , and this contra dicts that the algorithm stops at iteration i ∗ and not in i ∗ − 1 . L E M M A 4 . 5 . The to tal time spent by N E W M E C A L G O is O ( n 2 ) . Pr oof. Assume that for an outer itera tion j , the inne r iter ation sto ps the repeat until loop at v alue i ∗ . By the pre vious lemma, one of the verti ces v in X must hav e belong to B l j i ∗ − 1 and thus it has outde gree at least 2 i ∗ − 1 . Since we identify the bottom scc that contain v it must contain all the endpoin ts of the outedge s from v . Hence X contains at least 2 i ∗ − 1 ver tices. The time spent for all the ex ecutions of the repeat loop in this iteration of the outer loop it the time spent in all graphs G j 1 , G j 2 , ..., G j i ∗ , which sums to O (2 i ∗ · n ) . W e charge O ( n ) to each delete d v ertex. As th e algori thm del etes at most n vertices the total time spent o ver the whole algorithm is O ( n 2 ) . The remov al of all the player -2 attractors ov erall iterations takes O ( m ) = O ( n 2 ) time. Similar to the proof of Lemma 3.8, the time require d to b uilt all the initial graphs G i is at most O ( n 2 ) . The result follo w s. T H E O R E M 4 . 1 . Algor ithm N E W M E C A L G O corr ectly compute s the mec decomposi tion of a game gr aph in O ( n 2 ) time. 5 Decr emental and Incre mental Algorithms In this section we present the decremental and incremental algorithms for computing the winning set in game graphs w ith B ¨ uc hi ob jecti ves. W e w ill show that the pr ogr ess measur e algorithm of [20] works in total time O ( n · m ) for a seque nce of player -1 edge deletio ns (or insertions ), and hence the amortized time per ope ration is O ( n ) . Since B ¨ uchi ob jecti ves genera lize reachabi lity objecti ve s, and alterna ting game graph s generaliz e directed graphs , our algo rithm is a generali zation of the E ven- Shiloach algo rithm [17] for decremental reach ability in graphs . Howe ver our proof is ver y dif ferent, based on a fix-p oint ar gument, and is muc h simp ler . W e first presen t the algorit hm for the decr emental case. 5.1 Decr emental algorithm for B ¨ uchi games In this sectio n we presen t the decrement al algorithm, and we consid er only deletion of player -1 edges. Our decr emental algorit hm is based on the notion of progres s measure and we start with the notio n of a progre ss measure and valid prog ress measure. Pr ogr ess measur e. Giv en a ga me grap h with n ver tices, a progre ss measure is a function ρ : V → [ n ] ∪ ⊤ , where [ n ] = { 0 , 1 , 2 , . . . , n } , that assigns to ev ery verte x either a number from 0 to n , or the top element ⊤ . W e will follo w the con vent ions that: (a) for all j ∈ [ n ] we ha ve j < ⊤ ; (b) n + 1 = ⊤ ; (c) ⊤ + 1 = ⊤ ; (d ) ⊤ ≥ ⊤ . Giv en a game graph with a set B of B ¨ uch i vert ices, a pr ogress measure ρ is a valid progress measure if the follo wing conditions hold for all v ∈ V : (i) for v ∈ V 1 ∩ B , we ha ve ρ ( v ) = ⊤ if for all ( v , w ) ∈ E we ha ve ρ ( w ) = ⊤ , and 0 otherwise; (ii) for v ∈ V 2 ∩ B , we hav e ρ ( v ) = ⊤ if there exis ts ( v , w ) ∈ E with ρ ( w ) = ⊤ , and 0 otherwise; (iii) for v ∈ V 1 \ B , we hav e ρ ( v ) = min ( v,w ) ∈ E ρ ( w ) + 1 ; and (iv) for v ∈ V 2 \ B , we hav e ρ ( v ) = max ( v,w ) ∈ E ρ ( w ) + 1 . W e d efine the compa rison o perato rs ≤ , ≥ on progress mea sures with the pointwise comparis on, i.e., for ⊲ ⊳ ∈ {≤ , ≥} and progress measures ρ 1 and ρ 2 , we write ρ 1 ⊲ ⊳ ρ 2 if f for all v ∈ V we hav e ρ 1 ( v ) ⊲ ⊳ ρ 2 ( v ) . Lift oper ation on pr ogr ess measur e. Giv en a game graph G , the function Lift G tak es as input a progre ss measure and returns a progress measure. For all input progres s measures ρ , the output progress measure ρ ′ = Lift G ( ρ ) is defined as fol lo w s: for all v ∈ V , (i) fo r v ∈ V 1 ∩ B , we hav e ρ ′ ( v ) = ⊤ if for all ( v , w ) ∈ E we hav e ρ ( w ) = ⊤ , and 0 otherwise; (ii) for v ∈ V 2 ∩ B , we hav e ρ ′ ( v ) = ⊤ if there exists ( v , w ) ∈ E with ρ ( w ) = ⊤ , and 0 otherwise , (iii) for v ∈ V 1 \ B , w e ha ve ρ ′ ( v ) = min ( v,w ) ∈ E ρ ( w ) + 1 ; and (iv ) for v ∈ V 2 \ B , w e hav e ρ ′ ( v ) = max ( v,w ) ∈ E ρ ( w ) + 1 . L E M M A 5 . 1 . F or al l game graphs G , the func tion Lif t G is monoto nic (if ρ 1 ≤ ρ 2 , then Lift G ( ρ 1 ) ≤ Lift G ( ρ 2 ) ). Pr oof. Conside r progress measures ρ 1 , ρ 2 such that ρ 1 ≤ ρ 2 . For a non-B ¨ uchi ver tex v ∈ ( V \ B ) we hav e Lift G ( ρ 1 )( v ) = ( min ( v,w ) ∈ E ρ 1 ( w ) + 1 ≤ min ( v,w ) ∈ E ρ 2 ( w ) + 1 = Lift G ( ρ 2 )( v ) v ∈ V 1 \ B ; max ( v,w ) ∈ E ρ 1 ( w ) + 1 ≤ max ( v,w ) ∈ E ρ 2 ( w ) + 1 = Lift G ( ρ 2 )( v ) v ∈ V 2 \ B ; where E is the set of ed ges in G . It follo ws that for all v ∈ ( V \ B ) we ha ve Lif t G ( ρ 1 )( v ) ≤ Lift G ( ρ 2 )( v ) . Note that for ve rtices in B , progre ss measures are either 0 or ⊤ . For v ∈ B we hav e the follo wing cases: (i) v ∈ V 1 ∩ B : if Lift G ( ρ 1 )( v ) = ⊤ , then for all ( v , w ) ∈ E we hav e ρ 1 ( w ) = ⊤ , and hence for all ( v , w ) ∈ E we ha ve ρ 2 ( w ) = ⊤ ; thus Lift G ( ρ 2 )( v ) = ⊤ ; and (i) v ∈ V 2 ∩ B : if Lift G ( ρ 1 )( v ) = ⊤ , then the re exists ( v , w ) ∈ E w ith ρ 1 ( w ) = ⊤ , and hence we hav e ρ 2 ( w ) = ⊤ ; thus Lift G ( ρ 2 )( v ) = ⊤ . It follo ws that we hav e Lift G ( ρ 1 ) ≤ Lift G ( ρ 2 ) . T he desir ed result follo ws. Since Lift G is a monotonic function on a finite lattice, by the T arski-Knaster Theorem [22] it has a lea st fix-point . Give n a player -1 attractor Attr 1 ( U, G ) , the minimal alternatin g distan ce of a vertex v ∈ Attr 1 ( U, G ) is the ran k r ank ( v ) of the v ertex v (in other wor ds it is the alternating sho rtest dis tance to U where pl ayer -1 minimizes the distan ce and player -2 maximizes the distance to U ). The res ult of [20] est ablish ed that fo r all game graphs G , (i) there is a unique least fix-point of Lift G , (ii) the least fix-point is a valid progress m easure , (iii) in the winning set the progress measure equals the m inimal alternati ng distance to the set of B ¨ uchi vertice s in the winning set and all B ¨ uchi vertices in the w inning set hav e progress measure 0, and (i v) all vertic es in the complemen t of the w inning set a re assigned ⊤ . The result o f [20] is for the mor e general c ase of p arity objec ti ves, and the special izatio n to B ¨ uchi obje cti ves yields the above pro pertie s. T H E O R E M 5 . 1 . ( [ 2 0 ] ) F or all game gra phs G , let ρ ∗ be the least fix-point of Lift G , and let || ρ ∗ || = { v ∈ V | ρ ( v ) ∈ [ n ] } denote the set of vertic es that ar e not a ssign ed the top el ement. Then || ρ ∗ || = W 1 (Φ) , wher e Φ is th e B ¨ uch i objec tive . Decr emental algorithm. Our algorithm initial ly computes the least fix-point progress measure ρ ∗ of the graph and then maintains it after each edge deletion by repeate dly apply ing the lift operator to the fix-point ρ ∗ stored befor e the edge d eletion . T o prov e the correctness we will show that the fix-point ob tained b y repeatedl y apply ing the lift operator on the pre viou s least fix-point con ver ges to the least fix-point of the new game graph . The algori thm maintains the fol lo w ing data stru cture : (i) For each vertex x ∈ V 1 ∩ B it k eeps a lis t of v ertices w such that ( x, w ) ∈ E and ρ ∗ ( w ) 6 = ⊤ and (ii) for each vert ex x ∈ V 1 \ B a list of v ertices w such that ( x, w ) ∈ E and ρ ∗ ( x ) = ρ ∗ ( w ) + 1 . (iii) Ev ery edg e ( x, w ) has a p ointer to its loc ation in the l ist of x if it is st ored in such a list. W e ne xt describ e the algorith m in detail. Computatio n of the initial ρ ∗ . U se the static B ¨ uchi algorithm from the pre vious section to compute the playe r -1 and player -2 winning sets and assign ⊤ to all v ertice s in the player -2 winning set . Use the backward search algori thm [2, 19] to de termine the ra nk of ev ery verte x in the pl ayer -1 winning set and set its initial progre ss measure equa l to its rank . Then we compute for each verte x of V 1 its list. Deletion of the edge ( u, v ) . Maintai n a queue of vertic es to be processed to update the progres s measure until the least fix-point is reached such that a vertex of V 2 is only added to the queue when its progre ss measure has increa sed. Initiall y , enqueue u . Then iterati vely process and dequeue the vertic es from the queue. Case 1: A verte x x of V 1 is deque ued. Check whether gi ve n the current prog ress m easure , the progress measure of x needs to be increase d to satisfy the lift operation for x . T o do this we first check whether the list of x is empty . If it is not empty , nothing needs to be done. If it is empty , all remaining outedges of x are checke d to compute the new progre ss measure value of x and the new list of x . Then all inedges ( u, x ) of x are processe d as follo ws: If u is a play er -1 non-B ¨ u chi verte x ( u ∈ V 1 \ B ), then it is enqu eued (if it is not al ready in the que ue) and x is remov ed from the list of u if it was there. If u is a player -2 non-B ¨ uchi verte x ( u ∈ V 2 \ B ), then check whether the chang e in the progre ss measure v alue of x also increases the progress measure v alue of u . If it does, then u is enqu eued (if it is not already in the queue ), otherwis e u is not enqueued. If u is a player -1 B ¨ uchi verte x ( u ∈ V 1 ∩ B ), then (i ) if the progre ss measure of x is not ⊤ , then do no thing; (ii) e lse remo ve x from th e list o f u , and if the list of u is empty , assign progress measure ⊤ to u and u is enque ued (if it is not already in the queue) . If u is a playe r -2 B ¨ uchi ve rtex ( u ∈ V 2 ∩ B ), then (i) if the progress measure of x is not ⊤ , then do nothing; (ii) else assign progre ss measure ⊤ to u and u is enque ued (if it is not already in the queue). Case 2: A verte x x of V 2 is dequ eued. In this case the prog ress measure of x has increased and it has alread y been upda ted. T hus all what remain s is to proces s all inedges ( u, x ) of x as follo ws: If u is a player -1 non-B ¨ uchi ver tex , then it is enqueued (if it is no t alr eady in the que ue) a nd x is remo ved fro m th e lis t of u if i t was there. If u is a player -2 non-B ¨ uchi vertex , then check whether the change in the progress measure value of x also increase s the progress measu re v alue of u . If it does, t hen u is en queue d (if it is not already in the q ueue) , otherwise u is not enque ued. If u is a player -1 B ¨ uchi v ertex, then (i) if t he prog ress measure of x is not ⊤ , the n do nothin g; (ii) else remov e x from the list of u , and if the list of u is empty , assign progress measure ⊤ to u and u is enqueued (if it is no t alread y in the queue). If u is a player -2 B ¨ uchi ver tex , then (i) if th e progr ess measure of x is not ⊤ , t hen do nothin g; (ii) else assign progre ss measure ⊤ to u and u is enqueued (if it is not already in the queue). This algorithm is a generalizati on of the Even-Shil oach algorithm [17] for maintainin g the connect ed compone nt (o r more precisely the breadth- first-sear ch tree) of a v ertex b in a n undirec ted gra ph. Assume B = { b } and that V = V 1 . Then the progre ss measure v alue of a vert ex v is exactly v ’ s lev el in the breadth -first search tree rooted at b (or equi valen tly its shortest path distance to b ). Apply ing the lift operator to a verte x v is exactly the same as checkin g whether v has still an edge to an edge at le vel level ( v ) − 1 and if not, increasing the lev el of v by 1. Corr ectness. Let G be a game graph, and let ρ ∗ be the least fix-point of Lift G . Let G = G \ { e } , where e ∈ E ∩ V 1 × V , be the game graph obtained by deleting a player -1 edge e . Let ρ ∗ be the least fix-point of G . Let ρ ∗ new be the ne w fi x-point obtain ed by itera ting Lif t G on ρ ∗ . W e will sho w that ρ ∗ = ρ ∗ new . L E M M A 5 . 2 . W e have ρ ∗ ≤ ρ ∗ new . Pr oof. Let ρ 0 be th e progre ss measure that assing s 0 to all v ertices, i.e., the least prog ress measure. Clearly , ρ 0 ≤ ρ ∗ . Let us deno te by ( Lift G ) i the resu lt of app lying the lift op erator i -times on G , for so me i ∈ N . From a simple applic ation of Lemma 5.1 it fol lo w s that ( Lift G ) i is monotonic . Hence w e ha ve ( Lift G ) i ( ρ 0 ) ≤ ( Lift G ) i ( ρ ∗ ) . Since ρ ∗ = ( Lift G ) j ( ρ 0 ) for some j , and ρ ∗ new ≥ ( Lift G ) i ( ρ ∗ ) for all i (in particular for the j for which the least fix-point is obtai ned from ρ 0 ), it follo ws that ρ ∗ ≤ ρ ∗ new . L E M M A 5 . 3 . W e have ρ ∗ new ≤ ρ ∗ . Pr oof. Observ e that the graph G is obtaine d by deleting an edge for pla yer -1, and hence the winn ing set for player 1 can only decrease and th e minimal alternating distance to the B ¨ uchi set in the winning set can only increa se. In other words, we hav e ρ ∗ ≤ ρ ∗ , i.e., the least fix-point of the graph G is smaller than the least fix- point of G . S ince ρ ∗ new = ( Lift G ) i ( ρ ∗ ) , for some i , we ha ve ρ ∗ new = ( Lift G ) i ( ρ ∗ ) ≤ ( Lift G ) i ( ρ ∗ ) = ρ ∗ , where the first inequality i s a co nsequ ence of Lemma 5.1 tha t ( Lift G ) i is monotonic, and the last in equali ty is a conse quenc e of the fac t that ρ ∗ is a fix-point. Hence the desired result follo ws. The correctnes s follows from Lemm a 5.2 and L emma 5.3 (that ρ ∗ new = ρ ∗ ) and the fac t that the algorithm implements the iteration of the lift operator on vertic es one by one to compute the fix-point that is obtained by repeat edly applying the lift operat or on the least fix-point of the prev ious game graph. Running time. The deletion s of player -1 edges only decrea ses the winning set, and once a set is remove d from the winning set (i.e., assign ed va lue ⊤ in the pr ogress measure algorith m), then they are nev er wo rke d up on. Upon termination , let W be the winning set, and let ρ be the least fix-point in the end. The computation of the initial least fix-poin t is done in time O ( n 2 ) . In the decremental algorithm we check for each dequeued player -1 ve rtex u whether its progress measure increa ses in consta nt time. If it does not increa se no further work is done for u . The constan t amount of work is char ged to the edge deletion if an outedge of u was deleted. If no outedge of u was deleted then the progres s measure of a verte x w with ( u, w ) ∈ E must hav e inc reased and we charg e the work to w . If the progress me asure of u increases we spend time O ( | I n ( u ) | + | O ut ( u ) | ) to determin e the new progress measure of u , compute its ne w list, and proce ss all its inedges, and the work is char ged to u . A player -2 vertex u is only enqueue d when its progre ss measure has increased. When it is dequeued w e spend time O ( | I n ( u ) | ) to process all its inedges, and char ge it to u . The number of times the progre ss measure can increase for a verte x is at most n + 1 (as once it is n + 1 it is assigned ⊤ ). For a verte x v , let Num ( v ) = ρ ( v ) , if ρ ( v ) 6 = ⊤ , and n + 1 otherwise. Hence the total work do ne by the algorith m is O ( X v ∈ V Num ( v ) · | I n ( v ) | ) + O ( X v ∈ V Num ( v ) · | O ut ( v ) | ) = O ( n · m ) . T H E O R E M 5 . 2 . Given an initi al game graph with n verti ces and m edges , the winnin g set partitions can be maintain ed under the dele tion of O ( m ) edges ( u, v ) with u ∈ V 1 in total time O ( n · m ) . 5.2 Incr emental algorithm for B ¨ uchi games W e now presen t the detail s of the incremental algor ithm for B ¨ uchi games, where we consider i nserti on o f player -1 edg es. The algorithm is almost identi cal to the decrement al algori thm and based on the dual progress m easure for player 2. W e start with the definition of a valid progress measure for playe r 2. V alid pr ogr ess measur e for player 2. Giv en a game graph with a set B of B ¨ uchi vertices, let C = V \ B be the set o f coB ¨ uchi vert ices. A pro gress measur e ρ is a valid progress measure fo r pla yer 2 i f the f ollo wing conditions hold for all v ∈ V : ρ ( v ) ≥ min ( v,w ) ∈ E ρ ( w ) v ∈ V 2 ∩ C ; min ( v,w ) ∈ E ρ ( w ) + 1 v ∈ V 2 ∩ B ; max ( v,w ) ∈ E ρ ( w ) v ∈ V 1 ∩ C ; max ( v,w ) ∈ E ρ ( w ) + 1 v ∈ V 1 ∩ B . W e define the compari son operators ≤ , ≥ on progress measures with the pointwise comparison . Lift oper ation on pr og r ess measur e. Giv en a game grap h G , the functi on coLift G , lik e the Lift G functi on, takes a s input a progre ss measure and returns a progre ss measure. For all input progres s measures ρ , the output progress measure ρ ′ = coLift G ( ρ ) is defined as follo ws: for all v ∈ V , ρ ′ ( v ) = min ( v,w ) ∈ E ρ ( w ) v ∈ V 2 ∩ C ; min ( v,w ) ∈ E ρ ( w ) + 1 v ∈ V 2 ∩ B ; max ( v,w ) ∈ E ρ ( w ) v ∈ V 1 ∩ C ; max ( v,w ) ∈ E ρ ( w ) + 1 v ∈ V 1 ∩ B . L E M M A 5 . 4 . F or al l game graphs G , the func tion coLift G is monotonic . Pr oof. Conside r progress measures ρ 1 , ρ 2 such that ρ 1 ≤ ρ 2 . For a ver tex v we ha ve coLift G ( ρ 1 )( v ) = min ( v,w ) ∈ E ρ 1 ( w ) ≤ min ( v,w ) ∈ E ρ 2 ( w ) = coLift G ( ρ 2 )( v ) v ∈ V 2 ∩ C ; min ( v,w ) ∈ E ρ 1 ( w ) + 1 ≤ min ( v,w ) ∈ E ρ 2 ( w ) + 1 = coLift G ( ρ 2 )( v ) v ∈ V 2 ∩ B ; max ( v,w ) ∈ E ρ 1 ( w ) ≤ max ( v,w ) ∈ E ρ 2 ( w ) = coLift G ( ρ 2 )( v ) v ∈ V 1 ∩ C ; max ( v,w ) ∈ E ρ 1 ( w ) + 1 ≤ max ( v,w ) ∈ E ρ 2 ( w ) + 1 = coLift G ( ρ 2 )( v ) v ∈ V 1 ∩ B ; where E is the set of edges in G . It follo ws that coLift G ( ρ 1 ) ≤ coLift G ( ρ 2 ) . T he desir ed result follo ws. Since coLift G is a monotonic function on a finite lattice , by T arski-Knast er T heorem [22] it has a least fi x- point. Before we procee d to t he chara cteriz ation, we presen t a definitio n: for a vertex v ∈ W 2 (Ψ) , whe re Ψ is the coB ¨ uchi objecti ve coBuc hi ( C ) , let ma xvisit ( v ) = min π ∈ Π max σ ∈ Σ |{ i | ω ( v , σ, π ) = h v 0 , v 1 , v 2 , . . . i , v i ∈ B }| denote the maximum number of visits to B ¨ uchi verti ces. Since v ∈ W 2 (Ψ) , once a winning strate gy for player -2 is fi xed , there cannot be a cycle w ith a B ¨ uchi verte x, and hence maxvisi t ( v ) ≤ n . The result of [20] establi shed that for al l game g raphs G , (i ) t here is a uni que least fix-poin t of coLift G , (ii ) the least fix-poi nt is a v alid progress measure, (iii) for vertices v in the winning set for player 2 the progres s measure equals ma xvisit ( v ) , and (iv) all ver tices in the winning set for player 1 are assigned the top element ⊤ . The result of [20] is for the m ore genera l case of parit y objecti ves, and the specializa tion to coB ¨ uchi objec ti ves yields the abov e properti es. T H E O R E M 5 . 3 . ( [ 2 0 ] ) F or all game graphs G , let ρ ∗ be the least fix-po int of coLift G , and let || ρ ∗ || = { v ∈ V | ρ ( v ) ∈ [ n ] } denote the set of vertice s that ar e not assign ed the top element. T hen || ρ ∗ || = W 2 (Ψ) , w her e Ψ is the coB ¨ uch i objective . Incr emental algorit hm. Our algorit hm ini tially co mputes th e least fi x-point p rogre ss measur e ρ ∗ of coLift of the graph and then main tains it after each edge in sertio n by repea tedly ap plyin g the lift operato r coLift to the fi x-poin t ρ ∗ stored from befor e the edge insertion. T o prove the correctnes s we will sho w that the fix-poin t obtain ed by repeat edly app lying the lift op erato r on the pre vious least fix-point con ver ges to the least fix-point of the new game graph. The algorithm maintains the follo w ing data structure : (i) For ea ch verte x x ∈ V 2 ∩ C it keeps a list of vertice s w such that ( x, w ) ∈ E and ρ ∗ ( x ) = ρ ∗ ( w ) and (ii) for each verte x x ∈ V 2 ∩ B a list of ver tices w such that ( x, w ) ∈ E and ρ ∗ ( x ) = ρ ∗ ( w ) + 1 . (iii) Every edg e ( x, w ) has a pointe r to its locatio n in the list of x if it is stored in such a list. W e next describ e the algorith m in detail. W e first describe the insertio n of an edge as the initial fix-point compu tation is similar . Insert ion of the edge ( u, v ) . Maintain a queue of vertices to be processed to update the progres s m easure until the least fix-point is reached such that a vertex of V 1 is only added to the queue when its progre ss measure has increa sed. Initiall y , enqueue u . Then iterati vely process and dequeue the vertic es from the queue. Case 1: A verte x x of V 2 is deque ued. Check whether gi ve n the current prog ress m easure , the progress measure of x needs to be increase d to satisfy the lift operation for x . T o do this we first check whether the list of x is empty . If it is not empty , nothing needs to be done. If it is empty , all remaining outedges of x are checke d to compute the new progre ss measure value of x and the new list of x . Then all inedges ( u, x ) of x are processe d as follo ws: If u is a player -2 vert ex it is enqueu ed (if it is not already in the queue) and x is remov ed from the list of u if it was there. If u is a player -1 vertex then check whether the change in the progress m easure valu e of x also increas es the progress measure val ue of u . If it does, then u is enque ued (if it is not already in the queue), otherwis e u is not enqu eued. Case 2: A verte x x of V 1 is dequ eued. In this case the prog ress measure of x has increased and it has alread y been upda ted. Thus all what remai ns is to process all inedges ( u, x ) of x as follo ws: If u is a player -2 verte x it is enque ued (if it is not already in the queue) and x is remov ed from the list of u if it was there. If u is a player -1 ver tex then ch eck whether th e change in the progress m easure v alue of x also increases the progress measur e v alue of u . If it does, then u is enqueued (if it is not already in the queue) , otherwise u is not enque ued. Computatio n of the ini tial ρ ∗ . The computation of the initial ρ ∗ is simil ar to th e incr emental algorith m. W e initial ize the initial progress measure as 0 for all vertices, then enqueu e the set of B ¨ uchi vertic es, and proceed as the incr emental algorithm until a fix-point is reached . As we start with the all 0 progress m easure and repe atedly apply the li ft opera tor we are guarante ed to reach the least fix-po int. T hen we co mpute for each v ertex v ∈ V 2 its list. Corr ectness. Let G be a game grap h, and let ρ ∗ be the least fix-point of coLift G . Let G = G ∪ { e } , where e ∈ E ∩ V 1 × V , be the game graph obtained by inserti ng a player -1 edge e . Let ρ ∗ be the least fix-point of G . Let ρ ∗ new be the ne w fi x-point obtain ed by itera ting coLift G on ρ ∗ . W e will sho w that ρ ∗ = ρ ∗ new . L E M M A 5 . 5 . W e have ρ ∗ ≤ ρ ∗ new . Pr oof. Let ρ 0 be the progr ess measur e tha t assi ngs 0 to al l vertices, i.e., the least prog ress measu re. Clearly , ρ 0 ≤ ρ ∗ . Let us denote by ( coLift G ) i the result of applyin g the lift operato r i -times on G , for some i ∈ N . From a si mple applic ation of Lemma 5.4 it follo ws that ( coLift G ) i is monoton ic. Hence we hav e ( coLift G ) i ( ρ 0 ) ≤ ( coLift G ) i ( ρ ∗ ) . Sinc e ρ ∗ = ( coLift G ) j ( ρ 0 ) for some j , and ρ ∗ new ≥ ( coLift G ) i ( ρ ∗ ) for all i (in particu lar for the j for which the least fix-point is obtaine d from ρ 0 ), it follo ws that ρ ∗ ≤ ρ ∗ new . L E M M A 5 . 6 . W e have ρ ∗ new ≤ ρ ∗ . Pr oof. Observ e that the graph G is ob tained by inse rting an edge for player -1, and hen ce the winnin g set for player 2 can only decr ease and maxvisit ( v ) can onl y increa se for ve rtices in the win ning se t for p layer 2. In other words , we hav e ρ ∗ ≤ ρ ∗ , i.e., the least fix-point of the graph G is smaller than the least fi x-poin t of G . Since ρ ∗ new = ( coLift G ) i ( ρ ∗ ) , for some i , we ha ve ρ ∗ new = ( coLift G ) i ( ρ ∗ ) ≤ ( coLift G ) i ( ρ ∗ ) = ρ ∗ , where the first inequality is a conseq uence of L emma 5.4 that ( coLift G ) i is monotonic, and the last inequality is a conse quenc e of the fact that ρ ∗ is a fix-poin t. Hence the desired result follo ws. L E M M A 5 . 7 . W e have ρ ∗ new = ρ ∗ . Corr ectness. The correct ness follo ws from Lemma 5.7 and the fact that the algorithm implements the iteratio n of the lif t operat or on vertic es one by on e to comput e the fix-point tha t is obtained by repe atedly apply ing the lift operat or on the least fi x-poin t of the pre vious game graph. Running time. The inserti ons of player -1 edges only decrea ses the winning set for player 2, and once a set is remov ed from the w inning set (i.e., assig ned v alue ⊤ in the progress m easure algorithm), then the y are nev er work ed upon . Upon terminati on, let W be the winning set, and let ρ be the least fix-poi nt in the end. In the incremen tal algorith m w e check for each dequeued player -2 ver tex u whether its progress measure increas es in consta nt time. If it does not increas e no furthe r work is done for u . Since u is proces sed, the progress m easure of a vertex w with ( u, w ) ∈ E m ust hav e increase d and we char ge the work to w . If the progress measure of u increa ses, then we spend time O ( | I n ( u ) | + | O ut ( u ) | ) to determine the ne w progress measure of u , compute its ne w list, and process all its inedges, and char ge the work to u . A player -1 vert ex u is only enque ued when its progre ss measure has increased, or an edge is inserte d at u . If an edge was inserted , the work is char ged to the inserte d edge. When it is dequeue d we spend time O ( | I n ( u ) | ) to process all its inedges, and char ge it to u . The number of times th e progr ess measure can increase for a v ertex is at mos t n + 1 (as once it is n + 1 it is assign ed ⊤ ). For a vertex v , let Num ( v ) = ρ ( v ) , if ρ ( v ) 6 = ⊤ , and n + 1 otherwise . Hence the total work done by the algori thm is O ( X v ∈ V Num ( v ) · | I n ( v ) | ) + O ( X v ∈ V Num ( v ) · | O ut ( v ) | ) = O ( n · m ) . An ar gument similar to the abov e also establ ishes that the init ial least fi x-point is comput ed in time O ( n · m ) . T H E O R E M 5 . 4 . Given an initi al game graph with n verti ces and m edges , the winnin g set partitions can be maintain ed under the inse rtion of O ( m ) edg es ( u, v ) with u ∈ V 1 in total time O ( n · m ) . Acknowledgements. The research was supporte d by A ustrian Science F und (FWF) Grant No P 23499-N23 on Modern Graph Algorithmic T echniques in Formal V erification, ERC Start grant (279307: G raph Games), and Microsof t faculty fello ws award . Refer ences [1] R. Alur , T .A. Henzinger, an d O. Kupfer man. Altern ating-time tem poral logic. Journal of the A CM , 49:67 2–71 3, 2002 . [2] C. Beeri. On the memb ership problem for f unctiona l and multiv a lued depe ndencies in relatio nal databases. ACM T rans. on Data base Systems , 5:241–259 , 1980. [3] J.R. B ¨ uchi. W ea k second -order arith metic and finite au tomata. Zeitschrift f ¨ ur mathematische Logik und Grun dlagen der Mathematik , 6:66–92 , 1960 . [4] J.R. B ¨ uch i. O n a decision method in restricted second-o rder ar ithmetic. In E. Nagel, P . Suppes, and A. T arski, editors, Pr oceedin gs of the F irst International Congr ess on Lo gic, M ethodology , and Philosophy of Science 1960 , pages 1–11. Stanford Uni versity Press , 1962 . [5] J.R. B ¨ uchi and L.H. La ndweber . Solvin g sequ ential cond itions by finite-state strategies. T ransactions of the AMS , 138:29 5–31 1, 196 9. [6] A. K. Chand ra, D. K ozen, and L. J. Stockmeyer . Altern ation. J . A CM , 28(1):1 14–13 3, 19 81. [7] K. Chatterje e an d M. Henzing er . Faster and dyn amic algo rithms for maxim al en d-com ponen t decompo sition an d related graph problems in probabilistic verification. In SODA ’11 . SIAM, 2011 . [8] K. Chatter jee, T .A. Henzinge r , an d N. Piterman . Algorithms fo r B ¨ uchi games. In Games in Design and V erification (GD V) , 2006. [9] K. Chatterjee, M. Jurdzi ´ n ski, and T .A. Henzinge r . Simple stochastic parity games. In CSL ’03 , v o lume 2803 of LNCS , pages 100– 113. S pringer, 2003. [10] K. Chatterjee, M. Jurdzi ´ nski, and T .A. Henzinger . Quantitative stochastic parity games. In SOD A ’0 4 , pages 121– 130. SIAM, 2004. [11] A. Churc h. Logic, arithm etic, and auto mata. In Pr oceed ings of the Interna tional Congr ess o f Mathe maticians , pages 23–35 . Institut Mittag-Leffler , 1962. [12] A. Condon . The com plexity of stochastic games. I nformation and Computation , 96(2):203–2 24, 1 992. [13] C. Courcou betis and M. Y annak akis. The complexity of pro babilistic verification. Journal of the ACM , 42 (4):85 7– 907, 1995. [14] L. de Alfaro and T .A. Henzinge r . Inter face automata. In FSE’ 01 , pages 109–120 . A CM Press, 2001 . [15] D.L. Dill. T race Theory for A utomatic Hierar chical V erifica tion of Speed-ind epende nt Circuits . The MIT Press, 1989. [16] E.A. Emerson and C. Jutla. Tree automa ta, mu-calcu lus and determinacy . In FOCS’ 91 , pages 368–377 . IEEE, 1991. [17] S. Even and Y . Sh iloach. An on-line edge-deletion problem . J. A CM , 28(1 ):1–4, 1981. [18] M. R. Henzinger, V . King, and T . W arnow . Constructing a tree fr om h omeom orphic subtrees, with a pplications to computatio nal e volutionary biology . Algorithmica , 24(1 ):1–13 , 1 999. [19] N. I mmerma n. Number of qu antifiers is better than numb er of tape cells. Journal of Compute r and S ystem Scien ces , 22:384 –406 , 1 981. [20] M. Jurd zi ´ nski. Small pro gress measures for solvin g parity games. In ST ACS’00 , pa ges 290 –301. LNCS 1770, Springer, 2000. [21] M. Jurdzi ´ nski, O. Kupf erman, and T . A. Hen zinger . T rading probab ility for fairn ess. In CSL: Computer Science Logic , Lecture Notes in Computer Science 2471, pages 292–305 . Springer, 2002. [22] A. Kechris. Classical Descriptive Set Theory . Springe r , 1995. [23] O. Kupfer man and M.Y . V ardi. From linear time to br anching time. ACM T ransactio ns on Computatio nal Logic , 6(2):2 73–29 4, 20 05. [24] A. Mahanti and A. Bagchi. AND/OR grap h heuristic search metho ds. JA CM , 32(1 ):28–5 1, 1985. [25] R. McNaug hton. Infinite games played on finite graph s. Ann als of Pur e and Applied Logic , 65:149– 184, 1993. [26] A. Pnueli and R. Rosner . On the synthesis of a reactive module. In POPL ’ 89 , pages 179–190 . A CM Press, 19 89. [27] P .J. R amadge and W .M. W onham. Superv isory co ntrol of a class o f discrete-event pr ocesses. SIAM J ournal of Contr ol and Optimization , 25(1):2 06–23 0, 19 87. [28] W . Thomas. La nguag es, au tomata, and logic. I n G. Rozenberg and A. Salomaa, editors, Handb ook of F ormal Languages , v olu me 3, Be yond W ords, chapter 7, pages 389– 455. Springer , 1997. [29] M.Y . V ard i. Automata-theore tic model checking revisited. In P r oc. of V erification, Mod el Ch ecking, an d Ab stract Interpr etation , v o lume LNCS 4349, pages 137–150 . S pringer, 2007. [30] M.Y . V ardi. The B ¨ uchi complementation saga. In Pr oc. of Symp. on Theor etica l Aspects of Computer Science , volume LNCS 4393, pages 12–22 . Springer, 2007. [31] W . Zielonka. Infinite games on finitely colou red graphs with application s to automata on infinite trees. I n Theor etical Computer Science , volume 200(1-2), pages 135–183, 1998.
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment