Implementation:Open compass VLMEvalKit VGRPBench Hitori
| Field | Value |
|---|---|
| source | VLMEvalKit |
| domain | Vision, Evaluation, Puzzle_Solving |
Overview
Implements constraint checking and puzzle factory for the Hitori shading puzzle in VGRPBench.
Description
This module defines constraint validators and a puzzle factory for the Hitori puzzle type, where cells are shaded or unshaded to eliminate duplicate numbers in rows and columns. The ConstraintHitoriNoRepeat class ensures no duplicate numbers appear among unshaded cells in any row or column. The ConstraintHitoriAdjacent class prevents two shaded cells from being orthogonally adjacent. The ConstraintHitoriConnected class uses BFS to verify all unshaded cells form a single connected component.
Usage
Called internally by VGRPBench evaluation pipeline for puzzle constraint verification.
Code Reference
- Source:
vlmeval/dataset/utils/vgrpbench/puzzles/hitori.py, Lines: L1-109 - Import:
from vlmeval.dataset.utils.vgrpbench.puzzles.hitori import HitoriPuzzleFactory
Key Classes:
class ConstraintHitoriNoRepeat(Constraint): ...
class ConstraintHitoriAdjacent(Constraint): ...
class ConstraintHitoriConnected(Constraint): ...
class HitoriPuzzleFactory(PuzzleFactory): ...
I/O Contract
| Direction | Description |
|---|---|
| Inputs | Puzzle grid state with board (shading state) and numbers matrix for the underlying grid values |
| Outputs | Boolean validation result or constraint violations |
Usage Examples
# Internal usage
from vlmeval.dataset.utils.vgrpbench.puzzles.hitori import HitoriPuzzleFactory
factory = HitoriPuzzleFactory(size=5)
result = factory.check(game_state)