Stable marriage problem or stable matching problem is a popular algorithm to match two set of entities where both have preferences over the other set. Elements of a set give ratings or state their choices from the other set. The problem is to find betterÂ match (if not best). Here is a java implementation of the algorithm (in a modified form, where one set prioritizes elements from another set, but another set does not have any say on how they get prioritized).

Advertisements