讲解下该问题 ( from Algorithm Design written by Jon and Eva)
Origin:
双方根据自己的喜好配对
Formulating the Problem:
如果以applicant 和 company 举例,company 会招很多applicant, 并且company 的slot 比applicant多. 所以此时我们简化问题。
bare-bones version: 双方都只能和对方其中一个配对。
preferences: each member in M ranks each member in W, no ties
Definition
Matching S: a set of ordered pairs, with the property that each member of M and each member of W appears in at most one pair in S
Perfect matching S: each member of M and each member of W appears in exactly one pair in S
简单来说,matching S 可以只包含部分元素(如果两边个数不等), 但stable matching 需要两边数目一样。
Stable Matching: (1) perfect matching (2) no instability with respect to S 首先一定要perfect, 不然没法判断有没有stable 的pair
一个matching中可以有多个stable matching (书中最简单的例子,每边2个,只要左边的人选的都是第一志愿,他们肯定不会分开;同理,还可以是右边所有人)
Stable Matching
1. stable matching exists for every set of preference list ( 一定存在)