Algorithms for B"uchi Games
The classical algorithm for solving B\"uchi games requires time $O(n\cdot m)$ for game graphs with $n$ states and $m$ edges. For game graphs with constant outdegree, the best known algorithm has running time $O(n^2/\log n)$. We present two new algori…
Authors: Krishnendu Chatterjee, Thomas A. Henzinger, Nir Piterman
Algorithms for B ¨ uc hi Games ⋆ Krishnendu Chatterjee 1 , Thomas A. Henzinger 1 , 2 , and Nir Piterman 2 1 Universit y of Calif ornia, Berkeley , USA 2 EPFL, Switzerland c krish@eecs .berkeley.edu, { tah,Nir. Piterman } @epfl. ch Abstract. The classical algorithm for solving B¨ uchi games req u ires time O ( n · m ) for game graphs with n states and m edges. F or game graphs with constan t outdegree, the best known algorithm has run ning time O ( n 2 / l og n ). W e present tw o new algorithms for B ¨ uc hi games. First, w e giv e an algori thm that performs at most O ( m ) more w ork than the classica l algorithm, but runs in time O ( n ) on infinitely m any graphs of constant out degree on which the classical algorithm requires time O ( n 2 ). Second, we giv e an algo rithm with running time O ( n · m · log δ ( n ) / log n ), where 1 ≤ δ ( n ) ≤ n is the outdegree of the game graph. Note that this algorithm p erforms asymptotically better than the classical alg orithm if δ ( n ) = O (log n ). 1 In tro duction The algo rithmic complexity of solving B ¨ uchi ga mes is one of the more in triguing que s tions in graph algorithms. The input of the B ¨ uc hi game problem consists of a directed g raph whose states S are partitioned into play er 1 states a nd player 2 states, and a set B ⊆ S of B ¨ uchi sta tes . In each play er 1 state, the first play er c ho oses an outgo ing edge, and ea c h player 2 state, the second player chooses an o utg oing edge. The question is if, from a given star t state, pla yer 1 has a strateg y to visit a state in B infinitely often. The class ical algo r ithm for so lving B ¨ uchi ga mes has time co mplexit y O ( n · m ), where n is the nu mber of states a nd m is the num b er o f edges . The clas sical alg orithm pro ceeds in a se emingly naive fashio n: firs t it computes the set W 1 of states fr om which play er 1 has a strategy to visit B onc e , which r equires time O ( m ); then it computes the set of states W 1 such that player 2 has a stra tegy to visit S \ W 1 once. The set W 1 is removed from the game gra ph and the algo rithm iterates ov er the reduce d game gr a ph unless W 1 is empty fo r the current game gr aph. The algo - rithm co n verges in at most n iteratio ns, is the a nsw er to the B ¨ uc hi ga me problem. This algorithm seemingly p erforms unnecessa rily repetitive work, y et no a symptotically faster algor ithm is known. In [1], w e gav e a subquadr atic algorithm for the s p ecial case of graphs with constant outdegree. In this sp ecial case m = O ( n ), and th us the class ical a lg orithm p erforms in time O ( n 2 ). W e gav e an algorithm with running time O ( n 2 / log n ). While the classic a l algor ithm c o mputes each set W 1 by backw ard s earc h of the graph, our algorithm alternated backw ard se a rc hes with bo unded amounts of forward searches. In this pap er, we pr esen t t wo new algor ithms for B¨ uchi games. While they fall short of the ultimate goal of a b etter than O ( n · m ) a lgorithm, they present pro gress in that direction. First, in Section 3 we g iv e a n algo rithm that perfor ms at most O ( m ) more work than the classical algorithm. How ever, there exist families of g ame graphs of outdegree 2 on which o ur algo rithm p erforms in time O ( n ), while the classical algorithm requires time Ω ( n 2 ). Also there exist families of game graphs of O ( n log n ) states with outdegr ee at mos t 2 on which b oth the classical a nd the algorithm of [1] requir es O ( n 2 log n ) time, wher e as our a lgorithm re quires O ( n lo g n ) time. How ever, there ⋆ This researc h w as supp orted in part by the AFOSR MURI grant F49620-00 -1-0327 and the NSF ITR gran t CCR-0225610 and the SNSF und er the Ind o-Swiss Join t Researc h Programme. exist game g raphs where our algor ithm requir es O ( n · m ) time in the worst case. Our algo rithm per forms several backw ard searches, but instead of backw ard search from B it per forms backw ard search from a subset of S \ B that are ca ndidates to b e in S \ W 1 . Second, in Section 4 we g iv e an algor ithm with running time O ( n · m · log δ ( n ) / log n ), where 1 ≤ δ ( n ) ≤ n is the outdegree of the g raph. If δ ( n ) = O (1), then this algorithm per forms asymptotically like the algorithm of [1]; indeed, the new algor ithm is based on the algorithm from [1 ]. The forward search of the algorithm of [1] was very naive; w e dev elop a more r efined forward search whic h saves rep etitiv e work o f the forw ard search of the algo rithm o f [1 ] and th us obtain the generalization of the algo rithm o f [1] to g eneral game gr aphs. I f δ ( n ) = O (lo g n ), then our algo rithm p erforms better than the class ical algo rithm; it is to our knowledge the first algorithm that improv es on the classical algorithm in this ca se. 2 Definitions W e conside r turn-based de ter ministic ga mes pla yed b y t wo-play ers with B ¨ uchi and c omplemen tary coB ¨ uch i ob jectives for the play ers, res pectively . W e define game g raphs, plays, strategies, ob jectiv es and notion of winning b elow. Game graphs. A game gr aph G = (( S, E ) , ( S 1 , S 2 )) consis ts of a dir ected g raph ( S, E ) with a finite state space S and a set E of edges , and a partition ( S 1 , S 2 ) of the state space S into tw o sets . The sta tes in S 1 are play er 1 states, a nd the states in S 2 are player 2 states. F or a s ta te s ∈ S , we write E ( s ) = { t ∈ S | ( s, t ) ∈ E } for the set o f successo r states of s . W e as s ume tha t every state has at least o ne out-going edge, i.e., E ( s ) is non-empty for all states s ∈ S . Plays. A g a me is play ed by tw o play ers: play er 1 and play er 2, who form an infinite path in the game g raph by moving a token a lo ng edges. They sta rt by placing the token on an initial state, and then they take mov es indefinitely in the following wa y . If the token is on a sta te in S 1 , then play er 1 mov es the token along o ne of the edges g oing out of the state. If the token is on a s ta te in S 2 , then player 2 do es likewise. The r esult is an infinite path in the game graph; we refer to such infinite paths as plays. F ormally , a play is an infinite sequence h s 0 , s 1 , s 2 , . . . i o f states such that ( s k , s k +1 ) ∈ E for all k ≥ 0 . W e write Ω for the set of all plays. Str ate gies. A strategy for a player is a recip e that specifies how to extend plays. F orma lly , a str ate gy σ for play er 1 is a function σ : S ∗ · S 1 → S that, given a finite s equence of states (repr esen ting the history of the play so far) which ends in a play er 1 s tate, chooses the next state. The stra tegy m ust c ho ose only a v ailable succes sors, i.e., for all w ∈ S ∗ and s ∈ S 1 we have σ ( w · s ) ∈ E ( s ). The strateg ie s for play er 2 are defined a nalogously . W e write Σ and Π for the sets o f a ll str a tegies for play er 1 and play er 2, r espectively . An impor tan t specia l class of str ategies are memoryless strategies. T he memoryless stra tegies do not dep end o n the history of a play , but only on the current state. Ea ch memor yless stra tegy for play er 1 ca n b e s p ecified as a function σ : S 1 → S such that σ ( s ) ∈ E ( s ) for all s ∈ S 1 , and analog ously for memor yless play er 2 strategies. Given a starting state s ∈ S , a s tr ategy σ ∈ Σ for play er 1, and a strategy π ∈ Π for play er 2, ther e is a unique play , denoted ω ( s, σ , π ) = h s 0 , s 1 , s 2 , . . . i , which is defined as follows: s 0 = s and for all k ≥ 0, if s k ∈ S 1 , then σ ( s 0 , s 1 , . . . , s k ) = s k +1 , and if s k ∈ S 2 , then π ( s 0 , s 1 , . . . , s k ) = s k +1 . B¨ uchi and c oB¨ uchi obje ctives. W e co nsider game g raphs with a B ¨ uc hi o b jectiv e for player 1 a nd the co mplemen tary coB ¨ uchi ob jectiv e fo r play er 2. F o r a play ω = h s 0 , s 1 , s 2 , . . . i ∈ Ω , we define Inf ( ω ) = { s ∈ S | s k = s for infinitely many k ≥ 0 } to be the set o f s tates that o ccur infinitely often in ω . W e a lso define r eac hability and s a fet y ob jectiv es as they will b e useful in the a nalysis of the algorithms. 1. R e achability and safety obj e ctives. Giv en a set T ⊆ S of s ta tes, the reachabilit y ob jective Reach ( T ) require s that some state in T b e visited, and dually , the safety ob jectiv e Sa fe( F ) requires that only s tates in F be visited. F orma lly , the se ts o f winning plays ar e Reach ( T ) = {h s 0 , s 1 , s 2 , . . . i ∈ Ω | ∃ k ≥ 0 . s k ∈ T } and Sa fe( F ) = {h s 0 , s 1 , s 2 , . . . i ∈ Ω | ∀ k ≥ 0 . s k ∈ F } . The reachabilit y a nd safety ob jectives ar e dual in the s e nse that Reach ( T ) = Ω \ Safe( S \ T ). 2. B¨ uchi and c o-B¨ u chi obje ctives. G iven a set B ⊆ S of states, the B¨ uc hi ob jective Buc hi( B ) requires that some state in B be visited infinitely often, and dually , the c o -B¨ uchi o b jectiv e coBuchi ( C ) requires that only states in C b e visited infinitely often. Thus, the sets of winning plays are Buchi( B ) = { ω ∈ Ω | Inf ( ω ) ∩ B 6 = ∅ } and coBuchi ( C ) = { ω ∈ Ω | Inf ( ω ) ⊆ C } . The B ¨ uc hi and coB ¨ uch i ob jectives are dual in the sense that B uc hi( B ) = Ω \ coBuchi ( S \ B ). Winning str ate gies and sets. Given a n ob jective Φ ⊆ Ω for pla yer 1, a stra tegy σ ∈ Σ is a winning str ate gy for player 1 fro m a state s if for all play er 2 stra tegies π ∈ Π the play ω ( s, σ, π ) is winning, i.e., ω ( s, σ , π ) ∈ Φ . The winning strateg ies for play er 2 ar e defined ana lo gously . A state s ∈ S is w inning for player 1 with res pect to the o b jective Φ if player 1 ha s a winning strategy from s . F ormally , the set of winning states for play er 1 with r espect to the ob jectiv e Φ is W 1 ( Φ ) = { s ∈ S | ∃ σ ∈ Σ . ∀ π ∈ Π . ω ( s, σ , π ) ∈ Φ } . Analogously , the set of w inning states for play er 2 with re spect to a n ob jective Ψ ⊆ Ω is W 2 ( Ψ ) = { s ∈ S | ∃ π ∈ Π . ∀ σ ∈ Σ . ω ( s, σ, π ) ∈ Ψ } . W e s a y that there exists a memoryles s winning stra tegy for play er 1 with resp ect to the ob jectiv e Φ if ther e exists such a strategy from all s tates in W 1 ( Φ ); a nd similarly for play er 2. Theorem 1 (Classical m emoryless determinacy). The fol lowing assertions hold. 1. F or al l game gr aphs G = (( S, E ) , ( S 1 , S 2 )) , al l B ¨ uchi obje ct ive s Φ for player 1, and the c om- plementary c oB¨ uchi obje ctive Ψ = Ω \ Φ for player 2, we have W 1 ( Φ ) = S \ W 2 ( Ψ ) . 2. F or al l game gr aphs and al l B¨ uchi obje ctives Φ for player 1 and the c omplementary c oB¨ u ch i obje ctive Ψ for player 2, ther e exists a memoryless winning str ate gy for b oth players. Observe that for B ¨ uchi ob jective Φ and the co B¨ uchi ob jective Ψ = Ω \ Φ by definition we hav e S \ W 2 ( Ψ ) = { s ∈ S | ∀ π ∈ Π . ∃ σ ∈ Σ . ω ( s, σ, π ) ∈ Φ } . Theore m 1 states that S \ W 2 ( Ψ ) = { s ∈ S | ∃ σ ∈ Σ . ∀ π ∈ Π. ω ( s, σ, π ) ∈ Φ } , i.e., the order of the universal and the existential quantifiers can b e exchanged. 3 Iterativ e Algorithms for B ¨ uc hi Games In this section we present the classical iterative algorithm for B ¨ uchi games and an alterna tive iterative algorithm, i.e., algorithms to compute the winning sets in B¨ uchi games. The r unning time of the alternative alg orithm is never more than the r unning time the classical algorithm by an additive factor o f O ( m ), where m is the num ber of e dges in the g ame gra ph. W e als o present a family of game gra phs with B ¨ uchi ob jectiv es where the classica l algor ithm requires quadr a tic time and the alternative alg o rithm works in linear time. W e start with the notion of close d sets and attr actors whic h a re key notions for the analysis of the algo rithm. Close d s ets. A set U ⊆ S of states is a close d set for player 1 if the following tw o co nditions hold: (a) for all states u ∈ ( U ∩ S 1 ), we have E ( u ) ⊆ U , i.e., all succes sors of play er 1 sta tes in U a re again in U ; a nd (b) for all u ∈ ( U ∩ S 2 ), we have E ( u ) ∩ U 6 = ∅ , i.e., ev ery player 2 state in U has a s uccessor in U . The clos ed s ets for player 2 ar e defined ana logously . Every closed set U for play er ℓ , for ℓ ∈ { 1 , 2 } , induces a sub-game graph, denoted G ↾ U . Prop osition 1. Consider a game gr aph G , and a close d set U for player 1. Then the fol lowing assertions hold. 1. Ther e exists a memoryless st r ate gy π for player 2 such that for al l str ate gies σ for player 1 and for al l states s ∈ U we have ω ( s, σ, π ) ∈ Safe( U ) . 2. F or al l T ⊆ S \ U , we have W 1 (Reach( T )) ∩ U = ∅ . Attr actors. Giv en a ga me graph G , a s et U ⊆ S o f states, and a pla yer ℓ ∈ { 1 , 2 } , the set Attr ℓ ( U, G ) contains the states from which player ℓ ha s a stra tegy to reach a state in U aga inst all strateg ie s of the other play er; that is, Attr ℓ ( U, G ) = W ℓ (Reach( U )). The set Attr 1 ( U, G ) can be co mputed inductively as follows: let R 0 = U ; let R i +1 = R i ∪ { s ∈ S 1 | E ( s ) ∩ R i 6 = ∅} ∪ { s ∈ S 2 | E ( s ) ⊆ R i } for all i ≥ 0; then A ttr 1 ( U, G ) = S i ≥ 0 R i . The inductive c o mputation o f Attr 2 ( U, G ) is ana logous. F or all states s ∈ Attr 1 ( U, G ), define r ank ( s ) = i if s ∈ R i \ R i − 1 , tha t is, r ank ( s ) denotes the least i ≥ 0 such that s is included in R i . Define a memor yless strategy σ ∈ Σ for play er 1 as follows: for each state s ∈ ( Attr 1 ( U, G ) ∩ S 1 ) with r ank ( s ) = i , c ho ose a successor σ ( s ) ∈ ( R i − 1 ∩ E ( s )) (such a successor exists by the inductive definition). It follows that for a ll states s ∈ Attr 1 ( U, G ) and all str a tegies π ∈ Π for player 2, the play ω ( s, σ, π ) reaches U in at most | Attr 1 ( U, G ) | tra nsitions. Prop osition 2. F or al l game gr aphs G , al l players ℓ ∈ { 1 , 2 } , and al l sets U ⊆ S of states, the set S \ Attr ℓ ( U, G ) is a close d set for player ℓ . 3.1 Classical algorithm for B ¨ uc hi games In this subsection we pres e n t the clas sical a lgorithm for B ¨ uchi games. W e start with an informa l description of the algorithm. Informal des cription of classical algorithm. The classic al algorithm (Algor ithm 1) works a s follows. W e describ e an itera tion i of the alg o rithm: the set of states at iteration i is denoted as S i , the game graph as G i and the s et of B ¨ uc hi s tates B ∩ S i as B i . At itera tion i , the algo r ithm first finds the set o f states R i from whic h pla yer 1 ha s a s trategy to reach the set B i , i.e., computes Attr 1 ( B i , G i ). The rest of the states T r i = S i \ R i is a closed subset for player 1, a nd T r i ∩ B i = ∅ . The set T r i is identified as winning fo r pla yer 2. Then the set of states W i +1 , from which play er 2 has a strategy to rea ch the set T r i , i.e., Attr 2 ( T r i , G i ) is computed. The set W i +1 is identifi ed as a subset of the winning set for play er 2 and it is removed from the state set. The alg orithm then iterates o n the reduced ga me g raph. Obse r v e that at every itera tion the set of states remov ed is an attractor set a nd by P r opositio n 2 the reduced game g raph (the co mplemen t of an a ttractor) is a closed set and hence a game gra ph. In every iteration it per forms a b ackwar d search from the current B ¨ uchi s ta tes to find the set of states which can reach the B¨ uchi set. E a c h iteratio n takes O ( m ) time and the algor ithm r uns for at most O ( n ) iterations, wher e m a nd n denote the nu mber of edges and states in the g ame gr a ph, resp ectiv ely . The alg orithm is forma lly describ ed as Algorithm 1 . The corre c tness of the algo rithm easily follows from the re sults in [2,3]. Theorem 2 (Correctness and running tim e). Given a game gr aph G = (( S, E ) , ( S 1 , S 2 )) and B ⊆ S the fol lowing assertions hold: 1. W = W 2 (coBuchi ( S \ B )) and S \ W = W 1 (Buchi( B )) , wher e W is the output of Algo rithm 1; 2. the run ning time of Algorithm 1 is O ( b · m ) wher e b = | B | and m = | E | . R emark 1. Obser v e that the size o f the s et of B ¨ uchi states B can b e O ( n ), where n = | S | is the nu mber o f s ta tes, i.e., b in Theorem 2 can be O ( n ). Hence the worst case running time of the classical algorithm can be O ( n · m ), where n = | S | and m = | E | . Algorithm 1 Cl assical algorithm for B ¨ uchi Games Input : A 2-play er game graph G = (( S, E ) , ( S 1 , S 2 ) and B ⊆ S . Output: W ⊆ S . 1. G 0 := G ; S 0 := S ; 2. W 0 := ∅ ; 3. i := 0 4. repe at 4.1 W i +1 := Avo idSetClassical ( G i , B ∩ S i ) 4.2 S i +1 := S i \ W i +1 ; G i +1 = G ↾ S i +1 ; 4.3 i := i + 1; un til W i = ∅ 5. return W := S i k =1 W k . Procedure AvoidSetClassical Input: Game graph G i and B i ⊆ S i . Output: set W i +1 ⊆ S i . 1. R i := A ttr 1 ( B i , G i ); 2. T r i := S i \ R i ; 3. W i +1 := A ttr 2 ( T r i , G i ) 3.2 Alternativ e algorithm for B ¨ uchi game s W e now presen t a new alter nativ e iter ativ e a lgorithm for B¨ uchi games. The algo rithm differs from the cla ssical algo r ithm in its computation of the set T r i (computed in step 2 o f pro cudure AvoidSetClassical ) at e v ery iteration. Recall that the set T r i is a play er 1 clos e d set with empty int ers ection with the set o f B ¨ uchi states. The alternative algor ithm at every iter a tion identifies the set T r i in an a lternativ e wa y . W e first pr esen t a n informa l descriptio n of the algorithm. Informal description o f alternativ e algorithm. W e des cribe an itera tion i of Algorithm 2. W e denote by C = S \ B the set of c o B¨ uchi sta tes. W e denote the se t of states a t itera tion i by S i , the game graph as G i , the set of B¨ uchi s tates B ∩ S i as B i , and the set of coB¨ uchi states as C ∩ S i as C i . The algo rithm pro ceeds as follows: first it computes the set of play er 1 states in C i with all successo rs in C i and the s e t of player 2 states in C i with a s uccessor in C i . Then the player 2 attrac to r to the union of the ab o ve tw o sets is computed and let this set b e Z i . The states of Z i such that play er 1 ha s a strategy to leav e Z i is not a part of the player 1 clo sed set, and the remaining s tates of Z i is a play er 1 closed set with empty intersection with B i , and this is identified as the s et similar to the set T r i of Alg orithm 1. The details of the alg orithms is as follows. In step 4.2 the set of play er 1 states C i 1 is computed where for all s ∈ C i 1 , a ll succe s sors of s in G i is in C i ; and in step 4.3 the set of play er 2 states C i 2 is computed where fo r all s ∈ C i 2 , there is a succes s or of s in C i . Then the se t X i is computed as the set of states s uc h that player 2 has a strateg y in G i to r eac h C i 1 ∪ C i 2 against all play er 1 str ategies, i.e., X i = Attr 2 ( C i 1 ∪ C i 2 , G i ), and the set Z i is obtained as Z i = X i ∩ C i . The set D i denotes the set of states such that play er 1 can esca pe Z i in o ne step, i.e., either a player 1 state with a n edge out of Z i or a play er 2 s ta te with a ll e dg es out of Z i . The set L i denotes the set of states where play er 1 has a strateg y in X i to reach D i against all play er 2 str ategies, i.e., L i = Attr 1 ( D i , G i ↾ X i ). O bserv e that the set X i is not alwa ys a prop er sub- game, how ever, for all states in s ∈ X i \ D i we hav e E ( s ) ∩ X i 6 = ∅ , and hence fo r the purp ose of the computation o f the attracto r of D i we can co nsider G i ↾ X i as a sub-game. The set c T r i = Z i \ L i is identified as winning for player 2 . Then the set o f states W i +1 , from which player 2 has a strategy to r eac h the se t c T r i , i.e., Attr 2 ( c T r i , G i ) is co mputed. The set W i +1 is identifi ed as a subset o f the winning set for play er 2 and it is re moved from the s tate set. The a lgorithm then iterates on the reduced ga me graph. The algo rithm is desc r ibed formally as Algorithm 2. Correctness arguments. The main argument to prov e the correctness of Algorithm 2 is a s follows: we will show that, given that the ga me gra ph G i are s ame a t itera tion i of Algorithm 1 and Algo rithm 2, set T r i computed in step 2 of the iteration of classica l alg orithm and the set Algorithm 2 Al ternat ive algorithm for B ¨ uchi Game s Input : A 2-play er game graph G = (( S, E ) , ( S 1 , S 2 ) and B ⊆ S . Output: W ⊆ S . 1. G 0 := G ; S 0 := S ; C = S \ B ; 2. W 0 := ∅ ; 3. i := 0 4. repe at 4.1 C i := C ∩ S i ; 4.2 C i 1 := { s ∈ S 1 ∩ C i | E ( s ) ∩ S i ⊆ C i } ; 4.3 C i 2 := { s ∈ S 2 ∩ C i | E ( s ) ∩ C i 6 = ∅} ; 4.4 X i := A ttr 2 ( C i 1 ∪ C i 2 , G i ); 4.5 Z i := X i ∩ C i ; 4.6 D i := { s ∈ S 1 ∩ Z i | E ( s ) ∩ S i ∩ ( S i \ Z i ) 6 = ∅} ∪{ s ∈ S 2 ∩ Z i | E ( s ) ∩ S i ⊆ ( S i \ Z i ) } ∪ ( X i \ Z i ). 4.7 L i = A ttr 1 ( D i , G i ↾ X i ); 4.8 c T r i = Z i \ L i ; 4.9 W i +1 := A ttr 2 ( c T r i , G i ); 4.10 S i +1 := S i \ W i +1 ; G i +1 = G ↾ S i +1 ; i := i + 1; un til W i = ∅ 5. return W := S i k =1 W k . c T r i computed in step 4.8 of the a lternativ e algorithm coincide. O nce we prov e this result the correctnes s of the alternative algor ithm follows easily . W e prov e this re sult in several steps. The following prop osition sta tes that T r i is the lar gest play er 1 closed subset o f C i and it follows easily from the pr operties of attrac to rs and P ropos ition 1. Prop osition 3. L et G i b e t he gr aph at iter ation i if Algorithm 1 and let U i ⊆ C i such that U i is player 1 close d, then U i ⊆ T r i . By Prop osition 3 to prov e o ur desired claim it suffices to s ho w that T r i ⊆ c T r i , and c T r i is a play er 1 closed subset of C i (this w ould imply c T r i ⊆ T r i ). Lemma 1. T r i ⊆ C i 1 ∪ C i 2 . Pr o of. O bserv e that T r i is a play er 1 closed of C i . Hence for all sta tes s ∈ T r i the following assertions hold: (a) if s ∈ S 1 , then E ( s ) ∩ S i ⊆ T r i ⊆ C i ; and (b) if s ∈ S 2 , then E ( s ) ∩ T r i 6 = ∅ , and hence E ( s ) ∩ C i 6 = ∅ . Hence if s ∈ T r i , then s ∈ C i 1 ∪ C i 2 . Lemma 2. T r i ⊆ Z i , wher e Z i is t he set c ompute d at step 4.5 of Algorithm 2. Pr o of. By Lemma 1 we hav e T r i ⊆ C i 1 ∪ C i 2 and hence we hav e T r i ⊆ Attr 2 ( C i 1 ∪ C i 2 , G i ). Since T r i ⊆ C i , we hav e T r i ⊆ X i ∩ C i = Z i . Lemma 3. T r i ⊆ Z i \ L i , wher e Z i and L i ar e the sets c ompute d at step 4. 5 and 4.7 of Alg orithm 2, r esp e ctively. Pr o of. By L emma 2 we hav e T r i ⊆ Z i and hence we hav e S i \ Z i ⊆ S i \ T r i . Obser v e that from states in D i play er 1 can force the game to r eac h ( S i \ Z i ). Similar ly , in the s ub- game X i with D i as target set, player 1 can force the game to rea ch D i from L i and then force the g ame to reach S i \ Z i . Since T r i ⊆ Z i ⊆ X i and T r i is a play er 1 closed set, play er 2 can keep the game in T r i forever (by Pr opositio n 1 ). Hence we must have T r i ∩ L i = ∅ . Hence we hav e T r i ⊆ Z i and T r i ∩ L i = ∅ . Thus we obtain T r i ⊆ Z i \ L i . Lemma 4. Z i \ L i ⊆ C i and Z i \ L i is a player 1 close d s et. Pr o of. Since X i = Attr 2 ( C i 1 ∪ C i 2 , G i ), it follows that fo r all states s ∈ X i we have (a ) if s ∈ S 1 ∩ X i , then E ( s ) ∩ S i ⊆ X i , a nd (b) if s ∈ S 2 ∩ X i , then we hav e E ( s ) ∩ X i 6 = ∅ . Since L i = Attr 1 ( D i , G i ↾ X i ), for all states s ∈ ( Z i \ L i ) the follo wing assertio ns hold: (a) if s ∈ S 1 , then E ( s ) ∩ S i ⊆ ( Z i \ L i ), as otherwise s would hav e be en in L i ; and (b) if s ∈ S 2 , then E ( s ) ∩ ( Z i \ L i ) 6 = ∅ , as otherwise s would have be e n in L i . Hence it follows tha t ( Z i \ L i ) is play er 1 clos ed, and since Z i ⊆ C i , the desired result fo llo ws. Lemma 5. T r i = c T r i . Pr o of. By Lemma 3 we hav e T r i ⊆ c T r i . By Lemma 4 we have c T r i is a play er 1 clos ed subset o f C i . Then, b y Prop osition 3 we hav e c T r i ⊆ T r i . This pr oves the des ired result. The co rrectness of Algor ithm 2 easily follows from Lemma 5 and induction. Theorem 3 (Correctness of Algorithm 2). Given a game gr aph G = (( S, E ) , ( S 1 , S 2 )) and B ⊆ S we have W = W 2 (coBuchi( S \ B )) and S \ W = W 1 (Buchi( B )) , wher e W is t he output of Algo rithm 2. W ork analysis of Algorithm 2. W e first analyze the work for the computation of step 4.2 and step 4.3 over all itera tions o f Algo r ithm 2. It easily follows tha t C i 2 = C 0 2 ∩ S i , this follows since if a s ta te s ∈ S 2 has an edg e to W i − 1 , then s would have b een in W i − 1 itself. The tota l work in the computatio n of the sets C i 1 ov erall iterations is O ( m ): this is achiev ed a s follows. F or every state s ∈ S 1 we keep a co un ter for the num ber of edge s to the set S \ C = B , and once an edg e to S \ C is remov ed from the g raph the coun ter for the resp ectiv e sta te is decremented by 1. Once the coun ter for a state reaches 0 it is included in C i 1 . Hence the total work for step 4.2 and step 4.3 ov erall iteratio ns is O ( m ). W e now ar g ue that the excess w or k of Algor ithm 2 as compa r ed to the classical a lg orithm is at most O ( m ). The tota l work of step 4.2 and step 4.3 is alrea dy b ounded by O ( m ). The r est of the a r gumen t is as follo ws: the classical alg orithm for the computation of T r i never works on the edg es in T r i , i.e., on edges in E ∩ ( T r i × T r i ). At iter ation i Algor ithm 2 do es e xcess work as compared to classical a lgorithm on the edges in T r i and do es only constant amount o f work on this edges. How ever, edge s in T r i are removed at every iteration i , and hence the excess work of Algorithm 2 as compa r ed to the cla ssical algor ithm is O ( m ). Theorem 4 (Running tim e of Algorithm 2). L et RT 1 ( G, B ) denote the running time of Al- gorithm 1 on a game gr aph G with B ⊆ S and RT 2 ( G, B ) denote the run ning time of Algorithm 2. Then we have RT 2 ( G, B ) ≤ RT 1 ( G, B ) + O ( m ) , wher e m = | E | . W e now present a n ex ample of a fa mily o f g ame gra phs where the cla ssical alg orithm require s quadratic time, whereas Algorithm 2 works in linea r time. Example 1. The family of game gra phs is constructed as follows. Given n ≥ 1 we consider a game graph c onsisting of n gadg ets H (0) , H (1) , . . . H ( n ) as follows. The gadg e t H ( i ) co nsits of a play er 1 state t i (shown as a -state in Fig 1) and a play er 2 state w i (shown as a ✸ state in Fig 1 ). The set of edg es is as follows: 1. F or 0 ≤ i < n we hav e E ( w i ) = { t i , t i +1 } a nd E ( w n ) = { t n } . 2. F or 0 < i ≤ n we hav e E ( t i ) = { t i , w i − 1 } a nd E ( t 0 ) = { t 0 } . w 2 t 0 t 1 t 2 t n w 1 w 0 H ( n ) H (2) H (1) H (0) w n Fig. 1. The set of B ¨ uc hi states is B = { w i | 0 ≤ i ≤ n } . Given n ≥ 1, the g ame graph constructed has 2 n states and 4 n − 2 edges, i.e ., we have O ( n ) states and O ( n ) edges. The sets T r i and W i +1 obtained at iter ation i , for i ≥ 0, for the classical alg o rithm are as follows: T r i = { t i } and W i +1 = { t i , w i } . At iter ation i the c la ssical algo rithm works on edges of gadg ets H ( ℓ ), for ℓ ≥ i + 1. Hence the total w ork of the cla ssical algorithm is at least P n − 1 i =1 ( n − i ) = O ( n 2 ) , i.e., the classical algorithm requires time q uadratic in the size of the g ame gra ph. W e no w analyze the w or k of Algorithm 2. The sets of Algorithm 2 of iteration i , for i ≥ 0, is as follows: (a) C i 1 = { t i } and C i 2 = ∅ ; (b) X i = { t i , w i } and Z i = { t i } ; and (c) D i = { t i } , L i = { w i } and c T r i = { t i } . The work of Algo rithm 2 is constant for every iteration i : since the computatio n of steps 4.4 to steps 4.9 only w orks on edges in H ( i ) and H ( i + 1). Hence the to tal work of Alg orithm 2 is O ( n ), i.e., the alter nativ e algorithm works in linea r time. Also if in e very gadg e t H ( i ) the self-lo op at state t i is replaced by a cycle of 2 log( n ) sta tes, then b oth the classical alg orithm and the a lgorithm of [1] r e quires O ( n 2 log( n )) time, whereas Algorithm 2 r equires O ( n lo g( n )) time. Do v etailin g Algorithm 1 and Algorithm 2. W e already proved that the set T r i and c T r i of Algorithm 1 and Algorithm 2 coincide. Algor ithm 1 never works on the edges in T r i and is fav ora ble when T r i is large and Algorithm 2 is fav ora ble when T r i is small. Hence in ev ery iter ation both the algorithms can b e run in a dov etailing fashion and obtaining T r i by the algo r ithm tha t completes first. The co mputation of the sets C i +1 1 and C i +1 2 can b e computed during the c omputation of the set W i +1 . 4 Impro v ed Algorithm for B ¨ uc hi Games In this section we presen t the improved algor ithm for B ¨ uchi games. The algorithm is a generaliza tion of the improv ed alg orithm of [1] to g eneral game gra phs, as compar ed to the a lgorithm of [1] which works only fo r binary g ame gr a phs (game graphs with every state having out-degr ee at most 2 ). W e w ill us e the following nota tions in this se ction. Notation. F or a set U a nd a game g raph G we denote by source( U, G ) = { s ∈ S | E ( s ) ∩ U 6 = ∅ } is the set of states with edg es that enter U . Giv en a ga me graph G we denote by δ ( G ) = max {| E ( s ) | | s ∈ S } the maximum out-deg ree of a s ta te in G . Informal des cription of the new algorithm W e observe that in s tep 1 of every iter ation i of the classic a l algor ithm an O ( m ) b ackwar d alternating search is p erformed to co mpute the set R i , where m is the num ber of edges. The k ey idea of our impr ove d algorithm (Algo rithm 3) is to per form a cheap forwar d exploration o f edges in order to discover subsets of the winning set for play er 2 . Let U b e the se t of sourc es o f edges entering the winning set of play er 2 discov ered in Algorithm 3 Improv ed Algorithm for B ¨ uc hi Games Input : A 2-play er game graph G = (( S, E ) , ( S 1 , S 2 ) and B ⊆ S . Output: W ⊆ S . 1. G 0 := G ; S 0 := S ; C = S \ B ; 2. W 0 := ∅ ; 3. i := 0 4. repe at 4.1 if ( | source( W i , G ) | ≥ m log( n ) ) 4.1.1 W i +1 := AvoidSetClassical ( G i , B ∩ S i ) 4.1.2 go to step 4.3. 4.2 else 4.2.1 add a state b s and an edge fro b s to a state in s ∈ source( W i , G ) 4.2.2 Find the reachable sub graph R b s by a BFS for ` 2 · m log n ´ steps 4.2.3 Let F b s denote the set of states in the frontier of the BFS 4.2.4 T b s := { s ∈ S 2 ∩ F b s | E ( s ) ∩ S i ∩ R b s = ∅} ∪ ( S 1 ∩ F b s ) 4.2.5 A b s := A ttr 1 (( R b s ∩ B ∩ S i ) ∪ T b s , G i ↾ R b s ) 4.2.6 T r i := ( R b s \ A b s ) 4.2.7 if ( T r i 6 = ∅ ) 4.2.7.1 then W i +1 := A ttr 2 ( T r i , G i ) 4.2.8 else 4.2.8.1 W i +1 := Avo idSetClassical ( G i , B ∩ S i ) 4.2.9 remov e the state b s ; 4.3 S i +1 := S i \ W i +1 ; G i +1 = G ↾ S i +1 ; i := i + 1; un til W i = ∅ 5. return W := S i k =1 W k . the previous itera tion. The s tates in set U are new candidates to b e included in the winning set of play er 2. The cheap forward explora tion of edges is p erformed when the size of the set U is small. F ormally , if | U | ≥ m log( n ) , then a n iteration o f the classica l algo rithm is exe c uted (step 4.1 ), i.e., the backw ard search is per formed. Otherwise , we per form the cheap forward search as follows: we add an auxilia ry state b s with a n edg e to every state in U . F rom the state b s a B FS is p erformed for 2 · m log n steps in step 4 .2.2 o f Alg orithm 3. In steps 4.2 .3—4.2.7 w e chec k if the explored subgraph contains a clo sed set for player 1 in which player 2 has a winning strategy . If no suc h set is detected then one iter ation of the classic al alg orithm is executed. The key for a n improv ed bo und o f o ur algorithm is the observ ation that if step 4.2.7 fails to identify a non- e mpt y winning subset for play er 2, then the set discov ere d b y the following iter a tion of the classical algorithm has at least log n log( δ ( G )) states. A for mal presentation o f the algor ithm is given a s Algorithm 3. Theorem 5 (Correctness of Algorithm 3). Given a game gr aph G = (( S, E ) , ( S 1 , S 2 )) and B ⊆ S we have W = W 2 (coBuchi( S \ B )) and S \ W = W 1 (Buchi( B )) , wher e W is t he output of Algo rithm 3. Pr o of. W e prov e b y induction that W i computed in an y iter ation of the impr oved algorithm satisfies W i ⊆ W 2 (coBuchi ( S \ B )). Base c ase: W 0 = ∅ ⊆ W 2 (coBuchi ( S \ B )). Inductive c ase: W e a rgue that W i ⊆ W 2 (coBuchi ( S \ B )) implies that W i +1 ⊆ W 2 (coBuchi ( S \ B )). The c ase when step 4.1 .1 gets executed, or step 4.2.7 fails and step 4 .2 .8 gets ex ecuted, then the correctnes s follows fro m the corre c n tess of the iteratio n of the classical algorithm. W e focus on the case when step 4 .2.7 gets ex ecuted, i.e ., a non-empty set T r i is discov ered as ( R b s \ A b s ). F or state s ∈ S 1 ∩ ( R b s \ F b s ), we hav e E ( s ) ∩ S i ⊆ R b s . It follows from s tep 4.2.4 that F b s ∩ S 1 ⊆ T b s . Let Z = ( R b s ∩ B ∩ S i ) ∪ T b s . Hence the following tw o conditions hold: (1) . F b s ∩ S 1 ⊆ T b s ⊆ Attr 1 ( Z, R b s ) ⊆ A b s ; (2) . R b s ∩ B ∩ S i ⊆ Attr 1 ( Z, R b s ) ⊆ A b s . By prop erty o f attrac to r we hav e the following prop ert y for ( R b s \ A b s ); for a ll states s ∈ ( R b s \ A b s ) the following assertio ns ho ld: (a) if s ∈ S 1 , then E ( s ) ∩ S i ⊆ ( R b s \ A b s ), and (b) if s ∈ S 2 , then E ( s ) ∩ S i ∩ ( R b s \ A b s ) 6 = ∅ . Hence ( R b s \ A b s ) is a player 1 closed s et in G i and ( R b s \ A b s ) ∩ B = ∅ . It follows that ( R b s \ A b s ) ⊆ W 2 (coBuchi( S \ B )). Hence it follows that W i +1 ⊆ W 2 (coBuchi ( S \ B )). T he cor rectness of Algorithm 3 follows. W ork analysis of algorithm 3. W e now fo cus on the w ork analysis of Algorithm 3. Le t us denote by ℓ the depth of the search o f the BFS at step 4.2.2 of Algorithm 3. Since source( W i , G ) ≤ m log( n ) and the BFS pro ceeds for 2 · m log( n ) steps, the BFS explo r es a t least m log( n ) edges of the game g r aph G i . Hence m ust hav e δ ( G ) ℓ ≥ m log( n ) . Thus we obtain that ℓ ≥ O log( m ) log( δ ( G )) = O log( n ) log( δ ( G )) . In the following lemma w e denote by ℓ the depth of the BFS s e a rc h at step 4.2.2 of Algorithm 3. Lemma 6. L et R b s b e the set c ompute d in step 4.2.2 of Alg orithm 3 and ℓ b e the depth of t he BFS in step 4.2.2. L et W ⊆ R b s b e an playe r 1 close d set such that W ∩ B = ∅ and | W | < ℓ . The n W ⊆ ( R b s \ A b s ) , and henc e W is disc over e d in step 4.2.7. Pr o of. Given a g ame gra ph G a nd a set of states U w e define sequences U i as follows: U 0 = U ; U k +1 = U k ∪ { s ∈ S 1 | E ( s ) ∩ S k 6 = ∅} ∪ { s ∈ S 2 | E ( s ) ⊆ S k } k ≥ 0 . By definition Attr 1 ( U, G ) = S k U k . W e pr o ve by induction that W ∩ A b s = ∅ . By Step 4.2.5 we hav e A b s = Attr 1 (( R b s ∩ B ∩ S i ) ∪ T b s , G i ↾ R b s ). Let U i be the sequence of set o f states in the attra ctor computation of ( R b s ∩ B ∩ S i ) ∪ T b s with U 0 = ( R b s ∩ B ∩ S i ) ∪ T b s . W e sho w b y induction that U i ∩ W = ∅ . Base c ase. Given | W | ≤ ℓ − 1, for all states w ∈ W there is a path fro m b s of length a t mo st | W | ≤ ℓ − 1 to w . It follows that in the BFS from b s depth of any state w ∈ W is less than ℓ . Hence we have W ∩ F b s = ∅ . Since T b s ⊆ F b s we have W ∩ T b s = ∅ . Since W ∩ B = ∅ w e hav e W ∩ ( B ∩ S i ) = ∅ . It follows that W ∩ (( R b s ∩ B ∩ S i ) ∪ T b s ) = ∅ . This proves the bas e case that U 0 ∩ W = ∅ . Inductive c ase. Given U k ∩ W = ∅ we s ho w tha t U k +1 ∩ W = ∅ . Since W is a play er 1 closed set, the following a ssertions hold: for a state s ∈ W ∩ S 2 , we hav e E ( s ) ∩ W 6 = ∅ and for a state s ∈ W ∩ S 1 , we hav e E ( s ) ⊆ W . Consider a state s ∈ W ∩ S 2 , since U k ∩ W = ∅ , then ∃ t ∈ E ( s ) and t 6∈ U k and hence s 6∈ U k +1 . Co nsider a s tate s ∈ W ∩ S 1 , s ince E ( s ) ⊆ W and W ∩ U k = ∅ , we hav e E ( s ) ∩ U k = ∅ . Hence s 6∈ U k +1 . Hence W ∩ U k +1 = ∅ . It follows that W ∩ A b s = ∅ . Since W ⊆ R b s it follows that W ⊆ ( R b s \ A b s ). The res ult follows. Lemma 7. The t otal work of step 4.2. 2 — step 4.2. 6 of Algo rithm 3 is O n · m log( n ) and t he total work of step 4.2.7 is O ( m ) . Pr o of. Co nsider a n iteratio n of Algor ithm 3: since step 4.2 .2 gets exec uted for 2 · m log( n ) steps it follows that size of the graph R b s is O m log( n ) . It follows that in an y iteration the total work of step 4.2.2 — step 4.2.6 is O m log( n ) . Since there can b e a t most O ( n ) iter ations of the algor ithm the result for step 4 .2.2 — step 4.2.6 fo llows. The e dges on which step 4.2.7 works ar e remov ed for further itera tion when we remov e W i +1 from the pr esen t s e t of states. Hence in s tep 4.2.7 no edge is worked fo r more tha n once. Thus we obtain that to tal work of step 4.2.7 of Algorithm 3 is O ( m ). Lemma 8. The total work in st ep 4.2.8 of Algorithm 3 is O n · m · log( δ ( G )) log( n ) . Pr o of. In Algorithm 3 when step 4.2.8 gets executed let T r i be the set of v ertices iden tified b y the iteration of the classical algor ithm. If | T r i | ≤ ℓ − 1, where ℓ is the depth of the BFS search of step 4 .2 .2, then it follows from Lemma 6 that it would hav e b een identified by step 4.2.7 in of the iteration. Hence every time 4.8 gets executed at lea st ℓ states are remov ed from the graph. So step 4.2.8 ca n b e executed at most O n ℓ times, where ℓ ≥ O log( n ) log( δ ( G )) . The work at every itera tion is O ( m ) and he nce the total work o f step 4 .2.8 of Algorithm 3 is O n · m · log( δ ( G )) log( n ) . Lemma 9. The total work in st ep 4.1 of Algorithm 3 is O ( m · log( n )) . Pr o of. The c o ndition of step 4 .1 ensur es that whenever step 4.1 gets executed as le ast m log( n ) edges are remov ed from the graph in the pr evious iteration. Hence step 4.1 gets executed a t most log( n ) times and each iteratio n tak es O ( m ) work. The result follows. Lemma 7, Lemma 8 and Lemma 9 yield the following result. Theorem 6. The total work of Algori thm 3 on a game gr aph G with a B ¨ uchi obje ctive Buchi ( B ) , wher e B ⊆ S , is O n · m · log( δ ( G )) log( n ) . R emark 2. Obser v e that for a game gr aph G with n = | S | we hav e δ ( G ) ≤ n , and hence Algorithm 3 is a symptotically no worse than the c la ssical algor ithm. In [1] an improv ed a lgorithm is pr esen ted for binary game g raphs (wher e e v ery state ha s o ut-degree at most 2) with a running time o f O n 2 log( n ) , for game graphs with n - states. F or the sp ecial ca se of binar y ga me graphs the r unning time of Algorithm 3 matches the b ound of the algo r ithm of [1]. How ever, there exists ga me gr aphs where Algo rithm 3 out-p erforms b oth the c la ssical algorithm and the algor ithm of [1]. F or e xample consider the cla ss of game graphs G with n = | S | a nd | E ( s ) | = O (lo g( n )) for a ll states, and hence m = O ( n · log( n )). The classical a lg orithm a nd the algor ithm o f [1] (after r eduction to binary game gr aphs) in the worst case take O ( n 2 log( n )) time, wherea s the w or s t case r unning time of Algorithm 3 is b ounded in O ( n 2 log(log( n ))). References 1. K. Chatterjee, M. Jurdzi ´ nsk i, and T.A. H en zinger. Simple stochastic parit y games. In CSL’03 , v olume 2803 of LNCS , pages 100–113. S p ringer, 2003. 2. R. McNaughton. I nfinite games pla yed on finite graphs. Annals of Pur e and Applie d L o gic , 65:149– 184, 1993. 3. W. Thomas. Languages, automata, and logi c. In G. Rozenberg and A. Salomaa, editors, Handb o ok of F ormal L anguage s , volume 3, Bey ond W ords, chapter 7, pages 389–455. Springer, 1997.
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment