Reputation: 53
I need to create an algorithm where I have two lists of unequal size, called Students and Teachers. There are many more Students than there are Teachers. I need to create a pairing for each Student, where each Teacher is matched with approximately the same number of Students.
The complication is that I have a collection of pairings which are unacceptable. Specifically, each Student may have one or more Teachers with whom he cannot be paired.
I know I could do a very efficient greedy algorithm that just starts matching arbitrarily and skips over matches that don't work, since the number of Students to which each Teacher is assigned doesn't have to be exact. Regardless, I would love an efficient and complete way to do this. Thanks for any advice you can offer!
Upvotes: 0
Views: 179
Reputation: 1563
I would start from the most limited matching to less limited this will leave the unlimited matching last and you can use them to balance.
Upvotes: 1