UP | HOME

Game

\( \renewcommand{\vec}[1]{\mathbf{#1}} \newcommand{\mat}[1]{\mathbf{#1}} \DeclareMathOperator{\argmax}{arg\,max} \DeclareMathOperator{\argmin}{arg\,min} \DeclareMathOperator{\pto}{\rightharpoonup} \DeclareMathOperator{\LIM}{LIM} \DeclareMathOperator{\nimplies}{\centernot\implies} \newcommand{\neimplies}{\rotatebox[origin=c]{30}{\(\implies\)}} \newcommand{\seimplies}{\rotatebox[origin=c]{-30}{\(\implies\)}} % set and topology \newcommand{\cl}[1]{\overline{#1}} \DeclareMathOperator{\diam}{diam} % algebra \DeclareMathOperator{\Hom}{Hom} \DeclareMathOperator{\Span}{Span} \DeclareMathOperator{\Ran}{Ran} \DeclareMathOperator{\Ker}{Ker} \DeclareMathOperator{\Nul}{Nul} \DeclareMathOperator{\Col}{Col} \DeclareMathOperator{\Row}{Row} \DeclareMathOperator{\Tr}{Tr} \DeclareMathOperator{\rank}{rank} \DeclareMathOperator{\proj}{proj} \DeclareMathOperator{\diag}{diag} % probability and statistics \DeclareMathOperator{\E}{\mathbb{E}} \DeclareMathOperator{\prob}{\mathbb{P}} \DeclareMathOperator{\indep}{\perp \!\!\! \perp} \DeclareMathOperator{\Var}{\mathbb{V}} \DeclareMathOperator{\Cov}{Cov} \DeclareMathOperator{\Cor}{Cor} % programs \newcommand{\sem}[1]{[\![ #1 ]\!]} \newcommand{\ans}[1]{[\![ #1 ]\!]} \DeclareMathOperator{\Val}{Val} \DeclareMathOperator{\Vars}{Vars} \DeclareMathOperator{\AExp}{AExp} \DeclareMathOperator{\BExp}{BExp} \DeclareMathOperator{\mAND}{\mathsf{and}} \DeclareMathOperator{\mOR}{\mathsf{or}} \DeclareMathOperator{\mNOT}{\mathsf{not}} \DeclareMathOperator{\mTRUE}{\mathsf{true}} \DeclareMathOperator{\mFALSE}{\mathsf{false}} \DeclareMathOperator{\mSKIP}{\mathsf{skip}} \DeclareMathOperator{\mWHILE}{\mathsf{while}} \DeclareMathOperator{\mDO}{\mathsf{do}} \DeclareMathOperator{\mOD}{\mathsf{od}} \DeclareMathOperator{\mIF}{\mathsf{if}} \DeclareMathOperator{\mFI}{\mathsf{fi}} \DeclareMathOperator{\mTHEN}{\mathsf{then}} \DeclareMathOperator{\mELSE}{\mathsf{else}} \DeclareMathOperator{\mFOR}{\mathsf{for}} \DeclareMathOperator{\mTERM}{\mathsf{Term}} \DeclareMathOperator{\mHALT}{\mathsf{Halt}} \DeclareMathOperator{\mBREAK}{\mathsf{Break}} \DeclareMathOperator{\mCONTINUE}{\mathsf{Continue}} \DeclareMathOperator{\mCOND}{\mathsf{cond}} \DeclareMathOperator{\mUNDEFINED}{\mathsf{undefined}} \)

1. Infinite-duration Two-player Games on Graphs

1.1. Basic Concepts

Games in which two players play forever.

A game graph or arena is a tuple \((V, V_1, V_2, E)\), where

  • \((V,E)\) is a finite directed graph,
  • \(V\) is partitioned into \(V_1\) and \(V_2\), which belong to the two players, respectively,
  • and every vertex has at least one out-going edge.

Given an initial vertex \(v \in V\), the game proceeds as follows: If the current vertex belongs to player \(i\), then player \(i\) choose one of the outgoing edges of \(v\) to transit to the next vertex.

Path
A path can be finite or infinite.

An outcome is an infinite path.

A winning objective or simply objective for a player is a set of outcomes. The player wins if the outcome is in the objective.

A game is zero-sum if the objective of one player is the complement of the objective of the other player.

1.2. Classical Objectives

Let \(\rho = \langle \rho_{0}, \rho_{1}, \dots \rangle\) be an infinite path. We denote the prefix of \(\rho\) starting from the \(i\)-th vertex by \(\rho[i \dots]\). Define:

  • \(visit(\rho) = \{ v \in V | \exists i, v = \rho_{i} \}\).
  • \(inf(\rho) = \{ v \in V | \nexists i, v \notin visit(\rho[i \dots ]) \} = \{ v \in V | \forall i, v \in visit(\rho[i \dots ]) \}\), nodes visited infinitely many times.

Let \(T\) be a subset of vertices, here are some of the classical objectives:

\(reach(T) = \{ \rho : visit(\rho) \cap T \neq \emptyset \}\). Paths that reach (some vertices of) \(T\).

\(safe(T) = \{ \rho : visit(\rho) \subseteq T \}\). These are paths that only traverse within \(T\).

\(Buchi(T) = \{ \rho : inf(\rho) \cap T \neq \emptyset \}\) Paths that visit (some vertices of) \(T\) for infinitely many times.

\(coBuchi(T) = \{ \rho : inf(\rho) \subseteq T \}\) Paths that visits vertices out of \(T\) only finitely many times. That is, the path enters \(T\) at some time and never leaves \(T\).

We can check that:

  • \(reach(T) = \overline{safe(V \setminus T)}\)
  • \(Buchi(T) = \overline{coBuchi(V \setminus T)}\)

Let a priority function \(p: V \to \{ 0, 1, \dots , d \}\). \(parity(p) = \{ \rho | \min \{ p(v) | v \in inf(\rho) \} \text{is even} \} \).

It is the most general objective we will study.

\(Buchi(T) = parity(p)\) where \(p(v) = 0\) for \(v \in T\) and \(p(v) = 1\) otherwise.

In this case, \(parity(p) = \{ \rho | \min \{ p(v) | v \in inf(\rho) \} = 0 \} = \{ \rho | \exists v \in inf(\rho), v \in T \} = Buchi(T)\).

\(coBuchi(T) = partity(p)\) where \(p(v) = 2\) for \(v \in T\) and \(p(v) = 1\) otherwise.

To find a priority function for coBuchi, we want \(\{ \rho : inf(\rho) \nsubseteq T \} = \{ \rho | \min \{ p(v) | v \in inf(\rho) \} \text{is odd} \}\). This hints that we set \(p(v)\) to be a smaller odd number for \(v \notin T\).

In general, \(partity(p) = \overline{parity(q)}\) for \(q = 1 + p\) (or \(q = 2k + 1 + p\) for \(k \in \mathbb{Z} \)).

We say an objective \(O\) is a tail objective if whenever \(\rho \in O\), we have \(\rho[i \dots ] \in O\) for every \(i\).

Parity objectives are tail objectives since finite prefix does not matter.

1.3. Strategy

A strategy for player \(i\) is a function \(\sigma_{i} : V ^{*} \times V_{i} \to V\), where \(V ^{*}\) represents the history (the portion of path visited) domain. Given history \(w\) and current vertex \(v\), the strategy outputs Player \(i\)’s chioce of the next vertex to visit \(\sigma_{i}(w, v)\) (this edge must exist in \(E\)).

The outcome is fixed given the initial vertex \(v\) and strategies of the two players \(\sigma_{1}, \sigma_{2}\). We denote it by \(Outcome(v, \sigma_{1}, \sigma_{2})\).

Only baesd on the current state. \(\sigma_{i}(w, v) = \sigma_{i}(w', v)\) for all paths \(w, w'\) and vertices \(v\). In this case, the type of \(\sigma_{i}\) could just be \(V_{i} \to V\).

If back to the same vertex, still make the same decision. \(\sigma_{i}(w, v) = \sigma_{i}(w', v)\) for all vertices \(v\) and paths \(w, w'\) such that \(w\) is a prefix of \(w'\), denoted by \(w \leq w'\).

Finite memory
not can memorize only finite number of steps, but only finite bits of memory.

A strategy \(\sigma_{1}\) for player \(1\) is called a winning strategy if for every strategy \(\sigma_{2}\) of player \(2\), we have \(Outcome(v, \sigma_{1}, \sigma_{2}) \in O_1\).

A strategy \(\sigma_{2}\) for player \(2\) spoils \(\sigma_{1}\) if \(Outcome(v, \sigma_{1}, \sigma_{2}) \notin O_1\).

Given an objective \(O_{i}\) for player \(i\), the winning set \(Win_{i}(O_{i})\) is the subset of vertices from which player \(i\) has a winning strategy (i.e., the other player has no spoiling strategy for this).

A game is determined if \(Win_{1}(O_1) = V \setminus Win_{2}(O_2)\).

1.4. Finding Winning Sets for Reachability Objectives

Suppose the objective for player 1 is \(reach(T)\). (Besides attractors and traps for this objective, I also include some related conclusions on winning strategies for player 2 and objective \(safe(V \setminus T)\).)

Suppose \(O_1 = reach(T), O_2 = safe(V \setminus T)\). An attractor is a set of initial vertices \(A = \cup A_{i}\) such that \(A_{i}\) are disjoint and, starting from every \(A_{i}\), the game immediately transits toward \(A_{i-1}\) and hence eventually to \(A_{0} = T\) and Player 1 will win (if the two players play the best). Formally, it is inductively defined as follows:

  • Base case \(A_0 = T\) (trivial)
  • Induction step: Assume \(A_{i}\) satisfies the property. Consider some initial vertex \(v\) that is not yet included.
    • If \(v\) belongs to Player 1 and Player 1 can choose to enter \(A_i\) immediately, then Player 1 can choose this transition and play the winning strategy for the initial vertex in \(A_{i}\) and win. We add \(v\) to \(A_{i+1}\).
    • If \(v\) belongs to Player 2 and Player 2 has no choice but enter \(A_{i}\), then, similarly, Player 1 can play the winning strategy for initial vertices in \(A_{i}\) and win. We add \(v\) to \(A_{i+1}\).
    • \(A_{i+1} = A_i \cup \{ v \in V_1 | Succ(v) \cap A_i \neq \emptyset \} \cup \{ v \in V_2 | Succ(v) \subseteq A_i \}\).
  • The process stops when \(A_{i+1} = \emptyset\).

By definition, \(A \subseteq Win_{1}(reach(T))\) and \(A \cap Win_{2}(safe(V \setminus T)) = \emptyset\).

We will soon see that they are equal. Intuitively, \(A_{i}\) consists of all vertices that can reach \(T\) in at most \(i\) steps, so any valid attractor must be included in some \(A_{i}\).

A trap for player 1 is a set \(C \subseteq V\) such that

  1. \(C \cap T = \emptyset\)
  2. If \(v \in C \cap V_1\), then \(Succ(v) \subseteq C\)
  3. If \(v \in C \cap V_2\), then \(Succ(v) \cap C \neq \emptyset\)

It is the set of initial vertices from which player 2 has strategy to guarantee the game stays in it, and hence never reaches \(T\). That is, \(C \subseteq Win_{2}(safe(V \setminus T))\) and \(C \cap Win_{1}(reach(T)) = \emptyset\).

We oftern use the term “a trap of player 1 in \(C\)” or “a trap of player 1 out of \(T\)”.

\(V \setminus A\) is a trap for player 1

  1. \(T \subseteq A \implies (V \setminus A) \cap T = \emptyset\).
  2. Suppose \(v \in (V \setminus A) \cap V_1\). If \(Succ(v) \nsubseteq V \setminus A\), i.e., \(Succ(v) \cap A \neq \emptyset\), then \(Succ(v) \cap A_{i} \neq \emptyset\) for some \(i\). In this case, \(v\) should have been added into \(A\), which is a contradiction. Thus, \(Succ(v) \subseteq V \setminus A\).
  3. Suppose \(v \in (V \setminus A) \cap V_2\). If \(Succ(v) \cap (V \setminus A) = \emptyset\), i.e., \(Succ(v) \subseteq A\), then we can partition \(Succ(v)\) to several sets such that each set \(\subseteq A_{i}\) for some \(A_{i}\). \(v\) should have been added into \(A\), which is a contradiction. Thus, \(Succ(v) \cap (V \setminus A) = \emptyset\).

Together, we have \(V \setminus A \subseteq Win_{2}(safe(V \setminus T))\), and \((V \setminus A) \cap Win_{1}(reach(T)) = \emptyset\). This implies that

\(A = Win_{1}(reach(T))\) and \(V \setminus A = Win_{2}(safe(V \setminus T))\).

Find \(A\) using a BFS:

\begin{algorithm}
\caption{Linear Algorithm for Finding Attractor}
\begin{algorithmic}
\STATE \(Q \gets T\)
\STATE \(A \gets \emptyset\)
\STATE \(SuccInA[v] \gets 0\) forall \(v \in V\)
\WHILE{$Q \neq \emptyset$}
\STATE Pop one vertex \(v\) from \(Q\)
\STATE \(A \gets A \cup \{ v \}\)
\FOR{$w \in Pred(v) \setminus A$}
\STATE \(SuccInA[w] \gets SuccInA[w] + 1\)
\IF{$w \in V_1$}
\STATE \COMMENT{corresponds to $\{ v \in V_1 | Succ(v) \cap A_i \neq \emptyset\}$}
\STATE \(Q \gets Q \cup \{ w \}\)
\ENDIF
\IF{$w \in V_2$ and $SuccInA[w] = outdeg(w)$}
\STATE \COMMENT{corresponds to $\{ v \in V_2 | Succ(v) \subseteq A_i \}$}
\STATE \(Q \gets Q \cup \{ w \}\)
\ENDIF
\ENDFOR
\ENDWHILE
\end{algorithmic}
\end{algorithm}

Running time:

  • Visits all vertices: \(O(n)\).
  • Visits all in-edges of \(A\): \(O(m)\).
  • Overall: \(O(n + m) = O(m)\).

1.5. Solving Buchi Games

Consider the zero-sum Buchi game with \(O_1 = Buchi(T)\) and \(O_2 = coBuchi(V \setminus T)\). We want to solve \(Win_{1}(O_1)\) and \(Win_{2}(O_2)\).

Given an arena \(G = (V, V_1, V_2, E)\) and a set \(W \subseteq V\), if every vertex in \(W\) has a successor in \(W\), then the subgame arena at \(W\) is defined as \(G_{W} = (W, V_{1} \cap W, V_2 \cap W, E \cap W \times W)\) (remain edges within \(W\) only).

The condition of having a successor is to ensure that the \(G_{W}\) satisfies the third requirement of arena, which is every vertex has at least one out-going edge.

We denote \(Attr_{i}(T) = Win_{i}(reach(T))\).

  • \(A = Attr_{1}(T)\) may not have a subgame arena: For \(v \in A_i\)m \(i = 1, 2, \dots \), it must have an edge to \(A_{i-1}\). However, \(v \in A_0 = T\) may not satisfy the conditoin. \(Attr_{1}(T)\) has a subgame arena iff every vertex in \(A_0 = T\) has a successor in \(Attr_{1}(T)\).
  • Any trap has a subgame arena: Check the definition. In particular, \(B = V \setminus Attr_{1}(T)\) has a subgame arena.
  • \(C = Attr_{2}(V \setminus Attr_{1}(T))\) has a subgame graph: The base case is a trap \(V \setminus Attr_{1}(T)\), and hence satisfies the condition.
  • Since \(V \setminus Attr_{2}(V \setminus Attr_{1}(T))\) is a trap for player 2, it also has a subgame arena.

1.5.1. Classical \(O(n m)\) Algorithm

Player 2 has a winning strategy (for \(coBuchi(V \setminus T)\)) starting from \(C = Attr_{2}(B)\), and hence player 1 does not have a winning strategy from the set. (\(C \subseteq Win_{2}(O_2)\)).

  • Player 2 first plays the strategy that reaches \(B\). During this process, the path can only reach \(T\) finitely many times.
  • Then play the strategy that stays in \(B\).
  • Since \(B \cap T = \emptyset\), the outcome visits \(T\) only finitely many times.

The following algorithm finds \(Win_{2}(coBuchi(V \setminus T))\) and \(Win_{1}(Buchi(V \setminus T))\): Mark all vertices in \(C\) as winning for Player 2, and recursively solve the subgame at \(V \setminus C\) with objective \(O_1 = Buchi(T \setminus (T \cap C))\). Formally:

\begin{algorithm}
\caption{Classical Algorithm for Finding coBuchi Winning Set}
\begin{algorithmic}
\STATE \(T_0 = T, G_0 = G, W_2 = \emptyset\)
\FOR{$j=0$ to $\infty$}
\STATE \(A_{j} = Attr_{1}(T_{j}, G_{j})\)
\STATE \(B_{j} = V_{j} \setminus A_{j}\)
\STATE \(C_{j} = Attr_{2}(B_{j})\)
\STATE \(W_2 = W_2 \cup C_{j}\)
\STATE \(V_{j+1} = V_{j} \setminus C_{j}\)
\STATE \(T_{j+1} = T_{j} \setminus C_{j}\)
\STATE \(G_{j+1} = G[V_{j+1}]\)
\IF{$C_{j} = \emptyset$}
\STATE break
\ENDIF
\ENDFOR
\end{algorithmic}
\end{algorithm}

\(Win_{2}(coBuchi(V \setminus T)) = W_2\) and \(Win_{1}(Buchi(T)) = V \setminus W_2\).

We first show that, in each iteration, it is “safe” to keep the subgame at \(V \setminus C\) only (subscript omitted), i.e., the game starting from \(V \setminus C\) will remain in \(V \setminus C\) if both players play the best. (Note that this does not include edges across \(C\) and \(V \setminus C\) either). Consider any initial vertex in \(V \setminus C\):

  • Since player 2 can definitely win in \(C\), player 1 wants to avoid entering \(C\).
  • \(V \setminus C\) is a trap for player 2, so player 1 does have a strategy to keep the game in \(V \setminus C\).
  • Also, \(V \setminus C\) induces a subgame arena.

Then we show that player 1 has a winning strategy in \(V \setminus W_2\). Suppose the loop breaks at \(C_{n} = \emptyset\), i.e., \(Attr_{2}(B_{n}) = \emptyset\). The \(B_{n}\) must be \(\emptyset\), since \(Attr_{2}(B_{n}) \supseteq B_{n}\). Thus, \(A_{n} = V_{n} = V \setminus W_2\). Then, \(V \setminus W_2\) playes two roles:

  • It is a trap \(V_{n} = V_{n-1} \setminus C_{n-1}\): Recall from the beginning of this proof, the game will remain in \(G_{n}\) starting from \(V \setminus W_2\).
  • It is the attractor \(Attr_{1}(T_{n}, G_{n})\): Player 1 has a strategy to reach \(T_{n}\) (not only in \(G_{n}\), but also in the entire graph). The state either:

    • is in \(V_{n} \setminus T_{n}\), player 1 play the strategy to reach \(T_{n}\),
    • or stays in \(T_{n}\) for a while and then enter \(V_{n} \setminus T_{n}\) again.

    So player 1 has a winning strategy (for \(Buchi(T)\)) and player 2 does not (for \(coBuchi(V \setminus T)\)).

Buchi game is determined, \(Win_{1}(O_1) = V \setminus Win_{2}(O_2)\) (\(V \setminus W_2\)):

Both winning strategies for player 1 and player 2 are memoryless: Their strategies can be decomposed into many stages of reachability strategies, which are memoryless.

Runtime of the algorithm: \(O(m)\) (attractor algorithm) for each iteration. At most \(n\) iteration. Overall \(O(nm)\).

Solving \(O_1 = coBuchi(T)\): \(O_2 = Buchi(V \setminus T)\). Solve \(O_2\) using the algorithm.

1.5.2. Faster \(O(n ^2)\) Algorithm

More detailed analysis of the classical algorithm:

  • The running time for set operations on vertices sums up to \(O(n ^2)\).

The total running time for finding all \(C_{j} = Attr_{2}(B_{j}, G_{j})\) (and removing relevant vertices and edges to derive \(G_{j}\)) is \(O(m)\).

In the process of finding \(C_{j} = Attr_{2}(B_{j}, G_{j})\), all the vertices in \(C_{j}\) and their in-edges are visited.

Then it removes all edges incident on these vertices, i.e., all in-edges and out-edges.

Thus, every edge is visited \(O(1)\) times.

  • The bottleneck is \(Attr_{1}(T_{j}, G_{j})\).

Notice that the only property of \(B\) we use is that it is a trap of player 1 out of \(T\). We took \(B\) as the largest such trap, namely \(V \setminus A\), but actually it can be any trap out of \(T\).

Let \(E' \subseteq E\), a set \(S \subseteq V\) is an \(E'\)-trap of player 1 outside \(T\) if

  • \(T \cap S = \emptyset\)
  • For every \(v \in S \cap V_2\), there is an outgoing edge \((v, w) \in E'\) with \(w \in S\)
  • For every \(v \in S \cap V_1\), for every outgoing edge \((v, w)\), \((v, w) \in E'\) and \(w \in S\).

It is a set of vertices from which player 2 has a strategy to restrict the state in the set and in the subgraph \(E'\) when playing in the entire arena. It is not the same as a trap of player 1 outside \(T\) when playing in the subgame arena \((V, E')\).

We can use an algorithm similar to the reachability algorithm to find the maximum \(E'\)-trap:

\begin{algorithm}
\caption{Linear Algorithm for Finding Subgraph Trap}
\begin{algorithmic}
\STATE \(Q \gets T \cup \{ v \in V | \exists (v, w), (v, w) \notin E' \}\) \COMMENT{change}
\STATE \(A \gets \emptyset\)
\STATE \(SuccInAE'[v] \gets 0\) forall \(v \in V\)
\WHILE{$Q \neq \emptyset$}
\STATE Pop one vertex \(v\) from \(Q\)
\STATE \(A \gets A \cup \{ v \}\)
\FOR{$w \in Pred(v, E') \setminus A$}
\STATE \COMMENT{change}
\STATE \(SuccInAE'[w] \gets SuccInAE'[w] + 1\)
\IF{$w \in V_1$}
\STATE \(Q \gets Q \cup \{ w \}\)
\ENDIF
\IF{$w \in V_2$ and $SuccInAE'[w] = outdeg(w, E')$}
\STATE \(Q \gets Q \cup \{ w \}\)
\ENDIF
\ENDFOR
\ENDWHILE
\STATE \(S \gets V \setminus A\)
\end{algorithmic}
\end{algorithm}

It is basically the complement of the “\(E'\)-attractor” to the union of \(T\) and player 1-vertices which have an outgoing edges not in \(E'\). Again, we cannot simply apply the previous algorithm to the subgame \((V, E')\).

Hierarchical Decomposition:

  • Order the edges in \(E\) such that edges \((u, v)\) with \(u \in V_2 \setminus T\) are prior to others.
  • Define the graphs \(G_0, G_1, \dots , G_{O(\log n)}\) as follows: \(G_{i} = (V, E_{i})\) where \(E_{i}\) includes the edge \((u, v) \in E_{i}\) if and only if at least one of the followings holds:

    • Out degree of \(u\) in \(E\) is \( \leq 2 ^{i}\),
    • \((u, v)\) is one of the first \(2 ^{i}\) in-edges of \(v\) (w.r.t. the order defined above)

    Every vertex in \(G_{i}\) has at most \(2 ^{i}\) out-edges and \(2 ^{i}\) in-edges in \(E_{i}\), so \(G_{i}\) has at most \(n \cdot 2 ^{i+1} = O(n 2 ^{i})\) edges.

  • The last subgraph is just the original graph.

Coloring Vertices:

  • Low-degree vertices, i.e. those with an outdegree of at most \(2 ^{i}\) in \(G\), are colored white.
  • High-degree vertices, i.e. those with an outdegree of more than \(2 ^{i}\) in \(G\), are colored blue if they belong to player 1 or colored red if they belong to player 2.

Let \(X_{i}\) be the set of vertices that are

  • either blue in \(G_{i}\)
  • or red in \(G_{i}\) with no outgoing edges in \(G_{i}\).

Then \(X_{i}\) is the set of all the vertices from which player 1 has a strategy to leave \(G_{i}\) (visit edges that are not in \(E_{i}\)).

  • White vertices in \(G_{i}\) have all its out-edges in \(E_{i}\)
  • Red vertices in \(G_{i}\) with some out-edge in \(E_{i}\): Player 2 can choose the edge to remain in \(G_{i}\).
  • Type-1 vertices in \(X_{i}\): must have some out-edge not included in \(E_{i}\), so player 1 can choose the edge to leave.
  • Type-2 vertices in \(X_{i}\): must have all outgoing edges outside \(E_{i}\), so player 2 has no choice but leave.

The following algorithm finds a trap of player 1 outside of \(T\). In addition, let \(k\) be the size of the found trap, then the algorithm takes \(O(n k)\) time:

\begin{algorithm}
\caption{Algorithm for Finding Trap}
\begin{algorithmic}
\FOR{$i = 0$ to $\log_{n}$}
%\STATE Try to find an \(E_{i}\)-trap \(S_{i}\) for player 1 out of \(T \cup X_{i}\).
\STATE Try to find an \(E_{i}\)-trap \(S_{i}\) for player 1 out of \(T\).
\IF{such $S_{i}$ is found}
\STATE Output as the trap
\STATE break
\ENDIF
\ENDFOR
\IF{no trap has been ever found}
\STATE Report no trap is found
\ENDIF
\end{algorithmic}
\end{algorithm}

By definition, an \(E'\)-trap of player 1 is an \(E\)-trap of player 1.

Suppose we find a trap \(S_{i}\) in the \(i\)-th iteration. We claim \(|S_{i}| \geq 2 ^{i - 1}\). We prove by casework on the color of player 1 vertices in the previous graph:

  • Case 1: There is a player 1 vertex \(u \in S_{i}\) that used to be blue in \(G_{i-1}\).

    • Then \(u\) has an outdegree more than \(2 ^{i-1}\) in \(G\).
    • By definition, all the successors of \(u\) should be in the trap.

    So the size of the trap is at least \(2 ^{i-1}\).

  • Case 2: All player 1 vertices in \(S_{i}\) used to be white in \(G_{i-1}\).

    • Then for every player 1 vertex in \(S_{i}\), all of its outgoing edges are in \(E_{i-1}\) and \(E_{i}\).
    • Then we claim that there exists a player 2 vertex \(u \in G_{i}\) and another \(v \in S_{i}\), such that the edge \((u, v)\) is present in \(G_{i}\) in but not in \(G_{i-1}\). If is is not the case, i.e., for every player 2 vertex \(\in S_{i}\) and every vertex in \(S_{i}\), if there is an edge between them, then the edge is also in \(G_{i-1}\). Then we can check that the conditions for the presense of a \(E_{i-1}\)-trap are met, which is a contradiction.
    • Consider the predecessors of \(v\):
      • Since \((u, v)\) is new in \(S_{i}\), it must be ranked between \(2 ^{i-1}+1\) to \(2 ^{i}\) among all in-edges of \(v\).
      • Since \(u\) is in a trap, \(u \in V_2 \setminus T\). Thus, \(\forall (u', v) \in G_{i}\) such that \((u', v)\) is prior to \((u, v)\), \(u'\) must also be in \(V_2 \setminus T\).
      • These predecessors belong to player 2 and have an edge to \(v\), so they are included in (the largest possible) trap \(S_{i}\).

    So the size of the trap is at least \(2 ^{i-1}\).

In summary, the algorithm finds a trap of size \( \geq 2 ^{i-1}\) in \(O(2 ^{i} n)\) time. In other words, it can find a trap of size \(k\) in \(O(n k)\) (\(k\) is the size of the actual trap it found).

The faster algorithm:

\begin{algorithm}
\caption{Classical Algorithm for Finding coBuchi Winning Set}
\begin{algorithmic}
\STATE \(T_0 = T, G_0 = G, W_2 = \emptyset\)
\FOR{$j=0$ to $\infty$}
\STATE \(A_{j} = Attr_{1}(T_{j}, G_{j})\)
\STATE \(B_{j} = \) a trap of size \(k\) computed by the hierarchical decomposition algorithm
\STATE \(W_2 = W_2 \cup C_{j}\)
\STATE \(V_{j+1} = V_{j} \setminus C_{j}\)
\STATE \(T_{j+1} = T_{j} \setminus C_{j}\)
\STATE \(G_{j+1} = G[V_{j+1}]\)
\IF{$C_{j} = \emptyset$}
\STATE break
\ENDIF
\ENDFOR
\end{algorithmic}
\end{algorithm}

Running time: Since \(C_{j} \supseteq B_{j}\) is removed from \(V_{j}\), all \(k\)’s add up to \(O(n)\), the overall running time is \(O(n ^2 + m) = O(n ^2)\).

1.6. Solving Parity Games

Consider a zero-sum game with \(O_1 = parity(p)\) and \(O_2 = parity(p + 1)\), where \(p: V \to \{ 0, 1, \dots , d \}\).

W.l.o.g., we can assume that

  • either 0 or 1 appears in the priorities: If not, can shift all priorities to the left by 2.
  • priorities are contiguous: If not, we can shift any priority to the left by some multiple of 2 as long as it does not become less than the previous priority. More explicitly,
    • if the two adjacent priorities differ by some multiple of 2, then we can merge the larger one into the smaller one,
    • if the two adjacent priorities differ by some multiple of 2 plus 1, then we can shift the larger one to become the smaller one plus 1.
  • When there are more than two priorities, w.l.o.g., priority 0 appears in the game, because we can solve \(O_2 = parity(p-1)\).

Parity game is determined and both players have memoryless winning strategies.

We prove by induction on the number of priorities \(d\).

Base cases:

  • If there is only one priority, then the game is determined and the strategies do not matter.
  • If there are only two priorities, then the parity game is either a Buchi game (\(\{ 0, 1 \}\)) or a coBuchi game (\(\{ 1, 2 \}\)).

Induction step: Assume any parity game with \(d\) priorities \(\{ 0, 1, \dots , d-1 \}\) is memoryless and determined. We want to show that any game with \(d+1\) priorities \(\{ 0, 1, \dots , d \}\) is memoryless and determiend by diminishing priority 0 in the current game.

  1. Firstly, we find \(Win_{2}(O_2)\):
    • Let \(P_0 = \{ v \in V | p(v) = 0 \} \subseteq V\).
    • Let \(A = Attr_{1}(P_0)\) and \(B = V \setminus A\) (trap of player 1 out of \(P_0\)).
    • \(B\) has a subgame and the subgame does not have any priority 0 vertex. By induction, the subgame with the same objectives is determined and memoryless. Let \(B_1, B_2\) be the winning sets of player 1 and 2, respectively, in the subgame at \(B\).
    • Player 2 has a winning strategy in the original game from \(B_2\): Play the strategy that traps the game in \(B\) and the same winning strategy as in the subgame.
    • Player 2 has a winning strategy in the original game from \(C = Attr_{2}(B_2)\): First play the strategy that reaches \(B_2\) in finitely many steps, then play the above strategy. The finitely many steps does not affect the parity (See Tail Objective).
    • The winning strategies above are memoryless.
    • Mark all vertices in \(C\) as winning starting vertices for player 2. And continue recursively on the subgame at \(V \setminus C\). The argument is exactly the same as Buchi games.
  2. Secondly, we show that \(Win_{1}(O_1) = V \setminus Win_{2}(O_2)\).
    • The process continues until \(C = \emptyset, B_2 = \emptyset, B = B_1\). We use the same notation for \(P_0, A\). Consider this strategy for player 1: if the current state is in \(B\), then play the winning strategy as in the subgame; if the current state is in \(A\), then play the winning strategy for objective \(Reach(P_0)\). Then no matter what strategy player 2 plays, player 1 can always win:
      • By definition, if player 2 keeps the game in \(B = B_1\), player 2 will loss and player 1 will win (determinanc in \(B\)).
      • Since the objective is a tail objective, if player 2 keeps the game in \(B\) after finitely many steps, player 2 will still loss and player 1 will win (determined in \(B\)).
      • Otherwise, player 2 does not keep the game in \(B\) for infinitely many time, i.e., the game enters \(A\) for infinitely many times. Everytime the game is in \(A\), player 1 play with strategy for objective \(Reach(P_0)\). Thus, player 1 can reach priority 0 for infinitely many times. In this case, player 1 still win.
  3. This shows that the game is determined and memoryless.

Running time:

  • \(T(n, m, d) \leq n (T(n, m, d-1) + O(m))\): There are \(O(n)\) iterations, each of which needs to solve a parity game with \(d-1\) priorities and finds attractors.
  • Base case: \(T(n, m, 2) = O(n m)\) (Buchi).
  • \(T(n, m, d) = O(n ^{d-1} m)\).