Skip to content

VBVR-DataFactory/Multi-15_numbrix_pathfilling_data-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-15: Numbrix Path Filling Data Generator

Generates synthetic datasets for the Numbrix logic puzzle. The agent must fill every cell of a grid with consecutive integers from 1 to N², such that consecutive numbers occupy orthogonally adjacent cells, forming a Hamiltonian path through the grid.

Each sample pairs a task (first frame + prompt describing what needs to happen) with its ground truth solution (final frame showing the result + video demonstrating how to achieve it). This structure enables both model evaluation and training.


📌 Basic Information

Property Value
Task ID Multi-15
Task Numbrix Path Filling
Category Constraint Satisfaction Puzzles
Resolution 1024×1024 px
FPS 16 fps
Duration varies
Output PNG images + MP4 video

🚀 Usage

Installation

# 1. Clone the repository
git clone https://github.com/VBVR-DataFactory/Multi-15_numbrix_pathfilling_data-generator.git
cd Multi-15_numbrix_pathfilling_data-generator

# 2. Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# 3. Install dependencies
pip install --upgrade pip
pip install -r requirements.txt
pip install -e .

Generate Data

# Generate 50 samples
python examples/generate.py --num-samples 50

# Reproducible generation with seed
python examples/generate.py --num-samples 50 --seed 42

# Custom output directory
python examples/generate.py --num-samples 100 --output data/my_dataset

# Without videos (faster, images only)
python examples/generate.py --num-samples 50 --no-videos

Command-Line Options

Argument Description
--num-samples Number of tasks to generate (required)
--output Output directory (default: data/questions)
--seed Random seed for reproducibility
--no-videos Skip video generation (images only)

📖 Task Example

Prompt

[Scenario] The image shows a grid containing a few scattered numbers.
[Rules]
1. The grid must be filled with consecutive numbers from 1 to the highest number.
2. Consecutive numbers must be placed in orthogonally adjacent cells (up, down, left, or right). Diagonal connections are not allowed.
[Task] Generate a video showing the step-by-step completion of the Numbrix grid. Animate the placement of the missing numbers in sequence to form a single continuous orthogonal path.

Implicit rules (encoded in the puzzle's pre-printed clues):

  1. Fill every cell with a unique number from 1 to N² (where N is the grid side length).
  2. Consecutive numbers (k and k+1) must occupy orthogonally adjacent cells.
  3. Pre-printed clue numbers are fixed and cannot be moved.
  4. The completed grid forms a Hamiltonian path traversing all cells exactly once.

Visual

Initial Frame
Sparse clue cells in NxN grid
Animation
Numbers filled in valid 1→N² sequence
Final Frame
Complete Hamiltonian path drawn

📖 Task Description

Objective

Fill every cell of an NxN grid with consecutive integers 1, 2, …, N² so that each pair (k, k+1) lies in orthogonally adjacent cells, and the pre-printed clue numbers remain in place.

Task Setup

  • Grid: NxN cells (typically 6×6 to 9×9).
  • Clues: A subset of cells starts with fixed integer values (including 1 and N²).
  • Adjacency rule: Cells holding consecutive numbers must be 4-connected neighbors.
  • Uniqueness: Each puzzle has exactly one valid solution (verified by backtracking solver at generation time).
  • Animation: Numbers are revealed in their natural 1→N² sequence to visualize the Hamiltonian path emerging.

Key Features

  • Hamiltonian path constraint: Stronger than Sudoku — the solution must trace a single connected snake-like path covering every cell.
  • Bi-directional propagation: Each clue constrains both forward (k+1) and backward (k−1) cells, enabling pincer-style deduction.
  • No backtracking shortcut: Greedy or local strategies fail; long-range reachability arguments are required.
  • Visible path emergence: Frame-by-frame number placement makes intermediate state correctness directly verifiable.

📦 Data Format

data/questions/Multi-15_numbrix_pathfilling_data-generator_task/Multi-15_numbrix_pathfilling_data-generator_00000000/
├── first_frame.png            # Sparse clue grid
├── final_frame.png            # Fully filled Hamiltonian-path grid
├── prompt.txt                 # Task instruction
├── ground_truth.mp4           # Animation of stepwise filling
└── question_metadata.json     # Standardized VBVR task metadata

File specifications:

  • Images: 1024×1024 PNG format
  • Video: MP4 format, 16 fps, H.264 + yuv420p
  • Metadata: VBVR canonical schema with task_id, vbvr_task_code, media, parameters

🏷️ Tags

numbrix hamiltonian-path csp logic-puzzle path-filling multi-step-reasoning long-horizon


Part of the 36-Task Long-Horizon Multi-Step Reasoning Benchmark.

About

Multi-15: numbrix pathfilling data generator — Constraint Satisfaction Puzzles domain of the 36-task Long-Horizon Multi-Step Reasoning Benchmark.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages