Reputation: 560
Let's say I have
in a way where everyone meets as many people as possible with as little repetition as possible.
I've tried to do some research on my own but couldn't find anything that sounded like it was what I was looking for.
If you need any more information, just let me know.
Thanks in advance
Upvotes: 3
Views: 2087
Reputation: 11602
You can frame this as an integer programming problem.
Define a binary variable A[i,g,t] = 1
if person i in N
belongs to group g in G
at time t in T
and 0
otherwise. Then, M[i,j] = sum(A[i,g,t] * A[j,g,t] for g in G, t in T)
is 1
iff i
and j
meet.
Say you want to maximize the number of pairs of people who meet at least once. Then, your objective becomes sum(M[i,j] for i, j in N)
.
You can express your constraints linearly:
forall g in G, forall t in T, sum(A[i,g,t] for i in N) <= quota[g,t]
.forall i, forall t, sum(A[i,g,t] for g in G) = 1
.There are several open source solvers that should perform well at your proposed scale.
Upvotes: 0
Reputation: 65427
This is a close variant of the Social Golfer Problem. There's an algorithm due to Triska and Musliu that works well; see https://github.com/FelixHenninger/socialgolfer.js/tree/master for an implementation.
Upvotes: 3