1 of 30

Exploring the Gale-Shapley Algorithm

By Ethan Williams, Enock Nyakundi and Muhiim Ali

2 of 30

Project Overview

  • What is stable matching?
  • Stable matching variants
  • Applications of stable matching
  • What we learned
  • Takeaways

3 of 30

What Is The Stable Matching Problem?

In the stable matching problem, several participants rank their preferences over other participants. The goal is to find a matching of participants that is stable: one where no pair of participants would rather be with each other than their assigned match.

A

B

X

Y

C

Z

4 of 30

Stable Matching Variants

We picked: Participants divided into proposers and receivers.

  • Alternatively: Everyone is in one pool

We picked: Participants can only be matched with at most one other participant.

  • Alternatively: Proposer can accept many receivers

We picked: Participants are allowed to leave others unranked.

  • Alternatively: Everyone must rank everyone else

We picked: Participants must be ranked in order.

  • Alternatively: Allows participants to be indifferent between certain participants

5 of 30

Applications For the Version We Picked

  • Matching mentors and mentees
  • Matching users and video streaming endpoints in a movie sharing app
    • Users rank endpoints based on proximity and quality
    • Endpoints rank users based on the demand they can support
    • Assumes that endpoints can only serve single users
  • Matching heterosexual couples in a dating app
    • Gale-Shapley has an asymmetry between proposers and receivers
    • Does not reflect dating dynamics in real life

6 of 30

Quick Runthrough

A

B

X

Y

X

Y

A

B

A

B

X

Y

Square’s Preferences

(Receiver)

Offers

Triangle’s Preferences

(Proposer)

A

B

X

7 of 30

Minimal Description Of Gale-Shapley

Most descriptions of the Gale-Shapley algorithm are implementation-focused.

Contain extra data structures that serve as redundant indexes into other data structures. These help with runtime performance.

However, to model the algorithm in Forge, we put significant effort into identifying a minimal description of the Gale-Shapley algorithm.

8 of 30

Our Only Data Structure: offer

The state of the algorithm in our model is represented by one data structure, offer. It is a set of pairs of proposers and receivers. A proposer-receiver pair (px -> rx) in offer means that px is proposing to rx in that round; or that px already has a tentative match to rx. The pair (px -> rx) is considered a tentative match if rx accepts the proposal: if px is the only proposer matched with rx and rx ranks px.

By lumping together tentative matches and active proposals, we are able to unify the two kinds of rejections in Gale-Shapley: receivers leaving proposers for a more favorable match, and proposers proposing to receivers where the receiver does not rank the proposer.

9 of 30

Initial State

The initial state of offer has every proposer paired with their favorite receiver.

Multiple proposers may be paired with the same receiver.

A

B

X

Y

10 of 30

State Transition

Receivers pick their favorite proposer among the offers they receive in a particular round. Rejected proposers advance their offers to their next most favorite receiver.

A

B

X

Y

11 of 30

Termination Condition

We have a non-standard termination condition: the receivers reject everyone that they need to. In other words, each receiver has exactly one entry in offer, and the corresponding proposer is one that they rank.

A

B

X

Y

12 of 30

True Preferences and False Preferences

We are interested in seeing how reporting dishonest preferences impacts the execution of the algorithm.

To this end, we support multiple sets of preferences for the participants. We can run multiple instances of the algorithm in parallel, and observe how this influences the resulting matches.

13 of 30

Attacking Gale-Shapley Matchings

14 of 30

Why Would Participants Lie?

Can a participant get a better outcome from lying?

15 of 30

Explain How To Read The Visualizer

  • You can think of it like a table with 3 rows and two columns
  • The first column represents the preferences when lying, and the outcome when lying.
  • The right half represents the true preferences and the outcome from honesty.

Lies

Truth

16 of 30

Does Lying Benefit Receivers?

A receiver can misrepresent their true preferences and get a better outcome.

Here, R0 lies by misranking P0 so that they can avoid matching with them over their preferred P1.

truth

lies

17 of 30

Receiver-Receiver Collusion

A receiver can also misrepresent their preferences to help another receiver.

Here, R0 lies so that R2 can match with their first choice: P1.

18 of 30

Does Lying Benefit Proposers?

We wanted to see if lying can benefit proposers. We verified that a proposer that misrepresents their individual preferences never benefits.

19 of 30

Proposer-Proposer Collusion

However, proposer can misrepresent their true preferences to benefit a different proposer (who doesn’t have to lie).

Here, P1 lies that they don’t like R1 so that P0 can match with R1.

Lies

Truth

20 of 30

Proposer-Receiver Collusion Benefits

Proposer

Proposer-receiver collusion is possible in that if a proposer and a receiver coordinate to misrepresent their preferences, they cannot both benefit, but the proposer can.

Here, R0 lies that they like R0 so that P0 can match with them.

21 of 30

Proposer-Receiver Collusion Benefits Receiver

Proposer-receiver collusion is possible in that if a proposer and a receiver coordinate to misrepresent their preferences, they cannot both benefit, but the receiver can.

Here, P0 lies that they like R1 so that R0 can match with their true preference, P2.

22 of 30

What Does This Mean?

These properties were previously well known, but we verified them using Forge and without any domain-specific mathematical techniques.

New non-intuitive scenarios can be quickly generated.

More complex conditions, such as regret conditioned on known preferences, can be encoded and tested.

23 of 30

What Did We Verify

  • Always produces stable matching
  • Our termination condition is always eventually true
  • Before deleting our explicit tentative match field, we verified that the old termination condition was the same as the new one
  • We verified that the algorithm is fully deterministic
  • We provided various tests for our definition of stability, and the predicates within it in order to make sure that it conforms to our notion of stability
  • We wrote explicit traces in order to make sure that our model could accommodate examples of the algorithm

24 of 30

Takeaways

25 of 30

Solutions To These Vulnerabilities: Receivers

Effort to prevent misrepresentations by receivers are absolutely required.

These measures may include discovering the true preferences from means other than asking receivers to self-report them.

Dating app: determine preferences based on the user’s indicated interests

Matching clients and servers: Use data gathered from the network to match preferences instead of input from the end user

26 of 30

Solutions To These Vulnerabilities: Proposers

Effort is required for ensuring that proposers do not collude. This may include only using the Gale-Shapley algorithm in places where there are no strong outside motivations.

Since at best, colluding between proposers leaves one proposer worse off, it could also be advisable to only admit proposers who are strongly motivated to get the best match outcome.

27 of 30

Social Considerations

The Gale-Shapley algorithm is always run with the goal of automatically assigning matches on participants.

  • Care should be taken to make sure that input preferences are in the participants best interest.
  • Consider whether an algorithmically generated “stable matching” is actually what you need.

It suffers from the vulnerabilities that we discussed: lying, asymmetry.

  • Fixing these vulnerabilities should be done with careful consideration of the impacts of your chosen mitigations.
  • Attackers can target a Gale-Shapley matching to optimize their input preferences using a model like this one.

There are military applications (Operations Research) for the algorithm that result in death.

28 of 30

Further Exploration

Regret

  • We found that a receiver can benefit from lying. They are not guaranteed to benefit from misrepresenting their preferences in this way. Our predicates can be extended to find scenarios where the receiver lie and always benefit

Encoding known information for a specific matching (like physical keys)

  • Sometimes in a matching you know the preferences of some parties. This could be encoded in order to make a target misrepresentation

29 of 30

Stakeholders

Depends on the application, but in general

  • Participants
  • The matchmakers

In the mentor matching application, this could additionally include

  • The school, organization that the matchmaking takes place

30 of 30

Live Demo