Implementation:Open compass VLMEvalKit VGRPBench OddEvenSudoku
| Field | Value |
|---|---|
| source | VLMEvalKit |
| domain | Vision, Evaluation, Puzzle_Solving |
Overview
Implements constraint checking and puzzle factory for the Odd-Even Sudoku variant in VGRPBench.
Description
This module defines constraint validators and a puzzle factory for the Odd-Even Sudoku puzzle type, extending standard Sudoku with parity constraints on cells. The ConstraintOddEven class ensures cells marked 'w' (white) contain even numbers and cells marked 'b' (black) contain odd numbers. The module also provides local ConstraintRowNoRepeat, ConstraintColNoRepeat, and ConstraintSubGridNoRepeat classes for standard Sudoku uniqueness rules. The OddEvenSudokuPuzzleFactory filters possible values based on cell parity type before constraint checking.
Usage
Called internally by VGRPBench evaluation pipeline for puzzle constraint verification.
Code Reference
- Source:
vlmeval/dataset/utils/vgrpbench/puzzles/oddevensudoku.py, Lines: L1-117 - Import:
from vlmeval.dataset.utils.vgrpbench.puzzles.oddevensudoku import OddEvenSudokuPuzzleFactory
Key Classes:
class ConstraintOddEven(Constraint): ...
class ConstraintRowNoRepeat(Constraint): ...
class ConstraintColNoRepeat(Constraint): ...
class ConstraintSubGridNoRepeat(Constraint): ...
class OddEvenSudokuPuzzleFactory(PuzzleFactory): ...
I/O Contract
| Direction | Description |
|---|---|
| Inputs | Puzzle grid state with board, cell_types parity matrix ('w' for even, 'b' for odd), and numeric values |
| Outputs | Boolean validation result or constraint violations |
Usage Examples
# Internal usage
from vlmeval.dataset.utils.vgrpbench.puzzles.oddevensudoku import OddEvenSudokuPuzzleFactory
factory = OddEvenSudokuPuzzleFactory(size=9)
result = factory.check(game_state)