# Linear Time Local Approximation Algorithm for Maximum Stable Marriage

## Abstract

**:**

## 1. Introduction

**linear**time. The proof of the approximation ratio is uncomplicated, thus it serves as a good example for teaching purposes.

**Definition 1**

- w is either not engaged or w strictly prefers m to her fiancé,
**and** - m is either not engaged or m strictly prefers w to his fiancée.

**Definition 2**

**lad**” to represent a man who still has some women on his list, whom he did not propose to so far, and we use the term “

**old bachelor**” to represent a man who was rejected by all acceptable women and decides to become inactive forever. Moreover we use the term “

**maiden**” to represent a woman who did not get any proposal so far. Later we need to use some other similar terms, defined there.

**Theorem 1**

**(Gale and Shapley [3])**Algorithm GS always ends in a stable matching M. This algorithm runs in $O\left(\right|E\left|\right)$ time.

## 2. Men Have Strictly Ordered Lists

**bachelor**or an old bachelor, where we use the term "bachelor" for a man who was rejected by all acceptable women once, but in this setup he remains active and starts again to propose every woman on his recovered list. If there are two men, ${m}_{1}$ and ${m}_{2}$ with the same priority on a woman w’s list, and ${m}_{1}$ is a lad but ${m}_{2}$ is a bachelor, then w

**prefers bachelor**${m}_{2}$ to

**lad**${m}_{1}$. In the description of the algorithm, differences from Algorithm GS are set in boldface.

**becomes empty for the first time, he turns into a bachelor, his original list is recovered, and he reactivates himself. If the list of m becomes empty for the second time**, he will turn into an old bachelor and will remain inactive forever.

**Theorem 2 (2008)**

**Proof.**

## 3. The New Algorithm for General Stable Marriage

**prefers maiden**${w}_{1}$ to

**engaged**${w}_{2}$. An engaged lad is

**uncertain**, if his list contains a woman he prefers to his actual fiancée (this can happen, if there were two maidens with the same highest priority on m’s list, and m became engaged to one of them).

**flighty**, if her fiancé is uncertain. If there are two men, ${m}_{1}$ and ${m}_{2}$ with the same priority on a woman w’s list, and ${m}_{1}$ is a lad, but ${m}_{2}$ is a bachelor, then w

**prefers bachelor**${m}_{2}$ to

**lad**${m}_{1}$.

**or a flighty woman**. She also accepts this proposal, if she prefers m to her current fiancé. Otherwise she rejects m.

**except if**m

**is uncertain, in this case**m

**keeps**w

**on the list**.

**Lemma 1**

**Proof.**

**Lemma 2**

**Proof.**

**Lemma 3**

**Proof.**

**Theorem 3**

## 4. Implementation and Running Time

**any**one of following assumptions.

- The system is “wired” along acceptable pairs, which means here that when a man m sends a proposal to a woman w, she sees on which wire this call is coming in, and the priority $\mathrm{pri}(m,w)$ is written on that wire. Or, equivalently, better fitting to our mobile phone centralized world, there are no wires, but when an accessible man m calls woman w, then not only his phone number (his index in U) is shown, but also his position in the phone-book of w, such that his index in w’s array.
- Women can throw dice, and so they can use the perfect hashing approach of [21].
- Women has a black-box procedure, which on input m outputs in constant time $\mathrm{pri}(w,m)$.
- Men has some extra knowledge, for each acceptable woman w they know their own position in the list of w, such as their index in w’s array.

## 5. Generalizations to the Hospitals/Residents Problem

- m is either unassigned or $\mathrm{pri}(m,w)>\mathrm{pri}(m,F(m\left)\right)$, and
- w is either under-subscribed or $\mathrm{pri}(w,m)>\mathrm{pri}(w,{m}^{\prime})$ for at least one resident ${m}^{\prime}\in F\left(w\right)$.

**active**, if it is under-subscribed and its list is non-empty.

**uncertain about the offer for**w, if it is full, it is not an advantaged hospital, and moreover there is a resident ${w}^{\prime}$ still on its list, whom it prefers to w.

**advantaged hospital**, and starts proposing from its recovered list. When its list gets empty the second time, it remains inactive.

**unoffered**or

**offered**, if offered, he/she is called

**precarious**, if his/her current offer is uncertain. A resident w prefers hospital m to ${m}^{\prime}$ if either $\mathrm{pri}(w,m)>\mathrm{pri}(w,{m}^{\prime})$, or $\mathrm{pri}(w,m)=\mathrm{pri}(w,{m}^{\prime})$ and m is an advantaged hospital, while ${m}^{\prime}$ is not. A resident always accepts a new offer, if either he/she is unoffered, or he/she is precarious. Otherwise he/she accepts, if the new offer is better for him/her than the previous one.

## Acknowledgments

## Conflict of Interest

## References

- McDermid, E.J. A $\frac{3}{2}$-approximation Algorithm for General Stable Marriage. In Proccedings of the 36th International Colloquium Automata, Languages and Programming, ICALP 2009, Rhodes, Greece, 5–12 July 2009; LNCS 5555. pp. 689–700.
- Paluch, K. Faster and simpler approximation of stable matchings. Available online: http://arxiv.org/abs/0911.5660v2.
- Gale, D.; Shapley, L.S. College admissions and the stability of marriage. Am. Math. Mon.
**1962**, 69, 9–15. [Google Scholar] [CrossRef] - Király, Z. Better and Simpler Approximation Algorithms for the Stable Marriage Problem. In Proceedings of the MATCH-UP 2008: Matching Under Preferences—Algorithms and Complexity, Satellite Workshop of ICALP, Reykjavík, Iceland, 6 July 2008; pp. 36–45.
- Irving, R.W.; Manlove, D.F. Approximation algorithms for hard variants of the stable marriage and hospitals/residents problems. J. Comb. Optim.
**2008**, 16, 279–292. [Google Scholar] [CrossRef] - Iwama, K.; Miyazaki, S. A Survey of the Stable Marriage Problem and Its Variants. In Proceedings of the International Conference on Informatics Education and Research for Knowledge-Circulating Society, Kyoto, Japan, 17 January 2008; IEEE Computer Society: Washington, DC, USA, 2008; pp. 131–136. [Google Scholar]
- Halldórsson, M.M.; Iwama, K.; Miyazaki, S.; Yanagisawa, H. Improved approximation results for the stable marriage problem. ACM Trans. Algorithms
**2007**, 3. Article 30. [Google Scholar] [CrossRef] - Iwama, K.; Miyazaki, S.; Yamauchi, N. A 1.875-approximation Algorithm for the Stable Marriage Problem. In Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’07, New Orleans, LA, USA, 7–9 January 2007; pp. 288–297.
- Halldórsson, M.M.; Iwama, K.; Miyazaki, S.; Yanagisawa, H. Randomized approximation of the stable marriage problem. Theor. Comput. Sci.
**2004**, 325, 439–465. [Google Scholar] - Iwama, K.; Manlove, D.F.; Miyazaki, S.; Morita, Y. Stable Marriage with Incomplete Lists and Ties. In Proceedings of the 26th International Colloquium on Automata, Languages and Programming, Prague, Czech, 11–15 July 1999; LNCS 1644. pp. 443–452.
- Manlove, D.F.; Irving, R.W.; Iwama, K.; Miyazaki, S.; Morita, Y. Hard variants of stable marriage. Theor. Comput. Sci.
**2002**, 276, 261–279. [Google Scholar] - Halldórsson, M.M.; Irving, R.W.; Iwama, K.; Manlove, D.F.; Miyazaki, S.; Morita, Y.; Scott, S. Approximability results for stable marriage problems with ties. Theor. Comput. Sci.
**2003**, 306, 431–447. [Google Scholar] - Yanagisawa, H. Approximation Algorithms for Stable Marriage Problems. Ph.D. Thesis, Kyoto University, Kyoto, Japan, 2007. [Google Scholar]
- Király, Z. Better and Simpler Approximation Algorithms for the Stable Marriage Problem. In Proceedings of the 16th Annual European Symposium, ESA 2008, Karlsruhe, Germany, 15–17 September 2008; LNCS 5193. pp. 623–634.
- Király, Z. Better and simpler approximation algorithms for the stable marriage problem. Algorithmica
**2011**, 60, 3–20. [Google Scholar] [CrossRef] - Yanagisawa, H. Personal Communication, IBM Research, Tokyo, Japan, 2008.
- Irving, R.W.; Manlove, D.F. Finding large stable matchings. J. Exp. Algorithmics
**2009**, 14. [Google Scholar] [CrossRef] - Iwama, K.; Miyazaki, S.; Yanagisawa, H. A 25/17-Approximation Algorithm for the Stable Marriage Problem with One-Sided Ties. In Proceedings of 18th Annual European Symposium, ESA ’10, Liverpool, UK, 6–8 September 2010; LNCS 6347. pp. 135–146.
- Király, Z. Approximation of Maximum Stable Marriage, Egres Technical Report TR-2011-03. Available online: http://www.cs.elte.hu/egres/www/tr-11-03.html.
- Paluch, K. Faster and Simpler Approximation of Stable Matchings. In Proceedings of the 9th International Workshop Approximation and Online Algorithms, WAOA 2011, Saarbrücken, Germany, 8–9 September 2011; LNCS 7164. pp. 176–184.
- Fredman, M.L.; Komlós, J.; Szemerédi, E. Storing a sparse table with 0(1) worst case access time. J. ACM
**1984**, 31, 538–544. [Google Scholar] [CrossRef] - Gusfield, D.; Irving, R.W. The Stable Marriage Problem: Structure and Algorithms; MIT Press: Cambridge, Massachusetts and London, UK, 1989. [Google Scholar]

© 2013 by the author; licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Király, Z.
Linear Time Local Approximation Algorithm for Maximum Stable Marriage. *Algorithms* **2013**, *6*, 471-484.
https://doi.org/10.3390/a6030471

**AMA Style**

Király Z.
Linear Time Local Approximation Algorithm for Maximum Stable Marriage. *Algorithms*. 2013; 6(3):471-484.
https://doi.org/10.3390/a6030471

**Chicago/Turabian Style**

Király, Zoltán.
2013. "Linear Time Local Approximation Algorithm for Maximum Stable Marriage" *Algorithms* 6, no. 3: 471-484.
https://doi.org/10.3390/a6030471