Image for Gale-Shapley Algorithm

Gale-Shapley Algorithm

The Gale-Shapley Algorithm is a method to find stable matches between two groups, like job seekers and companies or students and schools. Each person has preferences ranking members of the other group. The algorithm iteratively allows one group to "propose" to their top choice not yet rejected, and the other group tentatively accepts the best proposal they’ve received so far, rejecting others. This process continues until everyone is matched, resulting in a stable pairing where no two individuals would prefer each other over their assigned match. It ensures matches are mutually satisfactory and stable, avoiding future swaps.