.

http://en.wikipedia.org/wiki/Stable_marriage_problem