This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.

26 lines
511 B
MiniZinc

include "globals.mzn";
1..infinity: weeks;
1..infinity: ngroups;
1..infinity: size;
enum golfers = anon_enum(ngroups * size);
set of int: groups = 1..g;
set of int: Rounds = 1..w;
array [rounds, groups] of var set of golfers: sched;
constraint forall (r in rounds, g in groups) (
card(sched[r, g]) = s
);
constraint forall(r in rounds) (
all_disjoint(g in groups)(sched[r, g])
);
constraint forall (a, b in golfers where a < b) (
sum (r in rounds, g in groups) (
{a, b} subset sched[r, g]
) <= 1
);