eii commited on
Commit
973f0da
·
verified ·
1 Parent(s): e13b758

Add dataset documentation and reader: README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -0
README.md ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: Connect Four strong WDL tables
3
+ tags:
4
+ - connect-four
5
+ - game-solving
6
+ - perfect-play
7
+ ---
8
+
9
+ # Strong Connect Four WDL tables
10
+
11
+ These archives contain strong win/draw/loss (WDL) solutions for four Connect Four board sizes. Values are from the perspective of the player to move. A strong solution gives a value for positions throughout the game, not just the initial position.
12
+
13
+ | Board | Initial value for first player | Stored non-terminal positions | Archive |
14
+ |---|---|---:|---|
15
+ | 4×4 | Draw | 147,319 | `c4_wdl_4x4.tar.zst` |
16
+ | 6×4 | Loss | 70,538,337 | `c4_wdl_6x4.tar.zst` |
17
+ | 5×5 | Draw | 52,213,470 | `c4_wdl_5x5.tar.zst` |
18
+ | 7×6 | Win | 2,637,477,442,337 | `c4_wdl_7x6.tar.zst` |
19
+
20
+ Each archive expands to a directory with `zdd.bin` and one `slab_<ply>.bin` file for each ply before the board is full. The ZDD ranks gravity-respecting positions with the correct numbers of first- and second-player stones and no four-in-a-row. The slabs store one two-bit value per ranked position: 0 = draw, 1 = win, 2 = loss. The final full-board ply needs no slab because a full board without a four-in-a-row is a draw. A move that makes a four-in-a-row is handled as an immediate win. Some ZDD positions cannot arise from alternating play, but the reachable positions are covered.
21
+
22
+ Unpack an archive with `tar --zstd -xf c4_wdl_7x6.tar.zst`. The accompanying `c4.cpp` and `Makefile` provide a reader and solver. Build with `make`, then query a move sequence using, for example, `./c4 probe 332 --board 7x6 --dir c4_wdl_7x6`. Columns in move sequences are zero-indexed. Use `./c4 analyze --board 7x6 --dir c4_wdl_7x6` for the initial value and first-move values.
23
+
24
+ ## Validation
25
+
26
+ The ZDD root counts match an independent counting dynamic program at every ply. The 4×4 and 6×4 counts were also checked by brute-force enumeration. For 6×4 and 5×5, reachable WDL counts match the reference BDD solver's per-ply CSVs on every row. For 7×6, a full reachability sweep matched the reference WDL counts on all 43 plies; random positions were also checked with independent negamax and alpha-beta search. The 7×6 opening values are: center column wins, adjacent columns draw, and outer columns lose.