3 ms·
My favorite programming assignment in school was a Scheme implementation of the "stable marriage algorithm". "Let's assume, for the sake of an argument, that y
by fleaflicker 19y ago
My favorite programming assignment in school was a Scheme implementation of the "stable marriage algorithm".
"Let's assume, for the sake of an argument, that you are a village matchmaker given the task of marrying
100 men and 100 women. Each of the men has ranked the women from 1 to 100 in the order of his preference;
each woman, not to be outdone, has similarly ranked the 100 men...Rather than insist that everyone get their first choice, you are instead charged with creating 100 stable
marriages. A set of marriages is said to be stable if there exists no man m and woman w such that m likes
w better than his wife, and w likes m better than her husband. The notion is called "stability" as m's and
w's marriages are unstable, since (albeit sordid and tawdry) m and w could optimize their sorry lot in life
by leaving their mates and running off together."
Non-PDF link:
http://64.233.169.104/search?q=cache:abZ7sCKHUmYJ:www.cs.brandeis.edu/~mairson/Courses/cs21b/marry.pdf&hl=en&ct=clnk&cd=1&gl=us http://64.233.169.104/search?q=cache:abZ7sCKHUmYJ:www.cs.bra...
Not the same as algorithms discussed in the article but fun and interesting.
- kirubakaran 19y agoM1 likes W1 who likes M2 who likes W2 who likes M1. Can the four of them elope as a group? (btw, it is a dull society without WSW)
- mixmax 19y agointeresting point...