Need an adaptive algorithm for participant subgroups that balances repeated pairings
It sounds like the stakes are low, so I would suggest something simple and &quot;good enough&quot;, rather than looking for fancy algorithms that will be guaranteed to give the optimal solution.  One approach is to take the approach you're already considering, but break ties randomly.  This seems like it may do well enough in practice: it is possible to get  into a bad situation, but the randomness might make that unlikely; and this might occasionally have one student participate a little more than they otherwise would, but that I'd expect that to average out over time and so maybe it isn't a big deal.