csci 570

Stable Matching Problem

  • Context: Originated from medical residency pairings; involves matching two equal-sized sets (e.g., men and women) where each person has strict preferences over the opposite set.

  • Goal: Find a perfect matching (everyone is paired) that is stable, meaning no unmatched pair prefers each other over their current partners.

  • Key Terminology:

    • Matching: A set of disjoint pairs.

    • Perfect matching: Every individual in both sets is paired.

    • Bipartite graph: Two disjoint sets (e.g., men and women).

    • Stability: A perfect matching with no blocking pair.

    • Blocking pair (instability): An unmatched pair (M,W)(M, W) where $M prefers $W to his current partner, and $W prefers $M to her current partner.

    • Complete preference order: Each individual ranks all opposite-sex members without ties.

Core Concepts and Definitions
  • A stable matching is a perfect matching without instability.

  • Existence: At least one stable matching always exists (proven by Gale-Shapley).

  • Uniqueness: Stable matchings are not always unique; multiple can exist.

  • Real-world alignment: Stability prevents blocking coalitions, ensuring the matching holds.

Problem Setup
  • Examples include students and internships.

  • Key assumptions: equal numbers of individuals on both sides for a perfect matching, and strict preferences without ties.

The Gale–Shapley Algorithm

  • Core idea: An iterative process where one side (e.g., men) proposes to the other (women) based on their preference lists.

  • Procedure:

    • Free men propose to their highest-ranked available women.

    • Women either accept (if free or if the proposer is preferred to current fiancé, freeing the old fiancé) or reject.

    • This continues until all men are engaged.

  • Engagement behavior: Women's partners only improve; men's proposals move down their lists.

  • Termination: Guaranteed within n2n^2 iterations because each rejected proposal is unique and not repeated.

  • Result: The algorithm always produces a perfect and stable matching by ensuring no free men remain and no blocking pairs can exist due to the proposal/acceptance logic.

Key Empirical Observations
  • Proposer's advantage: The proposing side generally achieves their best possible stable matching, while the other side gets their worst.

  • Non-uniqueness: Multiple stable matchings can exist; Gale-Shapley finds one, not necessarily all.

Complexity and Practical Notes
  • Time complexity: O(n2)O(n^2). Space complexity: O(n)O(n).

  • Focus is on algorithmic structure, often via pseudocode.

Counterpoints and Fairness Considerations
  • The algorithm isn't inherently 'fair'; the choice of proposer impacts outcomes, raising ethical considerations for real-world applications where other objectives like general utility might be prioritized.

Worked Examples
  • Illustrations with 2x2 cases show that stable matchings prioritize structural stability over universal satisfaction, and multiple stable outcomes are possible.

Variations and Extensions
  • Extensions include scenarios like multiple openings per company (treated as separate slots) and handling ties in preferences (requires algorithm modification or relaxed stability definitions).

Proof Techniques Overview

  • Common proof techniques include direct proofs, proofs by cases, induction, indirect proofs (contradiction), and contrapositive proofs.

Direct Proofs
  • Structure: Assume the hypothesis and logically derive the conclusion.

  • Example: If m=2pm=2p and n=2qn=2q, then m+n=2(p+q)m+n=2(p+q), which is even. Also, if m+nm+n and n+pn+p are even, then m+pm+p is even.

Proofs by Cases
  • Structure: Break a statement into exhaustive cases and prove each case. Often used with parity (even/odd) arguments.

Induction (Mathematical Induction)
  • Structure: Proves statements for natural numbers (base case for n=1n=1, Inductive Hypothesis for kk, Inductive Step for k+1k+1).

  • Example: Sum of first nn natural numbers is fracn(n+1)2frac{n(n+1)}{2}. For k+1k+1: frack(k+1)2+(k+1)=frac(k+1)(k+2)2frac{k(k+1)}{2} + (k+1) = frac{(k+1)(k+2)}{2}.

Indirect Proofs and Proof by Contradiction
  • Structure: Assume the hypothesis AND the negation of the conclusion, then derive a contradiction.

  • Example: To prove infinitely many primes, assume a finite list p<em>1,,p</em>np<em>1, …, p</em>n. Consider P!+1P!+1; it must have a prime factor not in the list, a contradiction.

Contrapositive Proofs
  • Idea: Proving 'If A then B' by proving 'If not B then not A'.