Implementation:Open compass VLMEvalKit VGRPBench Skyscraper
| Field | Value |
|---|---|
| source | VLMEvalKit |
| domain | Vision, Evaluation, Puzzle_Solving |
Overview
Implements constraint checking and puzzle factory for the Skyscraper visibility puzzle in VGRPBench.
Description
This module defines constraint validators and a puzzle factory for the Skyscraper puzzle type, where cells represent building heights and edge clues indicate the number of visible buildings from each direction. The ConstraintRowNoRepeat and ConstraintColNoRepeat classes enforce Latin square uniqueness. The ConstraintVisibility class uses a calculate_visible_buildings method to count buildings visible from each of the four edge directions (top, bottom, left, right) and validates against the provided clues. The SkyscraperPuzzleFactory supports grid sizes from 4 to 12.
Usage
Called internally by VGRPBench evaluation pipeline for puzzle constraint verification.
Code Reference
- Source:
vlmeval/dataset/utils/vgrpbench/puzzles/skyscraper.py, Lines: L1-95 - Import:
from vlmeval.dataset.utils.vgrpbench.puzzles.skyscraper import SkyscraperPuzzleFactory
Key Classes:
class ConstraintRowNoRepeat(Constraint): ...
class ConstraintColNoRepeat(Constraint): ...
class ConstraintVisibility(Constraint): ...
class SkyscraperPuzzleFactory(PuzzleFactory): ...
I/O Contract
| Direction | Description |
|---|---|
| Inputs | Puzzle grid state with board and clues dictionary containing top, bottom, left, and right visibility counts |
| Outputs | Boolean validation result or constraint violations |
Usage Examples
# Internal usage
from vlmeval.dataset.utils.vgrpbench.puzzles.skyscraper import SkyscraperPuzzleFactory
factory = SkyscraperPuzzleFactory(size=5)
result = factory.check(game_state)