Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implements Gale-Shapley deferred acceptance to find stable two-sided matchings from ranked preference lists, e.g., candidates to positions.
70% 96%+26 ptsof test cases passed
Passed 22 of 23 test cases with the skill, and 16 of 23 without it.
Compute the candidate-proposing stable matching for 2 applicants (A1, A2) and 2 employers (E1, E2) where A1 ranks [E1, E2], A2 ranks [E2, E1], E1 ranks [A1, A2], and E2 ranks [A2, A1]. Format the output as JSON with top-level 'matching' list and 'metadata' object. What value is assigned to 'proposer_side' in metadata?
The "proposer_side" field in metadata is set to "candidates".
3 of 3 safety checks passed
Gale-Shapley (deferred acceptance) finds a stable matching between two equally-sized sets where no unmatched pair prefers each other over their current match. Runs in O(n²) worst case. Proposer-optimal: the proposing side gets their best stable partner.
Trigger conditions:
When NOT to use:
IRON LAW: The Proposing Side Gets Their BEST Stable Partner
Gale-Shapley is proposer-optimal and reviewer-pessimal. If employers
propose, they get their best stable match; candidates get their worst.
The CHOICE of who proposes determines which stable matching is found.
Collect: preference rankings from both sides. Each participant ranks all members of the other side. Gate: Complete preference lists, equal-sized groups (or handle unequal with dummy entries).
Check stability: for every unmatched pair (a,b), verify that at least one of them prefers their current match over the other. No blocking pairs = stable.
Next to this one in the catalogue, plus more from the same author.