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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Checkers Jumping
|
| 2 |
+
|
| 3 |
+
**Swap N red and N blue checkers on a linear board**
|
| 4 |
+
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
## Overview
|
| 8 |
+
|
| 9 |
+
Checkers Jumping is a one-dimensional constraint-satisfaction puzzle that tests sequential reasoning and planning capabilities. The puzzle consists of a linear arrangement of N red checkers (R), N blue checkers (B), and a single empty space (_), forming a board of length 2N + 1.
|
| 10 |
+
|
| 11 |
+
### Difficulty Rating: ⭐⭐⭐ (Hard - Quadratic Growth)
|
| 12 |
+
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
## 📊 Statistics
|
| 16 |
+
|
| 17 |
+
| Metric | Value |
|
| 18 |
+
|--------|-------|
|
| 19 |
+
| **Total Puzzles** | 5,700 |
|
| 20 |
+
| **Total Moves** | 242,494 |
|
| 21 |
+
| **Training Puzzles (N=1-7)** | 2,700 |
|
| 22 |
+
| **Test Puzzles (N=8-10)** | 3,000 |
|
| 23 |
+
| **Difficulty Parameter** | N (checkers per color) |
|
| 24 |
+
| **Board Length** | 2N + 1 (includes one empty space) |
|
| 25 |
+
| **Solution Length** | L(N) = **(N+1)² - 1** (quadratic) |
|
| 26 |
+
| **Transition Locality** | O(N) - directional constraints |
|
| 27 |
+
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## 🎯 Puzzle Rules
|
| 31 |
+
|
| 32 |
+
### Objective
|
| 33 |
+
Transform the board from the **initial configuration** (N red checkers, empty space, N blue checkers) to the **goal configuration** where the red and blue groups have swapped positions.
|
| 34 |
+
|
| 35 |
+
### Initial Configuration (Standard)
|
| 36 |
+
```
|
| 37 |
+
[R1, R2, ..., RN, _, B1, B2, ..., BN]
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
### Goal Configuration
|
| 41 |
+
```
|
| 42 |
+
[B1, B2, ..., BN, _, R1, R2, ..., RN]
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
### Movement Rules
|
| 46 |
+
1. **Slide Movement**: A checker can slide forward into an adjacent empty space
|
| 47 |
+
2. **Jump Movement**: A checker can jump forward over exactly one checker of the opposite color to land in an empty space
|
| 48 |
+
3. **Directional Constraint**: Checkers cannot move backward toward their starting side
|
| 49 |
+
- Standard: Red checkers move **right**, blue checkers move **left**
|
| 50 |
+
- Variant: Direction depends on starting configuration
|
| 51 |
+
|
| 52 |
+
### Why Checkers Jumping is Challenging
|
| 53 |
+
|
| 54 |
+
1. **Quadratic Solution Length**: L(N) = (N+1)² - 1
|
| 55 |
+
- N=2: 8 moves
|
| 56 |
+
- N=5: 35 moves
|
| 57 |
+
- N=7: 63 moves
|
| 58 |
+
- N=10: **120 moves**
|
| 59 |
+
|
| 60 |
+
2. **Dead-End Configurations**: Many move sequences lead to unsolvable states
|
| 61 |
+
- Requires lookahead to avoid traps
|
| 62 |
+
- Greedy strategies fail
|
| 63 |
+
|
| 64 |
+
3. **Constrained Move Grammar**: Jump rule only works when specific checker colors are adjacent
|
| 65 |
+
- Appears in few valid configurations during solving
|
| 66 |
+
|
| 67 |
+
---
|
| 68 |
+
|
| 69 |
+
## 📋 State Representation
|
| 70 |
+
|
| 71 |
+
States are represented as **lists of length 2N+1**, where each element is:
|
| 72 |
+
- `RX`: Red checker X
|
| 73 |
+
- `BX`: Blue checker X
|
| 74 |
+
- `_`: Empty space
|
| 75 |
+
|
| 76 |
+
### Format
|
| 77 |
+
```python
|
| 78 |
+
['R1', 'B1', '_', 'R2', 'B2']
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
This represents a board with 2 red and 2 blue checkers:
|
| 82 |
+
- Position 0: Red checker 1
|
| 83 |
+
- Position 1: Blue checker 1
|
| 84 |
+
- Position 2: Empty space
|
| 85 |
+
- Position 3: Red checker 2
|
| 86 |
+
- Position 4: Blue checker 2
|
| 87 |
+
|
| 88 |
+
### Move Representation
|
| 89 |
+
```python
|
| 90 |
+
['B1', 1, 2]
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
This represents: **Move blue checker B1 from position 1 to position 2**
|
| 94 |
+
|
| 95 |
+
Format: `[checker_id, source_position, destination_position]`
|
| 96 |
+
|
| 97 |
+
---
|
| 98 |
+
|
| 99 |
+
## 🖼️ Example Puzzle
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
|
| 103 |
+
### Example Trajectory (N=2)
|
| 104 |
+
|
| 105 |
+
**Initial State**: `['R1', 'R2', '_', 'B1', 'B2']`
|
| 106 |
+
**Goal State**: `['B1', 'B2', '_', 'R1', 'R2']`
|
| 107 |
+
**Blue Direction**: Right (moving from left side)
|
| 108 |
+
**Optimal Solution Length**: 8 moves ((2+1)² - 1 = 8)
|
| 109 |
+
|
| 110 |
+
**Partial solution (first 4 moves):**
|
| 111 |
+
|
| 112 |
+
| Step | Current State | Next State | Move | Type |
|
| 113 |
+
|------|--------------|-----------|------|------|
|
| 114 |
+
| 0 | `['R1','R2','_','B1','B2']` | `['R1','_','R2','B1','B2']` | `['R2',1,2]` | Slide right |
|
| 115 |
+
| 1 | `['R1','_','R2','B1','B2']` | `['R1','B1','R2','_','B2']` | `['B1',3,1]` | Jump over R2 |
|
| 116 |
+
| 2 | `['R1','B1','R2','_','B2']` | `['R1','B1','R2','B2','_']` | `['B2',4,3]` | Slide left |
|
| 117 |
+
| 3 | `['R1','B1','R2','B2','_']` | `['R1','B1','_','B2','R2']` | `['R2',2,4]` | Jump over B2 |
|
| 118 |
+
| ... | ... | ... | ... | ... |
|
| 119 |
+
|
| 120 |
+
---
|
| 121 |
+
|
| 122 |
+
## 📁 CSV Column Descriptions
|
| 123 |
+
|
| 124 |
+
### Columns
|
| 125 |
+
|
| 126 |
+
| Column | Type | Description |
|
| 127 |
+
|--------|------|-------------|
|
| 128 |
+
| `N` | int | Number of checkers per color (difficulty parameter) |
|
| 129 |
+
| `start_state` | string | Initial board configuration |
|
| 130 |
+
| `goal_state` | string | Target board configuration |
|
| 131 |
+
| `blue_direction` | string | Direction blue checkers move ('Right' or 'Left') |
|
| 132 |
+
| `current_state` | string | Board state before this move |
|
| 133 |
+
| `next_state` | string | Board state after applying this move |
|
| 134 |
+
| `move` | string | Action taken: `[checker_id, source_pos, dest_pos]` |
|
| 135 |
+
|
| 136 |
+
### Data Format
|
| 137 |
+
|
| 138 |
+
Each row represents one **move** in a solution trajectory.
|
| 139 |
+
|
| 140 |
+
**Example CSV rows:**
|
| 141 |
+
```csv
|
| 142 |
+
N,start_state,goal_state,blue_direction,current_state,next_state,move
|
| 143 |
+
2,"['R1','R2','_','B1','B2']","['B1','B2','_','R1','R2']",Right,"['R1','R2','_','B1','B2']","['R1','_','R2','B1','B2']","['R2',1,2]"
|
| 144 |
+
2,"['R1','R2','_','B1','B2']","['B1','B2','_','R1','R2']",Right,"['R1','_','R2','B1','B2']","['R1','B1','R2','_','B2']","['B1',3,1]"
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
---
|
| 148 |
+
|
| 149 |
+
## 💡 Usage Tips
|
| 150 |
+
|
| 151 |
+
### For Model Training
|
| 152 |
+
|
| 153 |
+
⚠️ **Warning**: Checkers Jumping is very difficult for sequence models.
|
| 154 |
+
|
| 155 |
+
Potential approaches:
|
| 156 |
+
1. **Add lookahead signals**: Explicitly mark moves that lead to dead-ends
|
| 157 |
+
2. **State value estimation**: Train a critic to estimate "solvability" from state
|
| 158 |
+
3. **Search augmentation**: Use beam search with constraint checking
|
| 159 |
+
4. **Curriculum with filtering**: Only train on near-optimal paths, filter dead-ends
|
| 160 |
+
|
| 161 |
+
### For Evaluation
|
| 162 |
+
|
| 163 |
+
```python
|
| 164 |
+
from datasets import load_dataset
|
| 165 |
+
|
| 166 |
+
# Load Checkers Jumping
|
| 167 |
+
dataset = load_dataset("gmannem/RecurrReason", "checkers_jumping")
|
| 168 |
+
|
| 169 |
+
def evaluate_checkers(model, example):
|
| 170 |
+
"""
|
| 171 |
+
Evaluation must detect dead-end configurations.
|
| 172 |
+
"""
|
| 173 |
+
current = example['start_state']
|
| 174 |
+
goal = example['goal_state']
|
| 175 |
+
blue_dir = example['blue_direction']
|
| 176 |
+
visited = set()
|
| 177 |
+
steps = 0
|
| 178 |
+
max_steps = 2 * ((example['N'] + 1)**2 - 1)
|
| 179 |
+
|
| 180 |
+
while steps < max_steps:
|
| 181 |
+
next_state = model.predict(current, goal)
|
| 182 |
+
|
| 183 |
+
# Check move validity
|
| 184 |
+
if not is_valid_move(current, next_state, blue_dir):
|
| 185 |
+
return "INVALID_MOVE", steps
|
| 186 |
+
|
| 187 |
+
# Check for loops
|
| 188 |
+
if next_state in visited:
|
| 189 |
+
return "LOOP", steps
|
| 190 |
+
|
| 191 |
+
# Check if dead-end (unsolvable from this state)
|
| 192 |
+
if is_dead_end(next_state, goal):
|
| 193 |
+
return "DEAD_END", steps
|
| 194 |
+
|
| 195 |
+
if next_state == goal:
|
| 196 |
+
return "SUCCESS", steps
|
| 197 |
+
|
| 198 |
+
visited.add(next_state)
|
| 199 |
+
current = next_state
|
| 200 |
+
steps += 1
|
| 201 |
+
|
| 202 |
+
return "TIMEOUT", steps
|
| 203 |
+
|
| 204 |
+
def is_valid_move(current, next_state, blue_dir):
|
| 205 |
+
"""
|
| 206 |
+
Verify:
|
| 207 |
+
1. Only one checker moved
|
| 208 |
+
2. Moved in allowed direction (based on color and blue_dir)
|
| 209 |
+
3. Either slid 1 position or jumped over opposite color
|
| 210 |
+
"""
|
| 211 |
+
# Implementation depends on detailed rule checking
|
| 212 |
+
pass
|
| 213 |
+
|
| 214 |
+
def is_dead_end(state, goal):
|
| 215 |
+
"""
|
| 216 |
+
BFS from state to check if goal is reachable.
|
| 217 |
+
Expensive but necessary for true evaluation.
|
| 218 |
+
"""
|
| 219 |
+
# Run BFS search
|
| 220 |
+
pass
|
| 221 |
+
```
|
| 222 |
+
|
| 223 |
+
---
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
## 📚 References
|
| 227 |
+
|
| 228 |
+
**Main Paper:**
|
| 229 |
+
```bibtex
|
| 230 |
+
@inproceedings{mannem2026recurrent,
|
| 231 |
+
title={Recurrent Reasoning on Symbolic Puzzles with Sequence Models},
|
| 232 |
+
author={Gowrav Mannem and Chowdhury Marzia Mahjabin and Jason Chen and Shivank Garg and Kevin Zhu},
|
| 233 |
+
booktitle={ICLR 2026 Workshop on Logical Reasoning of Large Language Models},
|
| 234 |
+
year={2026}
|
| 235 |
+
}
|
| 236 |
+
```
|
| 237 |
+
|
| 238 |
+
**Original Puzzle Introduction:**
|
| 239 |
+
```bibtex
|
| 240 |
+
@article{shojaee2025illusion,
|
| 241 |
+
title={The illusion of thinking: Understanding the strengths and limitations of reasoning models via the lens of problem complexity},
|
| 242 |
+
author={Shojaee, Parshin and Mirzadeh, Iman and Alizadeh, Keivan and Horton, Maxwell and Bengio, Samy and Farajtabar, Mehrdad},
|
| 243 |
+
journal={arXiv preprint arXiv:2506.06941},
|
| 244 |
+
year={2025}
|
| 245 |
+
}
|
| 246 |
+
```
|
| 247 |
+
|
| 248 |
+
---
|
| 249 |
+
|
| 250 |
+
[← Back to Main README](README.md)
|