Showing posts from October, 2012

A Very Real Life Application of the Stable Marriage Problem

I recently stumbled upon a mathematical problem known as the  Stable Marriage Problem (SMP).  Per Wikipedia, the problem is commonly stated as: Given N men and N women, where each person has ranked all members of the opposite sex with a unique number between 1 and n in order of preference, marry the men and women together such that there are no two people of opposite sex who would both rather have each other than their current partners. If there are no such people, all the marriages are "stable". The SMP has real-life applications to any problem requiring stable pairing of two sets of equal size. In fact, this problem is always solvable using the Gale-Shapley algorithm . There is a rather big catch however.  While the marriages are always stable, they may not be ideal from the vantage point of an individual.  To illustrate this, imagine three men A,B,C and three women X,Y,Z. Here are their ranked preferences for members of the other group: A: YXZ B: ZYX C: XZY X