I have X number of students, where X is a multiple of 6. I now want to split up the students into groups of 6.
I have a function that measures how \"good\" a group o
I would start by a very simple "random search" algorithm:
start from a random solution (a partition of X to groups), call it S[0]
score[0] = black_box_socre(S[0])
i = 0
while (some condition):
i++
S[i] = some small permutation on S[i-1] # (1)
score[i] = black_box_score(S[i])
if score[i] < score[i-1]: # (2)
S[i] = S[i-1]
score[i] = score[i-1]
(1) - small permutation could be in your case, switching 2 people between groups.
(2) - If we made a change that made our solution worse (lower score) we reject it. You can later replace this with also accepting worse solutions with some probability, to make this algorithm into simulated annealing.
Start by simply running this for 1000 iteration or so, and plot score[i] as a function of i, to get a feeling of how fast your solution is improving. Run this several times (to try different random starting points).
Then you can play with different permutations (1), make the algorithm less greedy (2), or add some fancy automatic logic to stop the search (e.g., no progress in the last T
iterations).