DSA1 | Week 6

Stable Matchings

Summary from last week

Finding Euler Tours

A connected undirected graph has an Euler tour if and only if every vertex has even degree.

A connected directed graph has an Euler tour if and only if indegree(v) = outdegree(v) for all vertices v in V(G).

Key Observation.

Summary from last week

Finding Euler Tours

Start anywhere. If an edge is not yet taken, take it. Repeat until stuck.

The Algorithm modulo sanity checks

Stitch the fragments together.

Repeat until done.

This Week

The

Stable Marriage

Problem

The story, all names, characters, and incidents portrayed in this class are fictitious.

No identification with actual persons is intended or should be inferred.

Blocking Pairs

When A is matched to B

and X is matched to Y

but A prefers Y over B

and Y prefers A over X.

Goal: Stable Marriage

An assignment with

no blocking pairs.

Men = [n] & Women = [n]

ManPref[m, j] is the identity of the j-th ranked woman in m’s preference list 

WomanPref[w, j] is the identity of the jth
ranked man in w’s preference list.

Next[w] →  the rank of the best unproposed man for w.

Current[m] →   is the identity of the woman m is currently
engaged to and is −1 otherwise

FreeWomenList is the set of unmatched women.

Rank is an n ×n 2D array such that Rank[m,w] is the rank of w in m’s preference list.

DSA1 | Week 6

By Neeldhara Misra