Dear,
I'd like to provide a linear programming idea here by using 30 students & 5 groups.
It is recommended to use an open source solver named "Open Solver".
The decision variables are : Xij, assign student i in group j.
The typical constraints are:
1) each student is assigned in only one group.
2) each group containts 6 students(30 students in 5 groups).
To apply the preference constraints, typically there are two methods:
1) multiply the assignment choice for the two students, sum up and then maximize it. For example, if the 2 students are in the same group, that the two students will have a score of 2, if not in the same group, the score will be 0. This will force Solver to put the two students in the same group. This is a nonlinear programming - Because the two variables are multiplying with each other.
2) use minMax method, introduce a set of binary variables, Ytj
Ytj >= Xnj - Xkj, and then minimize Sum of Wj*Ytj, Wj is the weight we set, which is constant.
This is a linear programming.
Bookmarks