Implementation:Open compass VLMEvalKit VGRPBench Kakuro
| Field | Value |
|---|---|
| source | VLMEvalKit |
| domain | Vision, Evaluation, Puzzle_Solving |
Overview
Implements constraint checking and puzzle factory for the Kakuro sum puzzle in VGRPBench.
Description
This module defines constraint validators and a puzzle factory for the Kakuro puzzle type, where cells must be filled with numbers that sum to target values for each row and column. The ConstraintKakuroSum class validates that partial sums do not exceed targets and completed lines match exactly. The ConstraintKakuroAdjacent class ensures no two orthogonally adjacent cells contain the same number. The KakuroPuzzleFactory supports grid sizes from 3 to 12 and uses numeric values from 1 to the grid size.
Usage
Called internally by VGRPBench evaluation pipeline for puzzle constraint verification.
Code Reference
- Source:
vlmeval/dataset/utils/vgrpbench/puzzles/kakuro.py, Lines: L1-91 - Import:
from vlmeval.dataset.utils.vgrpbench.puzzles.kakuro import KakuroPuzzleFactory
Key Classes:
class ConstraintKakuroSum(Constraint): ...
class ConstraintKakuroAdjacent(Constraint): ...
class KakuroPuzzleFactory(PuzzleFactory): ...
I/O Contract
| Direction | Description |
|---|---|
| Inputs | Puzzle grid state with board and sums dictionary containing row and column target sums |
| Outputs | Boolean validation result or constraint violations |
Usage Examples
# Internal usage
from vlmeval.dataset.utils.vgrpbench.puzzles.kakuro import KakuroPuzzleFactory
factory = KakuroPuzzleFactory(size=4)
result = factory.check(game_state)