Re: Social Golfers

From: Mark A. Hennessy <>
Date: Wed 13 Oct 2004 12:15:19 PM GMT
Message-ID: <>
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
         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?

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