Re: Social Golfers

From: Mark A. Hennessy <m.hennessy_at_4c.ucc.ie>
Date: Wed 13 Oct 2004 12:15:19 PM GMT
Message-ID: <416D1C57.6040908@4c.ucc.ie>
Hi Warwick,

    Once again. Thanks for your help. Yes this works just fine. My 
attempt at C4 was:

    % C4: All pairs of golfers must play each other at most once
    (for(X,1,NumGolfers-1), param(Groups,Weeks,NumGolfers) do
        (for(Y,X+1,NumGolfers), param(X,Groups,Weeks) do
        (for(W,1,Weeks),
         foreach(U,List), param(Y,X,Groups) do
            (Groups[X,W] == Groups[Y,W] ->
            U is 1
            ;
            U is 0
            )
         sum(List) #=< 1
        )
        )
    ).

I did now know to create this constraint correctly.

#=(Groups[X, W], Groups[Y, W], Bool)

Also, I realised that what I really want here is sum(List)  #= 1 since 
I'm interested in maximum socialization.

I'm not clear on how the sorted constraint you suggested, instead of G 
occurrence constraints on each Groups column, can enforce
Group size?

Thanks,
Mark.
Received on Wed Oct 13 13:19:37 2004

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:30 PM GMT GMT