In mathematics and computer science, the stable marriage problem (SMP) is the problem of finding a stable matching between two sets of elements given a set of preferences for each element. A matching is a mapping from the elements of one set to the elements of the other set. A matching is stable whenever it is not the case that both:
- some given element A of the first matched set prefers some given element B of the second matched set over the element to which A is already matched, and
- B also prefers A over the element to which B is already matched
In other words, a matching is stable when there does not exist any alternative pairing (A, B) in which both A and B are individually better off than they would be with the element to which they are currently matched.
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 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".
Algorithms for finding solutions to the stable marriage problem have applications in a variety of real-world situations, perhaps the best known of these being in the assignment of graduating medical students to their first hospital appointments.
Read more about Stable Marriage Problem: Solution, Algorithm, Optimality of The Solution, Similar Problems
Famous quotes containing the words stable, marriage and/or problem:
“In short, no association or alliance can be happy or stable without me. People cant long tolerate a ruler, nor can a master his servant, a maid her mistress, a teacher his pupil, a friend his friend nor a wife her husband, a landlord his tenant, a soldier his comrade nor a party-goer his companion, unless they sometimes have illusions about each other, make use of flattery, and have the sense to turn a blind eye and sweeten life for themselves with the honey of folly.”
—Desiderius Erasmus (c. 14661536)
“Our home has been nothing but a play-room. Ive been your doll-wife here, just as at home I was Papas doll-child. And the children have been my dolls in their turn. I liked it when you came and played with me, just as they liked it when I came and played with them. Thats what our marriage has been, Torvald.”
—Henrik Ibsen (18281906)
“Our political problem now is Can we, as a nation, continue together permanentlyforeverhalf slave, and half free? The problem is too mighty for me. May God, in his mercy, superintend the solution.”
—Abraham Lincoln (18091865)