So this one day, I am playing the board game Quarto (http://en.wikipedia.org/wiki/Quarto_%28board_game%29) with my friend and I wonder, can this game end in a tie, or is there always a winner?
Normal people might have squabbled or shrugged, but not us nerds! We obviously abandoned the game, took our laptops to the local pub and started hacking. In this talk I will explain how I used F# to transform this problem to satisfiability, ran it through an SAT solver to discover if it can indeed end in a tie.
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
A board game night with geeks: attacking Quarto ties with SAT solvers
1.
2. So this one day, I am playing the
board game Quarto with my
boyfriend.
3. 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.
4.
5.
6.
7.
8.
9.
10.
11.
12. In university I followed a wonderful
course on how to solve puzzles like
this, by using boolean satisfiabiliy
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36. How exactly will it help us if we
convert the problem to SAT?
Let’s dive into how an SAT solver
works.
37.
38.
39.
40.
41.
42.
43.
44.
45. No, trying all options would be too
slow. SAT solvers have a use a few
tricks to reduce the state space
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65. The input is generated now and
converted to CNF. Would it be
satisfiable??
Suspense... Is.... Killing me!
66.
67. There it is, the assignment and the
accompanying board.
Woohoo, we did it!
Next question of course is, how
many of such boards exist?