Parity game

From HandWiki
Revision as of 20:48, 6 February 2024 by Jworkorg (talk | contribs) (over-write)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Short description: Mathematical game played on a directed graph
A parity game. Circular nodes belong to player 0, rectangular nodes belong to player 1. On the left side is the winning region of player 0, on the right side is the winning region of player 1.

A parity game is played on a colored directed graph, where each node has been colored by a priority – one of (usually) finitely many natural numbers. Two players, 0 and 1, move a (single, shared) token along the edges of the graph. The owner of the node that the token falls on selects the successor node (does the next move). The players keep moving the token, resulting in a (possibly infinite) path, called a play.

The winner of a finite play is the player whose opponent is unable to move. The winner of an infinite play is determined by the priorities appearing in the play. Typically, player 0 wins an infinite play if the largest priority that occurs infinitely often in the play is even. Player 1 wins otherwise. This explains the word "parity" in the title.

Parity games lie in the third level of the Borel hierarchy, and are consequently determined.[1]

Games related to parity games were implicitly used in Rabin's proof of decidability of the monadic second-order theory of n successors (S2S for n = 2), where determinacy of such games was proven.[2] The Knaster–Tarski theorem leads to a relatively simple proof of determinacy of parity games.[3]

Moreover, parity games are history-free determined.[3][4][5] This means that if a player has a winning strategy then that player has a winning strategy that depends only on the current board position, and not on the history of the play.

Solving a game

Question, Web Fundamentals.svg Unsolved problem in computer science:
Can parity games be solved in polynomial time?
(more unsolved problems in computer science)

Solving a parity game played on a finite graph means deciding, for a given starting position, which of the two players has a winning strategy. It has been shown that this problem is in NP and co-NP, more precisely UP and co-UP,[6] as well as in QP (quasipolynomial time).[7] It remains an open question whether this decision problem is solvable in PTime.

Given that parity games are history-free determined, solving a given parity game is equivalent to solving the following simple looking graph-theoretic problem. Given a finite colored directed bipartite graph with n vertices [math]\displaystyle{ V = V_0 \cup V_1 }[/math], and V colored with colors from 1 to m, is there a choice function selecting a single out-going edge from each vertex of [math]\displaystyle{ V_0 }[/math], such that the resulting subgraph has the property that in each cycle the largest occurring color is even.

Recursive algorithm for solving parity games

Zielonka outlined a recursive algorithm that solves parity games. Let [math]\displaystyle{ G=(V, V_0,V_1,E,\Omega) }[/math] be a parity game, where [math]\displaystyle{ V_0 }[/math] resp. [math]\displaystyle{ V_1 }[/math] are the sets of nodes belonging to player 0 resp. 1, [math]\displaystyle{ V = V_0 \cup V_1 }[/math] is the set of all nodes, [math]\displaystyle{ E \subseteq V \times V }[/math] is the total set of edges, and [math]\displaystyle{ \Omega: V \rightarrow \mathbb{N} }[/math] is the priority assignment function.

Zielonka's algorithm is based on the notation of attractors. Let [math]\displaystyle{ U \subseteq V }[/math] be a set of nodes and [math]\displaystyle{ i=0,1 }[/math] be a player. The i-attractor of U is the least set of nodes [math]\displaystyle{ Attr_i(U) }[/math] containing U such that i can force a visit to U from every node in [math]\displaystyle{ Attr_i(U) }[/math]. It can be defined by a fix-point computation:

[math]\displaystyle{ \begin{align} Attr_i(U)^0 &:= U \\ Attr_i(U)^{j+1} &:= Attr_i(U)^j \cup \{v \in V_i \mid \exists (v,w) \in E: w \in Attr_i(U)^j \} \cup \{v \in V_{1-i} \mid \forall (v,w) \in E: w \in Attr_i(U)^j \} \\ Attr_i(U) &:= \bigcup_{j=0}^\infty Attr_i(U)^j \end{align} }[/math]

In other words, one starts with the initial set U. Then, for each step ([math]\displaystyle{ Attr_i(U)^{j+1} }[/math]) one adds all nodes belonging to player 0 that can reach the previous set ([math]\displaystyle{ Attr_i(U)^{j} }[/math]) with a single edge and all nodes belonging to player 1 that must reach the previous set ([math]\displaystyle{ Attr_i(U)^{j} }[/math]) no matter which edge player 1 takes.

Zielonka's algorithm is based on a recursive descent on the number of priorities. If the maximal priority is 0, it is immediate to see that player 0 wins the whole game (with an arbitrary strategy). Otherwise, let p be the largest one and let [math]\displaystyle{ i = p \bmod 2 }[/math] be the player associated with the priority. Let [math]\displaystyle{ U = \{v \mid \Omega(v) = p\} }[/math] be the set of nodes with priority p and let [math]\displaystyle{ A = Attr_i(U) }[/math] be the corresponding attractor of player i. Player i can now ensure that every play that visits A infinitely often is won by player i.

Consider the game [math]\displaystyle{ G' = G \setminus A }[/math] in which all nodes and affected edges of A are removed. We can now solve the smaller game [math]\displaystyle{ G' }[/math] by recursion and obtain a pair of winning sets [math]\displaystyle{ W'_i, W'_{1-i} }[/math]. If [math]\displaystyle{ W'_{1-i} }[/math] is empty, then so is [math]\displaystyle{ W_{1-i} }[/math] for the game G, because player [math]\displaystyle{ 1-i }[/math] can only decide to escape from [math]\displaystyle{ W_i' }[/math] to A which also results in a win for player i.

Otherwise, if [math]\displaystyle{ W'_{1-i} }[/math] is not empty, we only know for sure that player [math]\displaystyle{ 1-i }[/math] can win on [math]\displaystyle{ W'_{1-i} }[/math] as player i cannot escape from [math]\displaystyle{ W'_{1-i} }[/math] to A (since A is an i-attractor). We therefore compute the attractor [math]\displaystyle{ B = Attr_{1-i}(W'_{1-i}) }[/math] and remove it from G to obtain the smaller game [math]\displaystyle{ G'' = G \setminus B }[/math]. We again solve it by recursion and obtain a pair of winning sets [math]\displaystyle{ W''_i, W''_{1-i} }[/math]. It follows that [math]\displaystyle{ W_i = W''_i }[/math] and [math]\displaystyle{ W_{1-i} = W''_{1-i} \cup B }[/math].

In simple pseudocode, the algorithm might be expressed as this:

function [math]\displaystyle{ solve(G) }[/math]
    p := maximal priority in G
    if [math]\displaystyle{ p = 0 }[/math]
        return [math]\displaystyle{ W_0, W_1 := V, \{\} }[/math]
    else
        U := nodes in G with priority p
        [math]\displaystyle{ i := p \bmod 2 }[/math]
        [math]\displaystyle{ A := Attr_i(U) }[/math]
        [math]\displaystyle{ W_0', W_1' := solve(G \setminus A) }[/math]
        if [math]\displaystyle{ W_{1-i}' = \{\} }[/math]
            return [math]\displaystyle{ W_i , W_{1-i} := V, \{\} }[/math]
        [math]\displaystyle{ B := Attr_{1-i}(W_{1-i}') }[/math]
        [math]\displaystyle{ W_0'', W_1'' := solve(G \setminus B) }[/math]
        return [math]\displaystyle{ W_i , W_{1-i} := W_i'', W_{1-i}'' \cup B }[/math]

Related games and their decision problems

A slight modification of the above game, and the related graph-theoretic problem, makes solving the game NP-hard. The modified game has the Rabin acceptance condition. Specifically, in the above bipartite graph scenario, the problem now is to determine if there is a choice function selecting a single out-going edge from each vertex of V0, such that the resulting subgraph has the property that in each cycle (and hence each strongly connected component) it is the case that there exists an i and a node with color 2i, and no node with color 2i + 1...

Note that as opposed to parity games, this game is no longer symmetric with respect to players 0 and 1.

Relation with logic and automata theory

Most common applications of parity game solving.

Despite its interesting complexity theoretic status, parity game solving can be seen as the algorithmic backend to problems in automated verification and controller synthesis. The model-checking problem for the modal μ-calculus for instance is known to be equivalent to parity game solving. Also, decision problems like validity or satisfiability for modal logics can be reduced to parity game solving.

References

  1. D. A. Martin: Borel determinacy, The Annals of Mathematics, Vol 102 No. 2 pp. 363–371 (1975)
  2. Rabin, M. O. (1969). "Decidability of second-order theories and automata on infinite trees". Transactions of the American Mathematical Society (American Mathematical Society) 141: 1–35. doi:10.2307/1995086. http://projecteuclid.org/euclid.bams/1183529958. 
  3. 3.0 3.1 E. A. Emerson and C. S. Jutla: Tree Automata, Mu-Calculus and Determinacy, IEEE Proc. Foundations of Computer Science, pp 368–377 (1991), ISBN:0-8186-2445-0
  4. A. Mostowski: Games with forbidden positions, University of Gdansk, Tech. Report 78 (1991)
  5. Zielonka, W (1998). "Infinite Games on Finitely Coloured Graphs with Applications to Automata on Infinite Trees". Theor. Comput. Sci. 200 (1–2): 135–183. doi:10.1016/S0304-3975(98)00009-7. 
  6. Marcin Jurdziński (1998), "Deciding the winner in parity games is in UP∩ co-UP", Information Processing Letters (Elsevier) 68 (3): 119–124, doi:10.1016/S0020-0190(98)00150-1, https://www.dcs.warwick.ac.uk/~mju/Papers/Jur98-IPL.pdf 
  7. Calude, Cristian S; Jain, Sanjay; Khoussainov, Bakhadyr; Li, Wei; Stephan, Frank, "Deciding parity games in quasipolynomial time", Stoc 2017, https://researchspace.auckland.ac.nz/bitstream/handle/2292/31757/500Cris.pdf?sequence=1 
  • Erich Grädel, Phokion G. Kolaitis, Leonid Libkin, Maarten Marx, Joel Spencer, Moshe Y. Vardi, Yde Venema, Scott Weinstein (2007). Finite model theory and its applications. Springer. ISBN 978-3-540-00428-8. 

Further reading

  • E. Grädel, W. Thomas, T. Wilke (Eds.) : Automata, Logics, and Infinite Games, Springer LNCS 2500 (2003), ISBN:3-540-00388-6
  • W. Zielonka : Infinite games on finitely coloured graphs with applications to automata on infinite tree, TCS, 200(1-2):135-183, 1998

External links

Two state-of-the-art parity game solving toolsets are the following: