Parity Games

50
Parity Games Games, logic and Automata Seminar 2014 Tal Zelmanovich

description

Parity Games. Games, logic and Automata Seminar 2014 Tal Zelmanovich. Overview. The parity game problem. The parity game problem Uses Terms and definitions Exponential algorithm Sub-exponential algorithm. Uses. Notation, & terms. Exponential algorithm. Sub-exponential algorithm. - PowerPoint PPT Presentation

Transcript of Parity Games

Parity Games

Parity Games

Games, logic and Automata Seminar 2014

Tal Zelmanovich

Lecture about stuff

1

Overview

The parity game problem

Uses

Terms and definitions

Exponential algorithm

Sub-exponential algorithm

The parity game problem

Uses

Notation, & terms

Exponential algorithm

Sub-exponential algorithm

Exponential actually 2^n, exponential exists due it being in NP

Consider also talking more about:

Different attempts to solve the problem

Proof it is in NP\co-NP (mean payoff reduction?)

Mew calculus

2

The Parity Game

The parity game problem:

A two-headed llama wonders infinitely through the forest.

3

The Parity Game

Each head remembers only one part of the forest (to conserve precious llama memory) and so only he can navigate through these places.

4

The Parity Game

5

5

5

5

4

2

1

3

7

9

1

Goal: Each head tries to force his favorite treat to be the maximal treat infinitely visited

(no ties)

Each head also have a favorite snack: blue flowers for the right head, and bright olive-green apples for the left one.

But more than they like their treats, they hate each other, so each llama wants her treat to appear more than the others treat. And since theyre having an infinite walk, each head wants the maximal treat appearing in a single place to be his favorite.

5

The Parity Game

8

7

3

14

4

3

19

+ priorities

Each vertex has at least one outgoing edge

Starting vertex

Player 0: Green

Player 1: Blue

U = vertices visited infinitely

Winner: (Max(priority in U))%2

Mathematical definition

6

Properties

Is it a full information game

Is it a zero sum game

Does the prefix of a play matters

Yes!

Yep!

No, winner stays the same

Is it a determined

Indeed!

Winning strategies are memory-less

Third level of Borel hierarchy

Strategy given by algorithm

First ones are trivial (ask the audience)

7

Why is it interesting?

Verification and logics:- equivalent to some cases of -automata emptiness problem (polynomial reduction)

- Equivalent to model checking problem of the modal -calculus (modal fixpoint logic)

Complexity:

- Known to be in and even in

same status as integer factorization problem

The problem of solving parity games is polynomial time equivalent to the non-emptiness problem of -automata on infinite trees with Rabin-chain acceptance conditions

(consider talking more about mew-calculus)

UP like NP, but exactly one witness string for Yes (as opposed to at least one)not known to be in P just like factorization problem

also helps solving churchs problem!

8

Notation

: The subset of vertices from which player i has a wining strategy

5

5

5

5

7

5

2

4

2

4

In general: =V

9

Notation

5

5

5

5

4

1

5

2

9

: The subset of vertices from which player I has a wining strategy

Observation:

Controlling the choices does not guarantee victory

10

Notation

: all vertices from which player i may force a visit to one of the vertices of A (same as attractor)

11

Notation

: all vertices from which player i may force a visit to one of the vertices of A (same as attractor)

5

5

5

5

1

2

4

2

7

5

3

A

?

4

12

4

Notation

: all vertices from which player i may force a visit to one of the vertices of A (same as attractor)

5

5

5

5

1

2

4

2

7

5

3

A

?

13

Notation

: a set of vertices s.t. player i has a strategy that doesnt allow the game to go outside the set

5

5

5

5

1

5

5

6

1

Alternative definition:

a set is called i-closed iff:

:

14

Notation (Summary)

: The subset of vertices from which player I has a wining strategy

: all vertices from which player i may force a visit to one of the vertices of A (same as attractor)

: a set of vertices s.t. player i has a strategy that doesnt allow the game to go outside the set

All of these terms depends on the player

Reach & Closed ignores graph priorities (llama treats)

15

The exponential algorithm

By R. McNaughton & W. Zielonka

Using a two-steps recursion to separate the problem into smaller (possibly overlapping) instances

The algorithm is simple, the reason it works isnt

Some observations (and of course proofs) are needed

Lets start by finding a way to detect closed areas

Mathematical definition

16

The exponential algorithm (proofs)

Is always i-closed?

Lemma 1: is always i-closed

Proof: Assume is not i-closedAccording to closed-i definition, there must be a vertex to which one of the following apply:

, and :

:

But since we can win from , we must be able to win from one of these s ContradictionReminder: emitting play prefix does affect the result

17

The exponential algorithm (proofs)

Lemma 2: is i-closed

Proof: Like the last proof, assume it is not i-closed.If it wasnt closed, then while following a reach-A strategy for i, on some vertex along the way one of the following will happen:

player j may force the play to leave the region.

Either player i will have to leave it

but since the rest of the strategy must reach A eventually, this cannot be.

WRONG!

1

2

4

A

not-closed

It doesnt work since A may forceus to leave the area:

18

The exponential algorithm (proofs)

Lemma 2 (fixed): is j-closed

Proof: assume it is not j-closed.Then there exists some so either:

But that means player i has a strategy forcing a play from to pass to and eventually to A, meaning .

Contradiction since

19

The exponential algorithm (proofs)

For the algorithm, well need to compute multiple timesSo how fast can we do it?

Trivial idea expanding back:start with

Repeatedly add to B vertices answering one of the following conditions:

20

The exponential algorithm (proofs)

How can we speed it up?

Count for each vertex how many outgoing edges we already checked (maintain an adjacency list)

While there is still an edge entering B that we didnt visit, do the following:

- If , add to B

- If , substruct s edge count by 1 On count=0, add to B

Total time:

21

The exponential algorithm (proofs)

How can we speed it up?

Count for each vertex how many outgoing edges we already checked (maintain an adjacency list)

While there is still an edge entering B that we didnt visit, do the following:

- If , add to B

- If , substruct s edge count by 1 On count=0, add to B

Total time:

22

The exponential algorithm (proofs)

So up to now we got:

Lemma 1: is always i-closed

Lemma 2: is j-closed

Algorithm: compute with time complexity of O(m)

We can now easily compute closed areasNext: breaking down a game to smaller (faster to solve) subgames

23

1

2

1

7

Subgames

5

5

5

5

2

3

4

1

1

2

1

7

7

B

G\B

must stay a valid game having at least 1 outgoing edge

If was i\j-closed in G, then were promised G\B is valid

Defining a subset of a game by removing set B of vertices (to get G\B)

Remaining vertices must form a game (must have at least one outgoing edge)

24

The exponential algorithm (proofs)

Can a subgame tell us anything about the original game?

Lemma 3: if , the vertices of a subgame , were i-closed in the original game , then any winning state of is also a wining state of

Proof: since i has a wining strategy from the same strategy can be used to win the game . i follows the strategy and stays in , while j cannot escape it since is i-closed in the original game.We get as required

5

6

2

1

2

5

4

3

8

8

8

8

G=G\B

B

not in

25

5

5

5

5

5

6

2

1

2

5

4

3

8

8

8

8

G=G\B

B

not in

Purple arrows are is winning strategy choices that must leave him inside G.

(in the drawing it is a positional strategy, but the proof also work if it is an historic strategy)

The upper left one is outside of win G, so it may (or may not) be in G

26

The exponential algorithm (proofs)

Lemma 4: for any winning set :1.

2.

Proof: (1)(a) Since is composed of winning states, i has a winning strategy from by simply reaching .

(1)(b) When starting at follow a strategy to win , if j makes us leave that area, were in , and we have a winning strategy from here as well

(2) is j-closed (lemma 2) and therefore winning this sub game promises winning entire (lemma 3)

This is the base for our algorithm, well use it to expand the set of known winning states

27

The exponential algorithm (proofs)

Lemma 4: for any winning set :1.

2.

If we know some winning state(s) , then we reduced the problem to a smaller graph solve problem using recursion

This is the base for our algorithm, well use it to expand the set of known winning states

28

The exponential algorithm (proofs)

But finding an initial winning set is not that easy!

Define as the highest priority in .

Define as the set of vertices with priority

Lemma 5: assuming priority belongs to player i:

if , then

But finding an initial winning set is not that easy!

Define as the highest priority in .

Define as the set of vertices with priority

Lemma 5: assuming priority belongs to player i:

if , then

Its the last one (I promise)

29

The exponential algorithm (proofs)

Lemma 5: assuming priority belongs to player i:

if , then

Proof:

is j-closed (lemma 1), but it is also a subgame of . Since it is also a subgame of we get (lemma 3)

i wins using the strategy:

if the game is in follow the wining strategy (j loses everywhere there)

If the game is in , reach a vertex with priority d

Victory is promised for i since we either visit the max priority d infinitely, or we can discard a finite prefix and win in

30

The exponential algorithm

Lemma 5: assuming priority belongs to player i: -

- if , then

Lemma 4: for any winning set :1.

2.

Algorithm

Calculate for the highest priority

By a recursive call determine the winner of

Set

Calculate

By recursive call solve

If :

return ,

31

Calculate for the highest priority

By a recursive call determine the winner of

Set

Calculate

By recursive call solve

If :

return ,

32

The exponential algorithm (analysis)

Things left to do:

1. Analyze run time complexity

2. Teach a two-headed llama the algorithm

(trivial - left as home work assignment)

33

Calculate for the highest priority

By a recursive call determine the winner of

Set

Calculate

By recursive call solve

The exponential algorithm (analysis)

So, is the exponential algorithm really exponential?

Total time:

34

The exponential algorithm (analysis)

..

=

35

The exponential algorithm (analysis)

We Got:

It is easy to see that !

=+

Compare to geometric series

easy is the term of the article, it took me about 2 hours

36

The exponential algorithm (analysis)

Ratio between two elements:

But this means we can bound it by geometric sum:

The sub-exponential algorithm

Uri Zwick

Mike Paterson

Marcin

Jurdzinski

Uri from tau, other two from UK

38

The sub-exponential algorithm

Definition:

A set of vertices , will be called i-Dominion if and only if player i has a strategy to win from every vertex in without leaving it

i-dominion must be i-closed

i-dominion is a subset of

The sub-exponential algorithm

The idea:Get a better running time by dismissing dominions!

The problem:May be hard as the entire gameExample: is an i-dominion

Solution: look for small dominions

The sub-exponential algorithm

Dominion-find algorithmFinds dominions of size with runtimecomplexity

for each subset , :

if D is i-closed ():

exponential_algorithm(D)

if ():

return D

return no such dominion

The sub-exponential algorithm

for each subset , :

if D is i-closed ():

exponential_algorithm(D)

if ():

return D

return no such dominion

Runtime analysis:

times

Close-checking is done by passing on all vertices and verifying close conditions for each one. Takes time as the number of edges O(m(D))=O(l^2)

42

The sub-exponential algorithm

Since we assumed , then for any we have:

And therefore (geometric series):

The sub-exponential algorithm

And as required:

Run time comparsion

Marcin

Jurdzinski

1998

Exponential

R. McNaughton & W. Zielonka

1998, 2002

Randomized-subexponential

Bj orklund, Ludwig

1995, 2003

Subexponential

Uri, Mike, Marcin

2006

The sub-exponential algorithm

To reach sub-exponential run time, well use our dominion finding to remove any small dominions:

D

D

D

set

;assume D is for player i

if no such dominion found:

return old_algorithm(G)

recursively solve

return:

Old algorithm should be now fixed to call this algorithm on recursive calls

Sqrt(2n) is the optimal choice

46

The sub-exponential algorithm

Runtime:

Running takes

If we found a dominion we used only one recursive call (on ) so

If we didnt find a dominion, we called the old algorithm.The old algorithm does two recursive calls (), ).But since in the second call is a j-dominion, it follows .So in this case:

Either way:

O(n^2) is now neglectable)

47

The sub-exponential algorithm

So, what is the total runtime?

Vertex costs

Left side height n

Right side how many time can we perform till we reach a leaf? At most times.

-

-

The article includes induction proof for the right height, Ill spare that from you

48

The sub-exponential algorithm

Left side height n

Right side height

Each leaf can be defined as a set of turns with maximum of n turns and no more than of them is right.

Therefore the amount of leafs is bounded by and the entire tree has no more than

Since the most expensive node costs (the root) :

The article includes induction proof for the right height, Ill spare that from you

49

5

5

5

5

5

5

5

5

5

5

5

The article includes induction proof for the right height, Ill spare that from you

50

References

A DETERMINISTIC SUBEXPONENTIAL ALGORITHM FOR SOLVING PARITY GAMESby Marcin Jurdzinski, Mike Paterson & Uri Zwick

Complexity Zoo https://complexityzoo.uwaterloo.ca/Complexity_Zoo:U

Deciding the Winner in Parity Games Is in UP co-UP by Marcin Jurdzinski

51