120 likes | 240 Views
The Stable M arriage Problem. William Decker. The Problem. Matching problem between two sets Want to pair all people in Set 1 with someone in Set 2 Constraints All partners must be unique (nobody can be married to multiple people at the same time) Everyone must have a partner
E N D
The Stable Marriage Problem William Decker
The Problem • Matching problem between two sets • Want to pair all people in Set 1 with someone in Set 2 • Constraints • All partners must be unique (nobody can be married to multiple people at the same time) • Everyone must have a partner • Each person has a ranked list of their preferred partners in the other group • All pairs must be formed such that no two people exit who would both rather be paired with each other than their current partners
Gale-Shapley Algorithm • The algorithm to solve this problem for an equal number was determined by Economists David Gale and Lloyd Shapely in 1962. The algorithm is based on multiple “rounds” of proposals and engagements Let Set 1 be the group that offers proposals and Set 2 be the group that receives them While (there are members of Set 1 who are still single) { All single members in Set 1 propose to their preferred partner* All members of Set 2 who received proposals evaluate their options. If they aren’t engaged yet, they accept and both become engaged If they prefer the proposal more than their current fiancé, they switch the old fiancé is now single again Otherwise they reject the proposal and the proposer remains single } Everyone marries their fiancé *Once Person X proposes to Person Y, they cannot propose to them again. If they must propose again, they will do so to their next most preferred option regardless of whether or not that person is engaged
Example • Proposers • Bill – Sarah, Emma, Kate • James – Emma, Kate, Sarah • Mark – Sarah, Kate, Emma • Acceptors • Sarah – James, Mark, Bill • Emma – Bill, Mark, James • Kate – Mark, Bill, James
Round 1 Bill James Mark Emma Sarah Kate Bill James Mark Emma Sarah Kate
Round 2 Bill James Mark Emma Sarah Kate Bill James Mark Emma Sarah Kate
Round 3 Bill James Mark Emma Sarah Kate Bill James Mark Emma Sarah Kate
Results • Proposers • Bill – Sarah, Emma, Kate • James – Emma, Kate, Sarah • Mark – Sarah, Kate, Emma • Acceptors • Sarah – James, Mark, Bill • Emma – Bill, Mark, James • Kate – Mark, Bill, James Bill James Mark Emma Sarah Kate
The algorithm guarantees that… • Everyone gets married • Once someone in Set 2 becomes engaged, they can switch partners, but will never become single again. There cannot be a pair of single people at the end, since at some point, said man would have proposed to every woman, and since she was not engaged, she would have had to accept his initial proposal. • The Marriages are stable • Let Person A from Set 1 and Person B from Set 2 be engaged to different people at the end of the matchmaking process. If Person A preferred Person B to his current Partner, then he would have proposed to them first, which means Person B either rejected them or dumped them later. Person B therefore prefers their current partner. • If Person B prefers Person A to their current partner, then they would have accepted a proposal from Person A. Person A must have proposed to their current partner first meaning they would not prefer Person B.
Final Notes Optimality • While not everybody is guaranteed to get their first choice, the algorithm is Pareto Optimal. Variations • Ties – some partners are equally preferable • Incomplete lists – some partners are unacceptable matches • Agents – the proposals and evaluations are carried out by agents who are only aware of their client(s) preferences. • Single Set – all participants are in a single group Applications • Roommate pairing • School / applicant matching • Router and LAN network switches
Source Damianidis, I. (2010). The stable marriage problem – optimizing different criteria using genetic algorithms (Unpublished doctoral dissertation). HogskolanI Boras, Boras, Sweden.