Algorithms for finding solutions to the stable marriage problem have applications in a variety of real-world situations. The stable marriage problem is commonly stated as: Given n men and n women, where each person has ranked all members of the opposite sex with an 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".