Using answer set programming do question 4 in file:
Our class has 13 students. Suppose that we need to divide our class
into four groups. Each group has 3 or 4 students. For simplicity, we will refer to
the student by number, from 1 to 13. We will use the atom
student(1..13)
to encode the students in the class.
Students like (or do not like) to work with each other. Suppose that we also have
some information like
like(1,2). like(12,3). like(13,5). like(7,8).
dislike(1,13). dislike(2,7). dislike(6,5). dislike(3,9).
The above relations are assumed to be symmetric.
Write an ASP program that helps me divide the students into four groups, each
group has at least 3 and at most four students such that
a. No group has two people who dislike each other
b. The number of pairs who like each other and are in different groups is
minimal.
c. Compute 5 solutions for your program using clingo given that the like
and dislike relations are given above.
d. How many solutions does your program have? What is the command line
that you use to get this information?