This question evaluates the ability to model and reason about constraint-satisfaction on a 2D grid, including logical inference with directional and adjacency relations, combinatorial placement constraints, and determination of uniqueness.
You are given a rectangular grid with R rows and C columns. A set of named entities (people) must each occupy exactly one distinct grid cell. A set of relational clues constrain where entities may be placed. Your goal is to determine whether the location (row, column) of a particular target person P is uniquely determined by the clues. If so, return that unique location; otherwise report that no unique solution exists.
Assumptions and definitions:
You may receive any combination of the following clues:
Clues are guaranteed to be mutually consistent (at least one full placement exists), but may or may not uniquely determine P's location.
Design an algorithm to:
Input (conceptual): R, C; set of entities E; target P ∈ E; list of clues of the types above.
Output: Either the unique (row, column) for P, or a statement that P is not uniquely determined.
Login required