Complexity and Retrograde Analysis of the Game Dou Shou Qi Jan N. - - PowerPoint PPT Presentation

complexity and retrograde analysis of the game dou shou qi
SMART_READER_LITE
LIVE PREVIEW

Complexity and Retrograde Analysis of the Game Dou Shou Qi Jan N. - - PowerPoint PPT Presentation

Complexity and Retrograde Analysis of the Game Dou Shou Qi Jan N. van Rijn Jonathan K. Vis Leiden Institute of Advanced Computer Science November 7, 2013 Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 1


slide-1
SLIDE 1

Complexity and Retrograde Analysis

  • f the Game Dou Shou Qi

Jan N. van Rijn Jonathan K. Vis

Leiden Institute of Advanced Computer Science

November 7, 2013

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 1 / 21

slide-2
SLIDE 2

Dou Shou Qi

Pieces with their strength

Elephant (8) Lion (7) Tiger (6) Panther (5) Dog (4) Wolf (3) Cat (2) Rat (1)

Terrain types

Den — objective square Traps — reduce enemy strength Water — “impassable” squares

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 2 / 21

slide-3
SLIDE 3

Dou Shou Qi

Movement

All pieces can move one square either horizontally or vertically

Den

Pieces cannot enter their own den

Traps

Pieces are vulnerable to any enemy piece

Water

Pieces cannot enter the water, . . .

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 3 / 21

slide-4
SLIDE 4

Dou Shou Qi

Swimming

Rats can enter the water

Capturing

The Rat (weakest) can capture the Elephant (strongest)

Exception

Rats cannot capture the elephant from the water

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 4 / 21

slide-5
SLIDE 5

Dou Shou Qi

Leaping

Lions and tigers can leap over the water, both horizontally and vertically

Blocked

Rats in the water block a leap

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 5 / 21

slide-6
SLIDE 6

Circuit Game

CNF formula (x ∨ y) ∧ . . . ∧ (x ∨ z ∨ w)

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 6 / 21

slide-7
SLIDE 7

Circuit Game

CNF formula (x ∨ y) ∧ . . . ∧ (x ∨ z ∨ w)

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 6 / 21

slide-8
SLIDE 8

Planar Circuit Game

(a) Half crossover (b) Crossover

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 7 / 21

slide-9
SLIDE 9

Reductions

R.A. Hearn

Gpos(POS CNF) ≤p Circuit Game ≤p Planar Circuit Game

Our contribution

Planar Circuit Game ≤p Dou Shou Qi Construct gadgets: AND OR FANOUT CHOICE VARIABLE

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 8 / 21

slide-10
SLIDE 10

Gadgets

(a) VARIABLE

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 9 / 21

slide-11
SLIDE 11

Gadgets

(b) AND (c) OR

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 10 / 21

slide-12
SLIDE 12

Gadgets

(d) FANOUT (e) CHOICE

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 11 / 21

slide-13
SLIDE 13

Unwanted behavior

Problems

White panthers can go back, effectively reversing the signal in the logic circuit Additional panthers can leave the FANOUT gadget through the same exit, effectively doubling the signal in the logic circuit Black pieces can escape their gadgets, and possibly destroy other gadgets

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 12 / 21

slide-14
SLIDE 14

Unwanted behavior

Problems

White panthers can go back, effectively reversing the signal in the logic circuit Additional panthers can leave the FANOUT gadget through the same exit, effectively doubling the signal in the logic circuit Black pieces can escape their gadgets, and possibly destroy other gadgets

Solution

Create additional “protector” gadgets that prevent this behavior

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 12 / 21

slide-15
SLIDE 15

Protector Gadgets

One way gadget

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 13 / 21

slide-16
SLIDE 16

Protector Gadgets

Preventing multiple panthers through one exit

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 14 / 21

slide-17
SLIDE 17

Protector Gadgets

Prevents black pieces from leaving their gadget

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 15 / 21

slide-18
SLIDE 18

PSPACE-hardness

Complexity

Dou Shou Qi is PSPACE-hard

Completeness

Under the assumption of a 50-move rule, PSPACE-completeness can trivially be proven.

Open Problem

We suspect Dou Shou Qi to be EXPTIME-complete, but could not prove it yet.

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 16 / 21

slide-19
SLIDE 19

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 17 / 21

slide-20
SLIDE 20

Retrograde Analysis

Endgame tablebase with positions up to four pieces Calculating backwards from terminal positions Containing almost 1010 positions Approximately 2% ends in a draw Goals:

◮ Search for interesting patterns ◮ Use it as part of the playing engine Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 18 / 21

slide-21
SLIDE 21

Retrograde Analysis

Endgame tablebase with positions up to four pieces Calculating backwards from terminal positions Containing almost 1010 positions Approximately 2% ends in a draw Goals:

◮ Search for interesting patterns ◮ Use it as part of the playing engine ◮ Solve Dou Shou Qi in a similar way as Checkers was solved Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 18 / 21

slide-22
SLIDE 22

Retrograde Analysis

White to play, what is the outcome?

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 19 / 21

slide-23
SLIDE 23

Retrograde Analysis

White to play, what is the outcome? White loses No draws for two equal pieces Distance parity is important Tigers and Lion can flip parity

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 19 / 21

slide-24
SLIDE 24

Conclusions and Future Work

Dou Shou Qi is PSPACE-hard, which implies that it is an interesting game to study Implementations available1: playing engine, web interface and endgame tablebase Room for improvement: Can it be proven EXPTIME-complete? A reduction on a more regular board More interesting patterns can be found in the endgame tablebase

1www.liacs.nl/~jvis/doushouqi/ Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 20 / 21

slide-25
SLIDE 25

Questions

Thank you for your attention.

Jan N. van Rijn, Jonathan K. Vis (LIACS) Complexity of Dou Shou Qi November 7, 2013 21 / 21