Parity and Streett Games with Costs

We consider two-player games played on finite graphs equipped with costs on edges and introduce two winning conditions, cost-parity and cost-Streett, which require bounds on the cost between requests and their responses. Both conditions generalize the corresponding classical omega-regular conditions and the corresponding finitary conditions. For parity games with costs we show that the first player has positional winning strategies and that determining the winner lies in NP and coNP. For Streett games with costs we show that the first player has finite-state winning strategies and that determining the winner is EXPTIME-complete. The second player might need infinite memory in both games. Both types of games with costs can be solved by solving linearly many instances of their classical variants.


Introduction
In recent years, boundedness problems arose in topics pertaining to automata and logics leading to the development of novel models and techniques to tackle these problems. Although in general undecidable, many boundedness problems for automata turn out to be decidable if the acceptance condition can refer to boundedness properties of variables, but the transitions cannot access variable values. A great achievement was made by Hashiguchi [19] who proved decidability of the star-height problem by reducing it to a boundedness problem for a certain type of finite automaton and by then solving this problem. This led the path to recent developments towards a general theory of bounds in automata and logics, comprising automata and logics with bounds [2,4], satisfiability algorithms for these logics [2,5,27], and regular cost-functions [12].
In this work, we consider boundedness problems in turn-based two-player graph games of infinite duration. We introduce cost-parity and cost-Streett conditions which generalize the (classical) ω-regular parity-respectively Streett condition, as well as the finitary parity-respectively finitary Streett condition [9]. While both finitary variants strengthen the classical conditions by adding bounds, ⋆ A preliminary version of this work appeared in FSTTCS 2012 under the name "Cost-parity and Cost-Streett Games" [18]. The research leading to these results has received funding from the European Union's Seventh Framework Programme the complexity of solving these games diverges: (in the state of the art) finitary parity games are simpler than parity games, while finitary Streett games are harder than Streett games. Indeed, solving finitary parity games can be carried out in polynomial time [9], while no polynomial-time algorithm for parity games is yet known, and the decision problem for parity games is in NP ∩ coNP. The situation is reversed for Streett games, since solving them is coNP-complete [16] while solving finitary Streett games is EXPTIME-complete. The latter result is shown in unpublished work by Chatterjee, Henzinger, and Horn: by slightly modifying the proof of EXPTIME-hardness of solving request-response games presented in [10] they prove EXPTIME-hardness of solving finitary Streett games.
A game with cost-parity condition is played on an arena whose vertices are colored by natural numbers, and where traversing an edge incurs a non-negative cost. Player 0 wins a play if there is a bound b such that all but finitely many odd colors seen along the play (which we think of as requests) are followed by a larger even color (which we think of as responses) that is reached with cost at most b. The definition of the cost-Streett condition goes along the same lines, but the requests and responses are independent and not hierarchically ordered as in parity conditions. The cost of traversing an edge can be used to model the consumption of a resource. Thus, if Player 0 wins a play she can achieve her goal along an infinite run with bounded resources. On the other hand, Player 1's objective is to exhaust the resource, no matter how big the capacity is. Note that this is not an ω-regular property, which is witnessed by the fact that Player 1 needs infinite memory to win such games.
Since the term "cost-parity games" has been used before [12,13,27], we refer to games with cost-parity conditions as parity games with costs. There are two main differences between cost-parity games and parity games with costs as introduced here. First, the bound quantification in cost-parity games requires the counter values to be uniformly bounded over all paths, whereas in parity games with costs the bound can depend on the path. Second, in cost-parity games the counters and the parity conditions are independent, whereas in parity games with costs the counters are used to give a quantitative measure of the satisfaction of the parity condition.
We show that parity games with costs enjoy two nice properties of parity and finitary parity games: Player 0 has memoryless winning strategies and determining the winner lies in NP ∩ coNP. Furthermore, we show that solving parity games with costs can be algorithmically reduced to solving parity games, which allows to solve these games almost as efficiently as parity games. We then consider Streett games with costs and prove that Player 0 has finite-state winning strategies, and that determining the winner is EXPTIME-complete. Our complexity results unify the previous results about finitary parity and Streett games and the results about their classical variants.
To obtain our results, we present an algorithm to solve parity games with costs that iteratively computes the winning region of Player 0 employing an algorithm to solve parity games. This "reduction" to parity games also yields finite-state winning strategies for Player 0 in parity games with costs. However, this can be improved: by exploiting the intrinsic structure of the memory introduced in the reduction, we are able to prove the existence of positional winning strategies for Player 0. We also give a second proof of this result: we show how to transform an arbitrary finite-state winning strategy into a positional one. This construction relies on so-called scoring functions (which are reminiscent of the simulation of alternating tree-automata by non-deterministic automata presented in [25] and of scoring functions for Muller games [23]) and presents a general framework to turn finite-state strategies into positional ones, which we believe to be applicable in other situations as well. Finally, we present an algorithm that solves Streett games with costs by solving Streett games. Here, we show the existence of finite-state winning strategies for Player 0 in Streett games with costs.
In our proofs, we reduce games with boundedness winning conditions to games with ω-regular winning conditions. The solution of the domination problem for regular cost-functions on finite trees [13] uses a similar approach. But in contrast to this work, which is concerned with proving decidability of a stronger formalism, we are interested in efficient algorithms. Hence, we need a more sophisticated reduction and a careful analysis of the memory requirements.
Adding quantitative requirements to qualitative winning conditions has been an active field of research during the last decade: much attention is being paid to not just synthesize some winning strategy, but to find an optimal one according to a certain quality measure, e.g., the use of mean-payoff objectives and weighted automata to model quantitative aspects in the winning condition [1,7,11]. For request-response games and their extensions waiting times between requests and their responses are used to measure the quality of a strategy and it was shown how to compute optimal (w.r.t. the limit superior of the mean waiting time) winning strategies [20,29]. However, the optimal finite-state strategies that are obtained are exponentially larger than the ones computed by the classical algorithm.
Finally, there has been a lot of interest in so-called energy games, whose winning conditions are boundedness requirements on the consumption of resources. Solving energy games with multiple resources is in general intractable [17] while so-called consumption games, a subclass of energy games, are shown to be tractable in [6]. Furthermore, energy parity games, whose winning conditions are a conjunction of a (single resource) energy and a parity condition, can be solved in NP ∩ coNP and one player (the spoiling one) has positional winning strategies while the other one needs exponential memory [8]. Although the first two results are similar to our results on parity games with costs, the energy parity condition does not relate the energy consumption to the parity condition. In contrast, the costs in parity games with costs give a qualitative measure of the satisfaction of the parity condition.
The paper is organized as follows. In Section 2, we define the necessary material related to games and introduce cost-parity and cost-Streett conditions, as well as their bounded variants. In Section 3, we study bounded parity games with costs, providing an algorithm to solve them and tight memory requirements for winning strategies. In Section 4, we show how to reduce the problem of solving parity games with costs to the problem of solving bounded parity games with costs. In Section 5, we give a different proof of the existence of positional strategies for (bounded) parity games with costs, via scoring-functions. In Section 6, we study Streett games with costs.
An arena A = (V, V 0 , V 1 , E) consists of a finite, directed graph (V, E) and a partition {V 0 , V 1 } of V into the positions of Player 0 (drawn as circles) and the positions of Player 1 (drawn as rectangles). A play in A starting in v ∈ V is an infinite path ρ = ρ 0 ρ 1 ρ 2 · · · through (V, E) such that ρ 0 = v. To avoid the nuisance of dealing with finite plays, we assume every vertex to have an outgoing edge.
A game G = (A, Win) consists of an arena A and a set Win ⊆ V ω of winning plays for Player 0. The set of winning plays for Player 1 is V ω \ Win. We say that Win is prefix-independent, if ρ ∈ Win if and only if wρ ∈ Win for every finite play prefix w and every infinite play ρ.
A strategy for Player i is a mapping σ : We often view positional strategies as mapping σ : V i → V . A play ρ 0 ρ 1 ρ 2 . . . is consistent with σ if ρ n+1 = σ(ρ 0 · · · ρ n ) for every n with ρ n ∈ V i . A strategy σ for Player i is a winning strategy from a set of vertices W ⊆ V if every play that starts in some v ∈ W and is consistent with σ is won by Player i. The winning region W i (G) of Player i in G is the set of vertices from which Player i has a winning strategy. We say that a strategy is uniform, if it is winning from all v ∈ W i (G). We always have W 0 (G) ∩ W 1 (G) = ∅. On the other hand, if W 0 (G) ∪ W 1 (G) = V , then we say that G is determined. All games we consider in this work are determined. Solving a game amounts to determining its winning regions and winning strategies.
and every play ρ in G is won by the player who wins the extended play ρ ′ in G ′ , i.e., ρ ∈ Win if and only if ρ ′ ∈ Win ′ . Lemma 1 Let G be a game with vertex set V and W ⊆ V . If G ≤ M G ′ and Player i has a positional winning strategy for G ′ from {(v, Init(v)) | v ∈ W }, then she has a finite-state winning strategy for G from W which is implemented by M.
Especially, if Player i has a uniform positional winning strategy for G ′ , then she has a uniform finite-state winning strategy for G that is implemented by M. Let Player i has a (positional) strategy such that every play that starts in Attr A i (F ) and is consistent with the strategy visits F . Such strategies are called attractor strategies.
A trap for Player i is a set X of vertices such that the successors of every vertex in X ∩ V i are again in X and every vertex in X ∩ V 1−i has a successor in X. Player 1 − i has a (positional) strategy such that every play that starts in a trap X and is consistent with the strategy stays in X forever. The complement of an attractor Attr A i (F ) is a trap for Player i. Furthermore, removing an attractor from an arena never introduces terminal vertices.
The following observation will be useful later: if the sets of winning plays Win in G is prefix-independent, then we have W i (G) = Attr A i (W i (G)) and W i (G) is a trap for Player 1 − i. Furthermore, no play consistent with a winning strategy for Player i will ever leave W i (G).

Winning Conditions
In this subsection, we present the winning conditions we consider in this paper. Fix an arena A with set of edges E. A cost-function for A is an edgelabelling Cst : E → {ε, i}. An edge with label i is called an increment-edge, and edges labelled by ε are called accordingly ε-edges. We extend the edge-labelling to a cost-function over finite and infinite paths obtained by counting the number of increment-edges traversed along the path. Note that we only allow zero and one as cost. Another option would be to allow arbitrary costs in N but since all our results depend only on whether an edge has cost zero or not, we refrain from doing this.
Cost-Parity Conditions Let A = (V, V 0 , V 1 , E) be an arena and let Ω : V → N be a coloring of its vertices by natural numbers. In all games we are about to define in this subsection, we interpret the occurrence of a color as request, which has to be answered by visiting a vertex of larger even color at a later position. By imposing conditions on the responses we obtain several different types of winning conditions. To simplify our notations, let Ans(c) = {c ′ ∈ N | c ′ ≥ c and c ′ even} be the set of colors that answer a request of color c. Note that Ans(c) ⊆ Ans(c ′ ) for c ≥ c ′ and c ∈ Ans(c) if c is even.
Fix a cost-function Cst and consider a play ρ = ρ 0 ρ 1 ρ 2 · · · and a position k ∈ N. We define the cost-of-response at position k of ρ by where we use min ∅ = ∞, i.e., Cor Cst (ρ, k) is the cost of the infix of ρ from position k to its first answer, and ∞ if there is no answer.
We say that a request at position k is answered with cost c, if Cor Cst (ρ, k) = c. Note that a request at a position k with an even color is answered with cost zero. Finally, we say that a request at position k is unanswered with cost ∞, if there is no position k ′ ≥ k such that Ω(ρ k ′ ) ∈ Ans(Ω(ρ k )) and we have Cst(ρ k ρ k+1 · · · ) = ∞, i.e., there are infinitely many increment-edges after position k, but no answer.
We begin defining winning conditions by introducing the parity condition, denoted by Parity(Ω), which requires that all but finitely many requests are answered. Equivalently, ρ ∈ Parity(Ω) if and only if the maximal color that occurs infinitely often in ρ is even. Both players have uniform positional winning strategies in parity games [15,24] and their winning regions can be decided in NP ∩ coNP.
By bounding the costs between requests and their responses, we strengthen the parity condition and obtain the cost-parity and the bounded cost-parity condition. The former is defined as i.e., ρ satisfies the cost-parity condition, if there exists a bound b ∈ N such that all but finitely many requests are answered with cost less than b.
The bounded cost-parity condition, denoted by BndCostParity(Ω, Cst), is again obtained by a strengthening: ρ ∈ BndCostParity(Ω, Cst) if there exists a bound b ∈ N such that all but finitely many requests are answered with cost less than b, and there is no unanswered request of cost ∞. Note that this is not equivalent to requiring that there exists a bound b ′ ∈ N such that all requests are answered with cost less than b ′ (e.g., if there are unanswered requests in a play with finitely many increment-edges).
A game G = (A, CostParity(Ω, Cst)) is called a parity game with costs, and a game with winning condition is a bounded parity game with costs. Note that both cost-conditions defined here generalize the classical parity conditions as well as the finitary respectively bounded parity conditions [9]. Indeed, if A contains no increment-edges, then the three conditions are equivalent, i.e., CostParity(Ω, Cst) = BndCostParity(Ω, Cst) = Parity(Ω) .
On the other hand, if A contains no ε-edges, then CostParity(Ω, Cst) is equal to the finitary parity condition over Ω and BndCostParity(Ω, Cst) is equal to the bounded parity condition over Ω. Hence, parity games with costs generalize both parity and finitary parity games. Similarly, bounded parity games with costs generalize both parity and bounded parity games.
Since (bounded) cost-parity conditions can be shown to be on the third level of the Borel hierarchy, we obtain the following result as a consequence of the Borel determinacy theorem [22]. Figure 1 where all vertices belong to V 1 , and the label of a vertex denotes its name (in the upper part) and its color (in the lower part). Player 1 wins from {a, b, c} by requesting color 1 at vertex a infinitely often and staying at vertex b longer and longer, but also visiting c infinitely often (and thereby answering the request). Note that this strategy is not finite-state. Indeed, one can easily prove that Player 1 does not have a finite-state winning strategy for this game. Player 0 wins from every other vertex, since Player 1 can raise only finitely many requests from these vertices, albeit these requests are unanswered with cost ∞.

Example 1 Consider the parity game with costs depicted in
If we consider the game as a bounded parity game with costs, then Player 1 wins from every vertex but g by moving to g and then staying there ad infinitum. Every such play contains a request of color 1 that is unanswered with cost ∞. From g, Player 0 wins, since there is only one play starting from g, in which no request is ever raised.

Cost-Streett Conditions Fix an arena
be a collection of d cost-functions for A. We think of visits to vertices in Q c as requests, visits to P c as responses, and measure the cost of these responses using Cst c . Formally, for c ∈ [d], a play ρ = ρ 0 ρ 1 ρ 2 · · · , and a position k we define where we use min ∅ = ∞. We define StCor Cst (ρ, k) = max{StCor Cstc (ρ, k) | c ∈ [d]} and say that the requests at position k are answered with cost c, if StCor Cst (ρ, k) = c, and that the requests are unanswered with cost ∞, if StCor Cst (ρ, k) = ∞ and there are infinitely many increment-edges after position k (w.r.t. some Cst c such that ρ k ∈ Q c ). We consider the following winning conditions. The (classical) Streett condition Streett(Γ ) requires for every c that P c is visited infinitely often if Q c is visited infinitely often, i.e., all but finitely many requests are answered.
Again, by requiring a bound on the costs between requests and responses, we strengthen the Streett condition: the cost-Streett condition requires the existence of a bound b such that all but finitely many requests are answered with cost less than b.
Finally, the bounded cost-Streett condition BndCostStreett(Γ, Cst) requires the existence of a bound b such that all but finitely many requests are answered with cost less than b, and that there is no unanswered request of cost ∞.
A game (A, CostStreett(Γ, Cst)) where Γ and Cst have the same size is called a Streett game with costs. As for (bounded) cost-parity conditions, the winning conditions defined here generalize the classical Streett condition as well as the finitary respectively bounded Streett condition of [9]. Indeed, if A contains no increment-edges, then the three conditions are equivalent, i.e., CostStreett(Γ, Cst) = BndCostStreett(Γ, Cst) = Streett(Γ ). Similarly, if A contains no ε-edges, then CostStreett(Γ, Cst) is equal to the finitary Streett condition over Γ and BndCostParity(Γ, Cst) is equal to the bounded Streett condition over Γ . Hence, Streett games with costs generalize both Streett and finitary Streett games. Similarly, bounded Streett games with costs generalize both Streett and bounded Streett games. Furthermore, just as classical Streett games subsume parity games, Streett games with costs subsume parity games with costs, and bounded Streett games with costs subsume bounded parity games with costs. Figure 2 shows the expressiveness of the winning conditions, e.g., the arrow from "bounded parity" to "bounded Streett" denotes that every bounded parity condition is also a bounded Streett condition. Finally, we obtain determinacy via the Borel determinacy theorem [22].

Bounded Parity Games with Costs
In this section, we study bounded parity games with costs. We first show how to solve such games, and then consider the memory requirements for winning strategies for both players.

Solving Bounded Parity Games with Costs via ω-regular Games
To solve bounded parity games with costs, we present a relaxation of the bounded cost-parity condition, called PCRR, which essentially replaces the bound b on the cost between a request and its response by just requiring an answer to every request. For plays with finite cost we just require the parity condition to be satisfied, just as the bounded cost-parity condition does. The PCRR-condition is ω-regular, thus both players have finite-state winning strategies. Using the fact that a finite-state winning strategy for Player 0 answers every request within a fixed number of steps (and thereby also with bounded cost), we are able to show that these two games have the same winning regions. Finally, we show how to reduce the PCRR-condition to a parity condition. This completes our algorithm for solving bounded parity games with costs and also yields upper bounds on the memory requirements of both players in bounded parity games with costs.
Let G = (A, BndCostParity(Ω, Cst)). In the following, we assume that no vertex of A has both incoming increment-and ε-edges. This can be achieved by subdividing every increment-edge e = (v, v ′ ): we add a new vertex sub(e) and replace e by (v, sub(e)) (which is an increment-edge) and by (sub(e), v ′ ) (which is an ε-edge). Now, only the newly added vertices have incoming incrementedges, but they do not have incoming ε-edges. Furthermore, it is easy to see that Player i wins from a vertex in the original game if and only if she wins from this vertex in the modified game (where we color sub(e) by Ω(v ′ )). Finally, the modification does not increase the memory requirements, e.g., if Player 0 has a positional winning strategy for the modified game, then also for the original game.
We say that a vertex is an increment-vertex, if it has an incoming incrementedge (which implies that all incoming edges are increment-edges). Let I be the set of increment-vertices. Then, coBüchi(I) = {ρ | Cst(ρ) < ∞} is the set of infinite plays having finite cost. Furthermore, by RR(Ω) we denote the set of infinite plays in which every request is answered. We define which is ω-regular. Note that PCRR(Ω, I) relaxes BndCostParity(Ω, Cst) by giving up the bound on the cost between requests and responses, in other words PCRR(Ω, I) ⊇ BndCostParity(Ω, Cst).
Lemma 2 Let G = (A, BndCostParity(Ω, Cst)) and G ′ = (A, PCRR(Ω, I)), where I is defined as above. A finite-state winning strategy for Player i in G ′ from a set W of vertices is also a winning strategy for Player i in G from W .
Proof. The statement for i = 1 follows from the inclusion V ω \ PCRR(Ω, I) ⊆ V ω \ BndCostParity(Ω, Cst). Now, consider the case i = 0 and let σ be a finite-state winning strategy for Player 0 in G ′ from W . We argue that σ is also a winning strategy for Player 0 for G from W : let ρ be consistent with σ and starting in W , which implies ρ ∈ PCRR(Ω, I).
If ρ satisfies Parity(Ω) and has only finitely many increments (say b many), then all but finitely many requests are answered with cost less than b + 1 and there is no unanswered request of cost ∞, i.e., ρ ∈ BndCostParity(Ω, Cst).
Otherwise, ρ satisfies RR(Ω), i.e. every request in ρ is answered. We show that every request in ρ is answered with cost at most b = |V | · |σ| (where |σ| is the size of the memory structure implementing σ), which implies that ρ ∈ BndCostParity(Ω, Cst). Towards a contradiction, assume that there is a request that is answered with cost greater than b. Then, there are two positions between the request and its answer having the same vertex, an increment-edge in between them, and such that the memory structure implementing σ assumes the same state at both positions. Hence, using this loop forever is also a play that is consistent with σ. However, this play contains an unanswered request of cost ∞ and therefore does not satisfy PCRR(Ω, I). This yields the desired contradiction to the fact that σ is a winning strategy.
We give an important corollary which shows that solving G ′ also solves G.
Intuitively, Upd + (w) is the largest unanswered request in w, and is ⊥ if every request in w is answered. Furthermore, let ℓ be an odd color that is larger than every color in Ω(V ). Now, we define a coloring Ω M of the arena A × M via So, having all requests answered (i.e., being in memory state ⊥) is most desirable for Player 0 while visiting increment-vertices (i.e., vertices in I) while having an open request is most desirable for Player 1. If neither of these occurs infinitely often, then the old coloring Ω determines the winner (without taking the memory states into account).
Lemma 3 Let G ′ = (A, PCRR(Ω, I)) and G ′′ = (A × M, Parity(Ω M )). Then, be its extended play in A × M. By construction, m j is the largest unanswered request in v 0 · · · v j . We have to show that the same player wins both ρ ′ in G ′ and ρ ′′ in G ′′ .
Conversely, assume ρ ′′ ∈ Parity(Ω M ). If ℓ + 1 is the maximal color seen infinitely often, then m j is infinitely often equal to ⊥, which implies that every request in ρ ′ is answered, i.e., ρ ′ ∈ RR(Ω) ⊆ PCRR(Ω, I). On the other hand, if the maximal color seen infinitely often is smaller than ℓ + 1 (but still even, since we assume Player 0 wins ρ ′′ ), then there are only finitely many incrementvertices in ρ ′ and the plays ρ ′ and ρ ′′ each have a suffix such that these suffixes have the same sequence of colors. Hence, ρ ′ satisfies Parity(Ω). Altogether, we have ρ ′ ∈ Parity(Ω) ∩ coBüchi(I) ⊆ PCRR(Ω, I). Proof. The reduction from games with winning condition PCRR(Ω, I) to parity games yields uniform finite-state winning strategies of size d + 1 for such games. Now apply Lemma 2.
In the next subsection, we show this bound to be tight for Player 1 and show that Player 0 even has positional winning strategies.
The reduction from PCRR games to parity games and Lemma 2 show that solving a parity game suffices to solve a bounded parity games with costs and proves the following theorem. Here, n is the number of vertices, m is the number of edges, and d is the number of colors in the game. Furthermore, since solving parity games is in NP ∩ coNP and the blowup in our reduction is polynomial, we obtain the following remark.

Remark 5
The following problem is in NP ∩ coNP: given a bounded parity game with costs G, i ∈ {0, 1}, and a vertex v, is v ∈ W i (G)?
Let us conclude by considering the special case of a bounded parity game with costs G in which every edge is an increment-edge, i.e., where G is a bounded parity game. These games can be solved in polynomial time [9]. In this case, PCRR(Ω, Cst) is equal to RR(Ω), which is a request-response condition [28] where the sets of requests and responses form a hierarchy, induced by the order on the colors. It is easy to derive from the reduction to Büchi games [28] that such games can be solved in polynomial time. Hence, we have recovered the result of [9] on bounded parity games as a special case of our algorithm, although the running time of this algorithm is worse than the running time of the algorithm presented in [9].

Memory Requirements in Bounded Parity Games with Costs
In this subsection, we determine the exact memory requirements for both players in bounded parity games with costs. We begin by considering Player 0 and improve on Corollary 2.

Lemma 4
In bounded parity games with costs, Player 0 has uniform positional winning strategies.
Proof. Due to Lemma 2, it suffices to prove the statement for games G ′ = (A, PCRR(Ω, I)). Recall that we reduced such a game to a parity game G ′′ = (A×M, Parity(Ω M )) using a memory structure M that keeps track of the largest open request. Specifically, Lemma 3 reads as follows We order M = O ∪ {⊥} with the natural order on integers for O, where ⊥ is the minimal element. Player 0's winning region in G ′′ is downwards-closed, i.e., (v, m) ∈ W 0 (G ′′ ) and m ′ < m implies (v, m ′ ) ∈ W 0 (G ′′ ), which can be shown by mimicking a winning strategy from (v, m) to also win from (v, m ′ ). Thus, for v ∈ W 0 (G ′ ), we define which is well-defined as (v, Init(v)) ∈ W 0 (G ′′ ). Now, let σ ′′ be a uniform positional winning strategy for Player 0 in the parity game G ′′ . We define a positional strategy σ ′ for G ′ by using max(v), i.e., the worst memory state Player 0 could be in at vertex v while still being able to win from there. Given a vertex v ∈ W 0 (G ′ ), let σ ′′ (v, max(v)) = (v ′ , m ′ ). Using this, we define σ ′ (v) = v ′ . We show that σ ′ is a uniform winning strategy for Player 0 in G ′ . Consider a play ρ ′ = v 0 v 1 v 2 · · · starting in v 0 ∈ W 0 (G ′ ) consistent with σ ′ , and ρ ′′ = (v 0 , m 0 )(v 1 , m 1 )(v 2 , m 2 ) · · · its extended play in A × M. A straightforward induction shows that for every j, we have (v j , m j ) ∈ W 0 (G ′′ ), so max(v j ) ≥ m j .
By Lemma 3, ρ ′ ∈ PCRR(Ω, I) if and only if ρ ′′ ∈ Parity(Ω M ). Assume towards contradiction that the maximal color seen infinitely often in ρ ′′ is odd. This implies that the memory state ⊥ appears finitely often, so after a position, say n, all memory states are different from ⊥. Furthermore, from position n, we additionally have max(v j ) ≤ max(v j+1 ); this follows from the observation that if Upd(c, v) = ⊥, then c ≤ Upd(c, v). Consider Since the sequence (max(v j )) j≥n is non-decreasing, it is ultimately constant. The suffix starting from there is consistent with σ ′′ and starts in W 0 (G ′′ ), so it satisfies Parity(Ω M ) since σ ′′ is a winning strategy. Consequently, ρ * contains finitely many increment-vertices, so ρ ′′ as well. After the last increment-vertex, ρ * and ρ ′′ have the same colors, but ρ ′′ does not satisfy Parity(Ω M ), a contradiction.
To conclude this subsection, we prove that the upper bound d + 1 on the memory requirements of Player 1 proved in Corollary 2 is tight.

Lemma 5 For every d ≥ 1, there is a bounded parity game with costs G d such that
the arena of G d is of linear size in d and there are d odd colors in G d , -Player 1 has a uniform finite-state winning strategy for G d from every vertex which is implemented with d + 1 memory states, but there is a vertex from which Player 1 has no winning strategy that is implemented with less than d + 1 memory states.
Proof. We begin by describing the game by an example: Figure 3 depicts the game G 4 , where the numbers in the vertices denote their colors. Since each edge is an increment-edge, we do not label them as such in the picture. The arena consists of a hub vertex colored by 0 and four disjoint blades, which are identified by the odd color of their outermost vertex, i.e., by the colors 1, 3, 5 and 7 (which is 2 · 4 − 1). From the hub, Player 0 can enter the blade for c at a vertex of color c − 1 (which is even) which has a self-loop and an edge to a vertex of color 8 (which answers every request in the game). This vertex has only one outgoing edge to a vertex of color c (this is the identifying color). Again, this vertex has only one successor, the hub. In general, the arena of G d has d blades, one for each color in {1, 3, . . . , 2d− 1}, the hub has color 0, and the second vertex in each blade has color 2d and thereby answers every request. Furthermore, every edge is an increment-edge. At the hub, Player 0 picks a blade (say of color c) and then Player 1 decides whether to use the self-loop or to return to the hub. Note that Player 0 loses, if she enters the blade of color c while there is an open request of some color c ′ > c, since Player 1 can use the self-loop of the blade and thereby prevent an answer to the request c ′ . On the other hand, if Player 1 decides to leave the blade, all requests are answered and then color c is requested. Note that this request is never answered to by moving to the hub.
First, we show that Player 1 has a uniform finite-state winning strategy from every vertex that is implementable with d + 1 memory states. The memory structure keeps track of the largest open request, i.e., we use states 1, 3, . . . , 2d−1 and an additional state ⊥ that is reached, if there is no open request. Now, assume the current memory state is m and the play is in a vertex of Player 1, which is uniquely identified by its even color c. If m = ⊥, then Player 1 moves to the (unique) successor of color 2d. Now, assume m = ⊥, i.e., m is some odd color. If m < c, then Player 1 again leaves c by moving to the unique successor of color 2d. If m > c, then Player 1 uses the self-loop forever. Now, consider a play that is consistent with this strategy. If the current memory state is ⊥, then a request is raised within the next three moves and the play returns to the hub, which implies that the memory is updated to some odd color m. From there, Player 0 has to move to some blade, say for color c (which is odd). If m > c, then Player 1 uses the self-loop at the vertex of color c−1 forever. The resulting play is winning for him, since the request of c is unanswered with cost ∞. On the other hand, if m < c, then Player 1 moves to the vertex of color c and then back to the hub. While doing this, the memory is updated to a larger state, namely c. Hence, the memory states along a play consistent with the strategy described above are increasing, which means that at some point Player 0 has to enter a blade for color c < m, where m is the current memory state, i.e., also an open request. Then, Player 1 will win by using the self-loop of this blade. Hence, the strategy described above is a winning strategy from every vertex and is implemented using d + 1 memory states.
It remains to show that the upper bound d + 1 is tight. To this end, consider a finite-state strategy τ for Player 1 that is winning from the hub, say τ is implemented by (M, Init, Upd). We show that M contains at least d + 1 memory states. To this end, we define a sequence m 0 , m 1 , . . . , m d of d + 1 memory states, as follows. Define m 0 = Init(v), where v is the hub. Now, Consider the play where Player 0 moves from the hub to the blade with color 1. Since τ is a winning strategy, Player 1 will use the self-loop of this blade only finitely often, i.e., the hub is reached again. We denote this play prefix by w 1 (which is consistent with τ ) and define m 1 = Upd + (w 1 ). Consider now the play where after w 1 , Player 0 moves to the blade with color 3. Again, Player 1 will use the self-loop only finitely often and the hub is reached again. We denote the prolongation of w 1 through this blade by w 2 and define m 2 = Upd + (w 1 w 2 ). This process is continued for each blade in ascending order. Since Player 1 has to leave each blade we obtain a sequence m 0 , m 1 , . . . , m d of memory states assumed at the visits of the hub and a play prefix w 1 w 2 · · · w d that is consistent with σ, starts in the hub, and satisfies Upd + (w 1 w 2 · · · w j ) = m j for every j ≥ 1. Furthermore, each w 1 w 2 · · · w j ends in the hub.
We argue that the states m 1 , m 1 , . . . , m d are pairwise distinct. Assume towards contradiction there are j < j ′ ≤ d such that m j = m j ′ . Then, the play ρ = w 1 · · · w j · (w j+1 · · · w j ′ ) ω is consistent with τ . However, the maximal color seen infinitely often during ρ is 2d (which answers every request), and there is a uniform bound on the distance between the occurrences of 2d. Hence, the play is winning for Player 0 in G d , contradicting the fact that τ is a winning strategy for Player 1. Hence, the states m j are indeed pairwise distinct. Thus, every winning strategy has at least d + 1 memory states.
Note that every edge in G d is an increment-edge, i.e., G d is a bounded parity game. In [9] an upper bound of two on the memory requirements of Player 1 is claimed for bounded parity games. The games presented here refute this claim: there is no constant bound on the memory needed for Player 1 in bounded parity games.

Solving Parity Games with Costs via Bounded Parity Games with Costs
In this section, we show that being able to solve bounded parity games with costs suffices to solve parity games with costs. Our algorithm is based on the following lemma which formalizes this claim by relating the winning regions of Player 0 in the parity games with costs and the bounded parity game with costs in the same arena.
Lemma 6 Let G = (A, CostParity(Ω, Cst)) a parity game with costs and G ′ = (A, BndCostParity(Ω, Cst)) a bounded parity games with costs on the same arena.
(2) Due to determinacy, if W 0 (G ′ ) = ∅, then we have W 1 (G ′ ) = V . Due to Corollary 2, Player 1 has a uniform finite-state strategy τ that is winning from every vertex v. Consider a play consistent with τ : either, for every b, there is a request that is open for the next b increment-edges (the request could be the same for every b), or the maximal color seen infinitely often is odd (i.e., there are infinitely many unanswered requests).
We define a strategy τ ′ for Player 1 as follows: it is guided by a counter b cur which is initialized with 1. Assume a play starts in vertex v. The strategy τ ′ plays like τ until a request is open for b cur increment-edges. If this is the case, b cur is incremented and τ ′ plays like τ does from the current vertex (forgetting the history of the play constructed so far).
We show that τ ′ is winning in G from every vertex, which implies W 0 (G) = ∅. Let ρ ′ be a play that is consistent with τ ′ and distinguish two cases: if the counter is incremented infinitely often, then ρ ′ contains for every b a request that is open for at least b increment-edges, so ρ ′ / ∈ CostParity(Ω, Cst). On the other hand, if b cur is incremented only finitely often (say to value b), then there is a suffix ρ of ρ ′ that is consistent with the strategy τ . Since the counter is not incremented during ρ, every request in ρ is either answered with cost at most b or not answered, but only followed by at most b increment-edges. Hence τ ensures that the maximal color seen infinitely often in ρ is odd, i.e. ρ / ∈ Parity(Ω), so ρ ′ / ∈ Parity(Ω), and a fortiori ρ ′ / ∈ CostParity(Ω, Cst).
Note that the strategy τ ′ is not finite-state. We have seen in Example 1 that Player 1 needs infinite memory in general. Indeed, the winning strategy for Player 1 described in the example proceeds as described above. It requests color 1 at vertex a, uses the loop at vertex b to keep the request unanswered for several steps and then forgets about this request. At this point, a new request has to be raised by moving from b back to a, thereby answering the old request at vertex c. This request is then kept unanswered for more increment-edges than the previous one, and this goes on ad infinitum.
To conclude this subsection, we show how Lemma 6 can be used to solve parity games with costs. Let G = (A, CostParity(Ω, Cst)). The following algorithm proceeds by iteratively removing parts of A that are included in the winning region of Player 0 in G: we have just proven that the winning region of Player 0 in the bounded parity game with costs in A is a subset of her winning region in the parity game with costs in the same arena. Thus we can remove it and its attractor. This is repeated until Player 0's winning region in the bounded parity game with costs is empty. In this case, her winning region in the parity game with costs is empty as well, again due to Lemma 6. This idea is implemented in the following algorithm.
Example 2 Running on the parity game with costs of Figure 1, Algorithm 1 computes X 1 = {g} and W 1 = {f, g}, X 2 = {e} and W 2 = {d, e, f, g}, and X 3 = ∅. Thus, it returns W 2 , which is the winning region of Player 0 in the game.
Next, we show the algorithm to be correct and bound its number of iterations.
Lemma 7 Let G be a parity game with costs with n vertices. Algorithm 1 returns the winning region W 0 (G) after at most n + 1 iterations.
Next, we show W t ⊆ W 0 (G): to this end, we define a strategy σ for Player 0 on W t as follows: on sets X j , which are winning regions of Player 0 in a bounded parity game with costs, we play using some uniform positional winning strategy for this game, which always exists due to Lemma 4. On the attractors Attr Aj−1 0 (X j ) we play using some positional attractor strategy. Thus, σ is a positional strategy that is defined for every vertex in W t . Next, we show that it is indeed a uniform positional winning strategy from W t .
Every winning region X j is a trap for Player 1 in A j−1 . Hence, in the whole arena A, Player 1 can leave X j only to vertices in some W j ′ with j ′ < j. Player 0 on the other hand only moves to vertices in W j . Similarly, if the play is in the attractor of some X j , then it reaches X j after at most |V | steps or Player 1 moves to some W j ′ for some j ′ < j. Hence, every play ρ consistent with σ has a suffix ρ ′ that visits only vertices from some X j and is consistent with the winning strategy for the corresponding bounded parity game with costs. So, ρ ′ ∈ BndCostParity(Ω, Cst), which implies ρ ∈ CostParity(Ω, Cst). Thus, σ is a winning strategy.
It remains to consider Player 1, i.e., to show that V \ W t ⊆ W 1 (G). Note that V \ W t is the set of vertices of A t and that we have W 0 (A t , BndCostParity(Ω, Cst)) = ∅ .
Hence, by Lemma 6(2) we conclude W 0 (A t , CostParity(Ω, Cst)) = ∅, i.e., Player 1 wins the parity game with costs in the arena A t from every vertex. Since V \W t is a trap for Player 0 (it is the complement of an attractor), it follows that Player 1 wins the parity game with costs in the arena A from every vertex in V \ W t .

Corollary 3
In parity games with costs, Player 0 has uniform positional winning strategies.
Using Lemma 7, Theorem 1, and the fact that Algorithm 1 terminates after at most n + 1 iterations, and therefore has to solve at most n bounded parity games with costs, we obtain the following result where again n is the number of vertices, m is the number of edges, and d is the number of colors in the game.
Theorem 2 Given an algorithm that solves parity games in time T (n, m, d), there is an algorithm that solves parity games with costs with a time complexity O(n · T (dn, dm, d + 2)).
Also, we obtain the same computational complexity as for bounded parity games with costs.

Remark 6
The following problem is in NP ∩ coNP: given a parity game with costs G, i ∈ {0, 1}, and a vertex v, is v ∈ W i (G)?
Proof. Use the characterization of W 0 as computed by Algorithm 1: the sets X j can be determined in NP (respectively in coNP) due to Remark 5 and the attractors can be computed in (deterministic) linear time.
In the previous section section we have shown that one can recover a polynomial time algorithm for deciding the winning regions of bounded parity games. Hence, using Algorithm 1, we obtain the same for finitary parity games as well. Hence, we also recover polynomial time decidability of finitary parity games as a special case of our algorithm. However, this is not surprising since Algorithm 1 is the same one used in [9] to solve finitary parity games via solving bounded parity games.

Positional Winning Strategies for Bounded Parity Games with Costs via Scoring Functions
In the previous section, we have shown how to eliminate the memory introduced in the reduction from PCRR games to parity games, which proved the existence of uniform positional winning strategies for Player 0 in bounded parity games with costs. Using these strategies as building blocks, we also proved the existence of uniform positional winning strategies for Player 0 in parity games with costs. Intuitively, the memory used in the reduction keeps track of the largest open request, but Player 0 does not need this information to implement her winning strategy as proved in Lemma 4. Instead, she can always play assuming the worst situation that still allows her to win. In this section we generalize this construction to arbitrary memory structures: we define a quality measure for play prefixes and then show that always playing like in the worst possible situation is a positional winning strategy. This gives an alternative proof of half-positional determinacy of (bounded) parity games with costs and presents a general framework that we believe to be applicable to other winning conditions as well.
We begin by defining a so-called scoring function for bounded parity games with costs that measures the quality of a play prefix (from Player 0's vantage point) by keeping track of the largest unanswered request, the number of increment-edges traversed since it was raised, and how often each odd color was seen since the last increment-edge. For the remainder of this section, we fix a bounded parity game with costs G = (A, BndCostParity(Ω, Cst)) with arena A = (V, V 0 , V 1 , E), and a uniform finite-state winning strategy σ for Player 0 in G. Let Ω(V ) ⊆ {0, 1, . . . , ℓ}, where we assume ℓ to be odd. Furthermore, let d = ℓ+1 A proper (score-) sheet is a vector (c, n, s ℓ , s ℓ−2 , . . . , s 3 , s 1 ) where c is an odd color in {1, 3, . . . , ℓ}, n ≤ t, and s c ′ ≤ t for every c ′ . Finally, we use two special sheets denoted by ⊥ and ⊤. The reversed ordering of the score values s ℓ , s ℓ−2 , . . . , s 3 , s 1 in the sheets is due to the max-parity condition, in which larger colors are more important than smaller ones. This is reflected by the fact that we compare sheets in the lexicographical order induced by < on its components and add ⊥ as minimal and ⊤ as maximal element. For example, (3, 3, 0, 1, 1) < (3, 3, 1, 0, 3) and ⊥ < s < ⊤ for every sheet s = ⊥, ⊤. As usual, we write s ≤ s ′ if s = s ′ or s < s ′ .
Next, we show how to update sheets along a play to use them as a quality measure for play prefixes. Let s = (x 1 , . . . , x d+2 ) be a (proper) sheet. We say that s is full in coordinate 1, if x 1 = ℓ (recall that ℓ is the largest possible value in the first coordinate), and that s is full in coordinate k > 1, if x k = t (recall that t is the largest possible value in all but the first coordinate). Let k be a coordinate and let s = (x 1 , . . . , x d+2 ) be a proper sheet.
-If 1 is the largest coordinate smaller than or equal to k that is not full in s, then incrementing s at coordinate k yields the sheet (x 1 + 2, 0, . . . , 0). If k > 1, then we say that there is an overflow in coordinates 2, . . . , k. -If k ′ > 1 is the largest coordinate smaller than or equal to k that is not full in s, then incrementing s at coordinate k yields the sheet (x 1 , . . . , x k ′ −1 , x k ′ + 1, 0, . . . , 0). If k ′ < k, then we say that there is an overflow in coordinates k ′ + 1, . . . , k.
-If there is no coordinate k ′ smaller than or equal to k that is not full in s, then incrementing s at coordinate k yields the sheet ⊤ and we say that there is an overflow in coordinates 1, . . . , k. Next, we show that the increment-operation and a reset-operation are compatible with the ordering.
Let Sh(w) = (c, n, s ℓ , . . . , s 1 ). To simplify our notation in the following proofs, we define Req(w) = c, ReqCst(w) = n, and Sc c ′ (w) = s c ′ . If Sh(w) = ⊥ or Sh(w) = ⊤, then we leave these functions undefined. Furthermore, let Lst(w) denote the last vertex of a non-empty finite play w.
In the following, we show that the scoring function has three properties that we need to prove our result. We begin by showing that it is a congruence.
Before we begin the proof we state the following useful facts.
Remark 8 Let w ∈ V * and v ∈ V .
We now prove Lemma 8.
Proof. If Sh(x) = Sh(y), then Sh(xv) = Sh(yv), since the sheets of xv and yv only depend on the sheets of x and y (which are equal) and the last edges of xv and yv (which are also equal).
So, consider the case Sh(x) < Sh(y). First, assume we have Sh(x) = ⊥, which implies Sh(xv) = Sh(v). If Ω(v) is even, then Sh(v) = ⊥ and we are done, since ⊥ is the minimal element. Otherwise, applying Remark 8 (2) to yv yields the desired result. As a last special case assume we have Sh(y) = ⊤, which implies Sh(yv) = ⊤. As ⊤ is the maximal element, we have Sh(xv) ≤ Sh(yv).
We are left with the case ⊥ < Sh(x) < Sh(y) < ⊤ and have to consider two subcases: Lemma 12 Let G = (A, BndCostStreett(Γ, Cst)) and G ′ = (A, SCRR(Γ, I)), where I is defined as above. A winning strategy for Player i in G ′ from a set W is also a winning strategy for Player i in G from W . Especially, The proof of this lemma is similar to the one for Lemma 2 and relies on finite-state determinacy of ω-regular games. Next i.e., we have reduced the request-response conditions RR(Q c , P c ) to Büchi conditions 3 . Finally, we have which is a Streett condition. Thus, we have reduced (A, SCRR(Γ, I)) to a Streett game in an arena that is exponential in d with 2d Streett pairs. This proves the first claim of Theorem 3. Furthermore, we obtain the following upper bound on the size of finite-state winning strategies. Here, we use the fact that Player 0 has finite-state winning strategies of size d! in Streett games with d pairs (which is tight), while Player 1 has positional winning strategies [14]. Note that the lower bound of d! for Player 0 is also a lower bound for her in (bounded) Streett games with costs, since classical Streett games are a special case of both.
Lemma 13 Let G = (A, CostStreett(Γ, Cst)) be a Streett game with costs and G ′ = (A, BndCostStreett(Γ, Cst)) be a bounded Streett game with costs on the same arena.
The proof is exactly the same as the one for Lemma 6. Also, Algorithm 1 (where X j is now Player 0's winning region in the bounded Streett game with costs) works for this pair of winning conditions as well. This proves the second claim of Theorem 3.
Furthermore, using the same construction as in the proof of Lemma 7, one can built a winning strategy for a Streett game with costs out of the winning strategies for the bounded Streett games with costs solved by (the modified) Algorithm 1. By reusing memory states, we obtain the following upper bound for Player 0. Player 1 on the other hand needs infinite memory in Streett games with costs, as witnessed by the game in Example 1, which can be easily transformed into a Streett game with costs.
Using the algorithm presented in [26], which solves a Streett game with a time complexity O(mn d dd!), one can solve (bounded) Streett games with costs in exponential time, although the Streett games that need to be solved are of exponential size (but only in d). Together with the EXPTIME-hardness of solving bounded and finitary Streett games 4 , which are a special case of (bounded) Streett games with costs, we obtain the following result.

Theorem 4
The following problem is EXPTIME-complete: Given a (bounded) Streett game with costs G, i ∈ {0, 1}, and a vertex v, is v ∈ W i (G).
Again, we recover the results on bounded Streett and finitary Streett games (winning regions for both games can be decided in EXPTIME) proved in [9] as special cases of our algorithm, since SCRR(Γ, Cst) is equal to a request-repsonse condition in case every edge is an increment-edge. Winning regions in requestresponse games can be determined in EXPTIME [28].

Conclusion
We introduced infinite games with cost conditions, generalizing both classical conditions and finitary conditions. For parity games with costs, we proved halfpositional determinacy and that solving these games is not harder than solving parity games. Furthermore, the corresponding decision problem is in NP∩coNP. For Streett games with costs, we showed that Player 0 has finite-state winning strategies and that solving these games is not harder than solving finitary Streett games and can be done by solving linearly many (classical) Streett games of exponential size (in the number of Streett pairs). Our results unify the previous results on both classical and finitary variants. Table 1 sums up all our results and compares them to related games. Here, d denotes the number of odd colors in the game and "exponential" is always meant to be "exponential in the number of Streett-pairs". The memory bounds for the different types of parity games are tight, while there are gaps between the exponential lower and the exponential upper bounds for the different types of Streett games with costs. Streett coNP-complete exponential positional bounded Streett EXPTIME-complete exponential exponential finitary Streett EXPTIME-complete exponential infinite bounded cost-Streett EXPTIME-complete exponential exponential cost-Streett EXPTIME-complete exponential infinite Table 1. Overview of results Let us discuss two variations of the games presented here. In a parity game with costs, the requests and responses are hierarchical and there is a single costfunction that is used for every request. On the other hand, in Streett games with costs, the requests and responses are independent and there is a cost-function for every pair of requests and responses. Thus, there are two other possible combinations.
First, consider parity games with multiple cost-functions (one for each odd color): a reduction from QBF shows that solving such games is PSPACE-hard. On the other hand, the problem is in EXPTIME, since every such game is a Streett game with costs. Furthermore, one can show that Player 0 needs exponential memory (in the number of odd colors) to implement her winning strategies. All these results even hold for the bounded variant of these game, which is defined as one would expect. In these games, both players need exponential memory. In further research we aim at closing the gap in complexity of solving parity games with multiple cost-functions.
The second variation are Streett games with a single cost-function. Solving finitary Streett games is already EXPTIME-complete and our lower bounds on memory requirements are derived from Streett games. Note that both finitary Streett and classical Streett games can be seen as Streett games with a single cost-function. Thus, the results mentioned above already hold for such games. Hence, Streett games with a single cost-function are as hard as Streett games with multiple cost-functions.
Finally, there are at least two other directions to extend our results presented here: first, our winning conditions do not cover all acceptance conditions (for automata) discussed in [4,27]. In ongoing research, we investigate whether our techniques are applicable to these more expressive conditions and to winning conditions specified in weak-MSO with the unbounding quantifier [3,5]. Finally, one could add decrement-edges.