Nepedia
Back to Discover
Independent Reader
🔢

Stable roommates problem

math Maturity 7-9 Next article →

Imagine a group of people who need to pick roommates. Each person makes a list of who they like best. They rank their choices from first to last. We want to find a stable matching. A matching is stable if no two people want to switch. If two people would both rather be with each other than their current partners, the match is not stable. This pair is called a blocking pair.

In some math problems, a stable match is always possible. But in the stable roommates problem, it might not work. Sometimes, the group's choices make it impossible to find a perfect set of pairs. In these cases, people will always want to swap.

To solve this, we use Irving's algorithm. This is a set of steps to find a match. First, people propose to others on their list. If someone gets a better offer, they reject the old one. This is called Phase 1. Then, Phase 2 uses something called rotations to fix the lists. These rotations help narrow down the best pairs. The algorithm can tell us if a stable match exists or not.

189 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.