chiark / gitweb /
Dominosa: add an Extreme difficulty, with forcing chains.
authorSimon Tatham <anakin@pobox.com>
Fri, 5 Apr 2019 18:40:42 +0000 (19:40 +0100)
committerSimon Tatham <anakin@pobox.com>
Fri, 5 Apr 2019 18:40:42 +0000 (19:40 +0100)
commit191843e0c71da265df20e387913c22900b2b8ca7
treef4869772683a0654ea8e0428b9d0041605cd39c0
parent7f00725c978bf79de91951f143cdfd2f9173041d
Dominosa: add an Extreme difficulty, with forcing chains.

This technique borrows its name from the Solo / Map deduction in which
you find a path of vertices in your graph each of which has two
possible values, such that a choice for one end vertex of the chain
forces everything along it. In Dominosa, an approximate analogue is a
path of squares each of which has only two possible domino placements
remaining, and it has the extra-useful property that it's
bidirectional - once you've identified such a path, either all the odd
domino placements along it must be right, or all the even ones. So if
you can find an inconsistency in either set, you can rule out the
whole lot and settle on the other set.

Having done that basic analysis (which turns out to be surprisingly
easy with an edsf to help), there are multiple ways you can actually
rule out one of the same-parity chains. One is if the same domino
would have to appear twice in it; another is if the set of dominoes
that the chain would place would rule out all the choices for some
completely different square. There are probably others too, but those
are the ones I've implemented.
dominosa.R
dominosa.c