Sorting dominoes

DaveM asma61 at dsl.pipex.com
Mon Nov 14 02:52:44 CET 2005


Essentially, I'm trying to sort 12 dominoes. Each domino has two different
numbers and there are two of every number. Identical dominoes are possible,
but doubles are not.

The problem is to place the dominoes in a line, side to side, so that two
columns (or rows, depending how you orientate them) are formed, with each
number appearing once in each column(row).

I thought this would be the easy part of the program I'm writing, but so far
some initial states have defeated every attempt I've made, short of
re-shuffling the dominoes after an arbitrary number of attempts.

I'm sure I'll work out an effective algorithm eventually, but I suspect I'm
re-inventing the wheel, so any hints on the best way to tackle this would be
appreciated!

DaveM 



More information about the Python-list mailing list