I am a beginner to Answer Set Programming. I want to group all students in a different groups such that: 1. Each group has 3 to 4 students 2. No two students who dislike each other are in the same group. 3. And we can not assign same student to different groups.
I have written like:
%suppose there are total 6 students
student(1..6).
%suppose there are 2 groups
group(1..2).
%1 and 4 like each other, 4 and 5 dislike each other
dislike(1,4). dislike(5,4).
% each group has 3 to 4 students
:- group(G), #count {S : in(S,G)} < 3.
:- group(G), #count {S : in(S,G)} > 4.
I have added the constraint for how many students each group can contain but have got no clue about how satisfy other two conditions.
Your help will be greatly appreciated. Thanks.