A short proof of correctness of the quasi-polynomial time algorithm for parity games

Hugo Gimbert, Rasmus Ibsen-Jensen

Parity games

A parity game is given by a directed graph (V,E)(V,E), a starting node s∈Vs\in V, a function which attaches to each v∈Vv\in V a priority pty⁡(v)\operatorname{pty}(v) from a set {1,2,...,m}\{1,2,...,m\}; the main parameter of the game is nn, the number of nodes, and the second parameter is mm. Two players Anke and Boris move alternately in the graph with Anke moving first. A move from a node vv to another node ww is valid if (v,w)(v,w) is an edge in the graph; furthermore, it is required that from every node one can make at least one valid move. The alternate moves by Anke and Boris define an infinite sequence of nodes which is called a play. Anke wins a play through nodes v0,v1,⋯v_{0},v_{1},\cdots iff lim sup⁡tpty⁡(vt)\limsup_{t}\operatorname{pty}(v_{t}) is even, otherwise Boris wins the play.

We say that a player wins the parity game if she has a strategy which guarantees the play to be winning for her. Parity games are determined thus either Anke or Boris wins the parity game.

Statistics

The core of the algorithm of Calude et al. is to keep track of statistics about the game, in the form of partial functions

The initial statistic is the empty statistic f0=∅f_{0}=\emptyset, which is updated successively by all the priorities visited during the play, thus producing a sequence of statistics. The update of a statistic ff by a priority cc is performed by applying successively the following two rules.

Type I update: If cc is even then it is inserted at the highest index j∈0⋯kj\in 0\cdots k such that ff is defined and even on 0…j−10\ldots j-1.

Type II update: If im⁡(f)\operatorname{im}(f) contains at least one value <c<c then cc is inserted at the highest index j∈dom⁡(f)j\in\operatorname{dom}(f) such that f(j)<cf(j)<c.

Applying both rules in succession ensures that the update of an increasing statistic is increasing. If rule II triggers an insertion then we say the update is a type II update. Notice that in this case, applying or not rule I in the first place does not change the result. If rule I triggers an insertion but rule II does not then we say the update is a type I update.

Anke (resp. Boris) wins the statistics game if she (resp. he) has a strategy to enforce (resp. to avoid) a visit to a statistic whose domain contains kk. Similarly to the game of chess, statistics games are determined: either Anke or Boris has a winning strategy .

Correctness of the algorithm

Anke wins the parity game iff she wins the statistics games.

Since statistics games are determined, the direct implication follows from:

If Boris wins the statistics games, he wins the parity game.

Every play won by Boris in the statistics game is won by Boris in the parity game because c=lim sup⁡tctc=\limsup_{t}c_{t} is odd in every sequence of statistics updates f0→c0f1→c1…f_{0}\to_{c_{0}}f_{1}\to_{c_{1}}\ldots such that ∀t≥0,k∉dom⁡(ft)\forall t\geq 0,k\not\in\operatorname{dom}(f_{t}), the proof of which follows.

The converse implication (Corollary 1.13) relies on several crucial properties of statistics.

With every statistic ff is associated its counter value

In the sequel we fix a sequence f0→c0f1…→cNfN+1f_{0}\to_{c_{0}}f_{1}\ldots\to_{c_{N}}f_{N+1} of statistics updates. We will first give two lemmas that gives information on what can be said when an update of type 1 and 2, respectively, is used on a date.

For all NN if fN→cNfN+1f_{N}\rightarrow_{c_{N}}f_{N+1} is a type 1 update, then bin⁡(fN)+1=bin⁡(fN+1)\operatorname{bin}(f_{N})+1=\operatorname{bin}(f_{N+1})

Fix a number i>0i>0. Consider the smallest date TT such that bin⁡(fT+1)≥i\operatorname{bin}(f_{T+1})\geq i. Then the update on date TT is of type 1 and bin⁡(fT+1)=i\operatorname{bin}(f_{T+1})=i

By minimality of TT we get that bin⁡(fT)<i\operatorname{bin}(f_{T})<i (because bin⁡(f0)=0\operatorname{bin}(f_{0})=0). By Lemma 1.7, the update on date TT has type 1. By Lemma 1.5, we thus get that bin⁡(fT+1)=i\operatorname{bin}(f_{T+1})=i.

Next, we define even factorization and then show that a long even factorization implies that Anke wins the parity game.

An even factorization of length jj is a sequence 0≤t0<…<tj0\leq t_{0}<\ldots<t_{j} such that for every i∈0…j−1i\in 0\ldots j-1, the maximum of cti,cti+1,…,cti+1−1c_{t_{i}},c_{t_{i}+1},\ldots,c_{t_{i+1}-1} is even.

We next show that long even sequences exists.

For all NN, there is an even factorization of length at least bin⁡(fN)\operatorname{bin}(f_{N}).

If Anke wins the statistics game then she wins the parity game.

By definition of the statistics game, Anke can enforce the play to reach a statistic fN+1f_{N+1} such that k∈dom⁡(fN+1)k\in\operatorname{dom}(f_{N+1}).

If NN is chosen minimal then fN→cNfN+1f_{N}\to_{c_{N}}f_{N+1} is an update of type 1 by Corollary 1.9 on entry kk. Hence, fN+1f_{N+1} is defined on kk and fN+1(k)f_{N+1}(k) is even. This implies that bin⁡(fN+1)≥2k\operatorname{bin}(f_{N+1})\geq 2^{k}. According to Lemma 1.12, such a play has an even factorization t0<t1<…<tjt_{0}<t_{1}<\ldots<t_{j} of length bin⁡(fN+1)≥2k\operatorname{bin}(f_{N+1})\geq 2^{k}. Since 2k2^{k} is >> than twice the number of vertices, the play loops on the same vertex at some dates tit_{i} and ti′t_{i^{\prime}}, while having the same current player, with 0≤i<i′≤j0\leq i<i^{\prime}\leq j. By definition of even factorizations, the maximal priority on this loop is even. Thus Boris has no positional winning strategy in the parity game (because if he had followed it, no loop can have even maximal priority), and since parity games are positional , Boris has no winning strategy at all in the parity game.

Consider a fixed NN. Let x=bin⁡(fN)x=\operatorname{bin}(f_{N}). We will show that the following sequence t1,…,txt_{1},\dots,t_{x} is an even factorization.

For ease of notation, let tx+1=N+1t_{x+1}=N+1 (note that tx+1t_{x+1} is not part of the even factorization). For all j≤xj\leq x, let tj<tj+1t_{j}<t_{j+1} be the last date TT using rule 1 such that bin⁡(fT+1)=j\operatorname{bin}(f_{T+1})=j.

Sequence is well-defined. This sequence is well-defined because (1) on the first date TT where bin⁡(fT+1)≥j\operatorname{bin}(f_{T+1})\geq j we use rule 1 and bin⁡(fT+1)=j\operatorname{bin}(f_{T+1})=j, by Corollary 1.9; and (2) bin⁡(ftj+1)=j\operatorname{bin}(f_{t_{j+1}})=j (and hence a date T<tj+1T<t_{j+1} exists where bin⁡(fT+1)≥j\operatorname{bin}(f_{T+1})\geq j), which is true for j=xj=x by definition of tx+1t_{x+1} and otherwise follows from Lemma 1.5 because we use rule 1 on date tj+1t_{j+1} for j<xj<x.

Let T′∈{T,…,ti+1−1}T^{\prime}\in\{T,\dots,t_{i+1}-1\} be the first date such that bin⁡(fT′+1)≥i\operatorname{bin}(f_{T^{\prime}+1})\geq i. This is well-defined because we have that bin⁡(fti+1)=i\operatorname{bin}(f_{t_{i+1}})=i by Lemma 1.5 (since we use rule 1 on date ti+1t_{i+1}). Clearly T′>TT^{\prime}>T since bin⁡(fT+1)<i\operatorname{bin}(f_{T+1})<i by Claim 1. This also implies that bin⁡(fT′)<i\operatorname{bin}(f_{T^{\prime}})<i. We must thus make an update on date T′T^{\prime}. We cannot make an update of type 1 on date T′T^{\prime}, because bin⁡(fT′)<i≤bin⁡(fT′+1)\operatorname{bin}(f_{T^{\prime}})<i\leq\operatorname{bin}(f_{T^{\prime}+1}) would then imply that bin⁡(fT′+1)=i\operatorname{bin}(f_{T^{\prime}+1})=i by Lemma 1.5, which contradicts the choice of tit_{i} (since ti<T<T′<ti+1t_{i}<T<T^{\prime}<t_{i+1} as noted). We next argue that the update on date T′T^{\prime} cannot be of type 2 either which contradicts that an update have either type 1 or 2, shows that cc must be even and thus completes the proof of the lemma.

The update on date T′T^{\prime} is not of type 2

Time complexity of solving statistics games

A reachability game GG is a tuple (V,E,⊤)(V,E,\top), where VV is a set of nn vertices and E⊆V×VE\subseteq V\times V is a set of mm edges. The vertex ⊤∈V\top\in V is a the target vertex. The play starts in some initial vertex ss, player 1 and 2 alternatively select a vertex u∈{u∣(v,u)∈E}u\in\{u\mid(v,u)\in E\}. The play then continues to uu. If the play is ever in ww, the game ends and player 1 wins, otherwise player 2 wins.

If player 11 has a strategy to ensure a win from some vertex ss, then ss is called a winning vertex. The classical algorithm for reachability games GG is called backward induction and computes in time O(m)O(m) the set of winning vertices.

Statistics game as a reachability game

Given a parity game G=(V,E)G=(V,E), with MM priorities, nn vertices and mm edges, let k=⌈log⁡(n+1)⌉k=\lceil\log(n+1)\rceil be the maximum index in the corresponding statistics game. Denote Si,MS_{i,M} the set of statistics with MM priorities and ii being the highest possible index.

The corresponding statistics game is the reachability game with vertices V×Sk−1,M∪{⊤}V\times S_{k-1,M}\cup\{\top\}. For every edge (v,u)∈E(v,u)\in E and statistic update f→pty⁡(u)f′f\rightarrow_{\operatorname{pty}(u)}f^{\prime} with k∉dom⁡(f)k\not\in\operatorname{dom}(f), there is an edge from (v,f)(v,f) to (u,f′)(u,f^{\prime}) if k∉dom⁡(f′)k\not\in\operatorname{dom}(f^{\prime}) or to ww if k∈dom⁡(f′)k\in\operatorname{dom}(f^{\prime}).

A naïve upper complexity bound

According to Theorem 1.1, a vertex ss is winning in the parity game if and only if the vertex (s,∅)(s,\emptyset) is winning in the statistics game.

The statistics game has ≤n∣Sk−1,M∣+1\leq n|S_{k-1,M}|+1 vertices and ≤m∣Sk−1,M∣\leq m|S_{k-1,M}| edges and there is a naïve (M+1)⌈log⁡(n+1)⌉(M+1)^{\lceil\log(n+1)\rceil} upper bound on ∣Sk−1,M∣|S_{k-1,M}|. This gives a first straightforward upper bound on the complexity of solving parity games:

Tighter upper complexity bounds

We give tighter upper complexity bounds, starting with some bounds on ∣Si,M∣|S_{i,M}| for all i,Mi,M.

Each increasing function f:{1,…,x}→{1,…,y}f:\{1,\dots,x\}\rightarrow\{1,\dots,y\} has a 1-to-1 correspondence with subsets of size xx of {1,…,x+y−1}\{1,\dots,x+y-1\} as follows: Let SfS_{f} be the set {f(1),f(2)+1,…,f(x)+x−1}\{f(1),f(2)+1,\dots,f(x)+x-1\}. Observe that since ff is increasing, f(i)+i<f(i+1)+i+1f(i)+i<f(i+1)+i+1 for all ii. Thus SfS_{f} has exactly xx elements. On the other hand, every set S={1≤j0<⋯<jx}S=\{1\leq j_{0}<\dots<j_{x}\} corresponds to the function fS(z)=jz−z+1f_{S}(z)=j_{z}-z+1. The function fSf_{S} is increasing because ji>ji−1j_{i}>j_{i-1} for all ii. There are (x+y−1x){{x+y-1}\choose{x}} subsets of size xx of {1,…,x+y−1}\{1,\dots,x+y-1\}.

A partial increasing function is a increasing function in its domain. For a fixed ii, there are (x+1i){{x+1}\choose{i}} domains of size ii. Since each domain of size ii corresponds to the domain {1,…,i}\{1,\dots,i\} we can apply Lemma 2.1 and see that there are (i+y−1i){{i+y-1}\choose{i}} increasing functions for a fixed domain of size ii. Thus, there are ∑i=0x+1(x+1i)⋅(i+y−1i)\sum_{i=0}^{x+1}{{x+1}\choose{i}}\cdot{{i+y-1}\choose{i}} increasing partial functions f:{0,…,x}→{1,…,y}f:\{0,\dots,x\}\rightarrow\{1,\dots,y\} in total.

Hence, the time complexity of backwards induction on the statistics game is

Given a parity game with nn vertices, mm actions and max priority MM, the winner of each initial vertex can be found in time

Especially, for M≥ϵlog⁡2nM\geq\epsilon\log^{2}n, for some constant ϵ>0\epsilon>0, the winner can be found in O(m⋅n1.4427...nlog⁡(1+Mlog⁡n)⋅(1+Mlog⁡n))O(m\cdot n^{1.4427...}n^{\log(1+\frac{M}{\log n})}\cdot(1+\frac{M}{\log n})) time.

For M=log⁡nM=\log n, the winner can be found in time O(mnlog⁡2+12−1)=O(mn2.5431...)O\left(mn^{\log\frac{\sqrt{2}+1}{\sqrt{2}-1}}\right)=O(mn^{2.5431...}).

We will give an upper bound on O(m∑i=0k(ki)⋅(i+M−1i))O\left(m\sum_{i=0}^{k}{{k}\choose{i}}\cdot{{i+M-1}\choose{i}}\right).

Let g(i)=(ki)⋅(i+M−1i)g(i)={{k}\choose{i}}\cdot{{i+M-1}\choose{i}}. For i=ki=k we have that

Observe that 2k=2⌈log⁡(n+1)⌉<2log⁡(n+1)+1=2(n+1)2^{k}=2^{\lceil{\log(n+1)}\rceil}<2^{\log(n+1)+1}=2(n+1).

A trivial bound on (yx){{y}\choose{x}} for all x,yx,y is yx/x!y^{x}/x!. We thus get using Stirling’s approximation that

We first consider the case where M≥ϵk2M\geq\epsilon k^{2} for some constant ϵ>0\epsilon>0. Observe that g(k)g(k) is a factor ϵ\epsilon of g(k−1)g(k-1) for this choice of MM. Also, for 0<i<k0<i<k we have that g(i)/g(i−1)>(k−i)ϵg(i)/g(i-1)>(k-i)\epsilon. Thus, g(i)g(i) is decreasing geometrically (with a constant factor of at most 1/ϵ1/\epsilon) for k−1/ϵ>ik-1/\epsilon>i and increasing below that. But, 1/ϵ1/\epsilon is a constant and thus, ∑i=0kg(i)\sum_{i=0}^{k}g(i) is O(g(k))=O((k−1+Mk))=O(k−1/2⋅nlog⁡e+log⁡(1+(M−1)/k)⋅(1+M−1log⁡n))O(g(k))=O({{k-1+M}\choose{k}})=O(k^{-1/2}\cdot n^{\log e+\log(1+(M-1)/k)}\cdot(1+\frac{M-1}{\log n})). Hence, the time complexity is O(mlog⁡−1/2n⋅n1.4427...nlog⁡(1+M−1log⁡n)⋅(1+M−1log⁡n))O(m\log^{-1/2}n\cdot n^{1.4427...}n^{\log(1+\frac{M-1}{\log n})}\cdot(1+\frac{M-1}{\log n})) in this case.

Next we consider smaller values of M≥k+1M\geq k+1. Note that (yx){{y}\choose{x}} is geometrically increasing for a fixed yy for x<y/2x<y/2 and geometrically decreasing for x>y/2x>y/2. Also, (yy/2)≈2y/y{{y}\choose{y/2}}\approx 2^{y}/\sqrt{y}.

Note that the above argument basically finds the maximum of (ki){{k}\choose{i}} and (i−1+Mi){{i-1+M}\choose{i}} independently, i.e. without using that it is the same ii. Thus, one can give better bounds for especially specific values of MM as a function of kk. We see that g(i)g(i) keeps increasing until g(i)/g(i−1)≤1g(i)/g(i-1)\leq 1. Let i∗i_{*} be the smallest such ii.

We then get an upper bound on O(m∣Sk−1,M∣)O(m|S_{k-1,M}|) of

This bound is accurate upto a factor of k=O(log⁡n)k=O(\log n).

Thus, for instance, for M=k+1M=k+1, we have that i∗=k2i_{*}=\frac{k}{\sqrt{2}}. Inserting this into O(m⋅kg(i∗))O(m\cdot kg(i_{*})) we get that

where we used Stirling’s approximation for the inequality. We next consider the exponent of ee.

Inserting it back into the earlier expression, we get that the time complexity is

References