Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Martin =?UTF-8?Q?Sch=C3=B6=C3=B6n?= Newsgroups: comp.lang.python Subject: Re: How to rearrange array using Python? Date: 20 Oct 2015 18:57:03 GMT Organization: @ Home Lines: 14 Message-ID: References: <1468455.P0rGZF1LBf@PointedEars.de> X-Trace: individual.net MNAnZkCCV+Om3bdZLrwa1Q5TU87EcMgeQiXcYRzclx4OUeC+Sb Cancel-Lock: sha1:rjrkqrhX16OO+KAkhZCbElwW1TE= User-Agent: slrn/pre1.0.0-18 (Linux) Xref: csiph.com comp.lang.python:97841 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