Stable
Matching
🐶🐱
Input: preference lists for n families 🏠 and n animals 🐶🐱
Output: a stable matching 🏠 💙 🐶🐱

What is a matching?
Matching: set M of family-animal pairs where each family/animal is in at most one pair

What is a perfect matching?
Perfect Matching: each family/animal in exactly one pair (required to have same number of families as animals)

What is instability?
Instability (with respect to matching M): a pair (f, j) does not exist in M such that:
  • (f, j’) exists in M, but f prefers j to j’
  • (f’, j) exists in M, but j prefers f to f’
So (f, j) is the instability

What is a stable matching?
Stable Matching: perfect matching with no instabilities