A board game night with geeks: attacking Quarto ties with SAT solvers

68

Transcript of A board game night with geeks: attacking Quarto ties with SAT solvers

Page 1: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 2: A board game night with geeks: attacking Quarto ties with SAT solvers

So this one day, I am playing the board game Quarto with

my boyfriend.

Page 3: A board game night with geeks: attacking Quarto ties with SAT solvers

Quarto is a variant of four in a row, with two twists:

One: The pieces have 4 attributes, instead of just 1 like in normal four in a row,

where pieces just vary in color. In Quarto, pieces vary

in shape, size, color and form of the top, as you can see

here

You win if you get four pieces in a row who all have the

same property.

The other twist is that you pick a piece, which your

opponent then places, but this is irrelevant for this talk.

Page 4: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 5: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 6: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 7: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 8: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 9: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 10: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 11: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 12: A board game night with geeks: attacking Quarto ties with SAT solvers

In university I followed a wonderful course on how to solve puzzles like this, by using boolean satisfiabiliy

Page 13: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 14: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 15: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 16: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 17: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 18: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 19: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 20: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 21: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 22: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 23: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 24: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 25: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 26: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 27: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 28: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 29: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 30: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 31: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 32: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 33: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 34: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 35: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 36: A board game night with geeks: attacking Quarto ties with SAT solvers

How exactly will it help us if we convert the problem to

SAT?

Let’s dive into how an SAT solver works.

Page 37: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 38: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 39: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 40: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 41: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 42: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 43: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 44: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 45: A board game night with geeks: attacking Quarto ties with SAT solvers

No, trying all options would be too slow. SAT solvers have a use a few tricks to reduce

the state space

Page 46: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 47: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 48: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 49: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 50: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 51: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 52: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 53: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 54: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 55: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 56: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 57: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 58: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 59: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 60: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 61: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 62: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 63: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 64: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 65: A board game night with geeks: attacking Quarto ties with SAT solvers

The input is generated now and converted to CNF. Would

it be satisfiable??

Suspense... Is.... Killing me!

Page 66: A board game night with geeks: attacking Quarto ties with SAT solvers
Page 67: A board game night with geeks: attacking Quarto ties with SAT solvers

There it is, the assignment and the accompanying board.

Woohoo, we did it!

Next question of course is, how many of such boards

exist?

Page 68: A board game night with geeks: attacking Quarto ties with SAT solvers

Thanks for watching, the code is on github!