How to rearrange array using Python?

Martin Schöön martin.schoon at gmail.com
Tue Oct 20 14:57:03 EDT 2015


It has been a while.
I have mastered solving Kenken and Sudoku using Python-constraint.

I still have no clue on how to tell the solver how to constrain
the number of occupants in rooms: I have made up an simple example
with nine persons and three rooms. Wishes for room mates are 
mild in the extreme so it is very easy for a human to place these
nine persons in the three three-bed rooms such that all wishes are
fulfilled. Python-constraint set up by me finds 27 solutions of
which most place more than three persons in at least one room.

Anyone into CSP willing to offer me a hint?

/Martin



More information about the Python-list mailing list