I have two distinct sets of N workers and M team leaders. I have to form teams (of size K) chosen from N, where they are allocated to one of the M team leader based on some metrics, i.e. I am going to assign a score to each pair (worker, team leader) and I'd like to maximize the scores of the teams.
It's been at least 10 years since my last implementation of an optimization algorithm (and more than 15 years since my last Operational Research exam at Uni), so my apologies if my description is not as clear as it should be.
I am searching for the best algorithm to provide a solution (that can also be sub-optimal), and I have found suggestions about the Hungarian Algorithm, but I understand that works only where K=2 (so each team leader will only manage a worker)
What about K-Means clustering? (if I can think about the teams as clusters, minimize the distance of each worker from the best-suited team leader, then choose the top K workers for each cluster)
Also, some algorithms I found (i.e. hospitals/residents, based on the stable marriages) seem to be based on "preferences" listed by the workers to be allocated, while here I will have a measure of the affinity between worker and TL. I was also thinking about using the Jaccard index for it but again, I feel like I am doing a patchwork of something I don't really master, and sadly I don't have enough time to study it.
Any other suggestion please? Also if you could keep the answer language-agnostic please! Thanks Vincenzo