Menu

Definitions for Zebra and Sherlock

General Definitions

Problem Definitions

The Zebra Problem Is a standard test for constraint satisfaction algorithms. In [Prosser93] it is defined as follows:

Zebra Table

                             
RBYGIRBYGIRBYGIRBYGIRBYGI
OPKLCOPKLCOPKLCOPKLCOPKLC
NUESJNUESJNUESJNUESJNUESJ
ZDHFSZDHFSZDHFSZDHFSZDHFS
CTWMOCTWMOCTWMOCTWMOCTWMO

All instances of the Zebra have the following constraints:

For the purposes of the paper, the query is, “Who lives in which house, smokes which brand of cigarette, is a citizen of which country, owns which pet, and drinks which drink?” The benchmark Zebra problem has the following constraints:

Sherlock problem definition

Sherlock problem initial states

RBlYGIBrRBlYGIBrRBlYGIBrRBlYGIBrRBlYGIBrRBlYGIBr
NUESJANUESJANUESJANUESJANUESJANUESJA
123456123456123456123456123456123456
POABCSPOABCSPOABCSPOABCSPOABCSPOABCS
StHSlORDStHSlORDStHSlORDStHSlORDStHSlORDStHSlORD
HOLMESHOLMESHOLMESHOLMESHOLMESHOLMES

All instances of the Sherlock have the following constraints:


  1. Note that all constraints are also present reversed (i.e. Vi next-to-and-right-of Vj requires that Vj next-to-and-left-of Vi also be in the set of constraints.) ↩︎

  2. For the sake of simplicity this is replaced with Vi next-to Vj, Vi next-to Vk, and Vj not-same-column-as Vk ↩︎

  3. Note that all constraints are also present reversed. ↩︎