‹ BackHN Continuity

Thread

Singapore govt dating app uses Gale-Shapley stable marriage algorithm

466 points · 499 comments · rzk

  1. qihqi · · focus · HN ↗
    Depending on the which gender does the initiation; the result is either male optimal (males get the best he can get, females gets the worst among those she would tolerate) or female optimal. I wonder which version this one is.
    1. jb1991 · · focus · HN ↗
      The article also mentioned that, but I don’t understand it. Receivers are also making choices, so why do they end up with the worst match?
      1. 2muchcoffeeman · · focus · HN ↗
        Imagine you are the proposer. You will start at the top of your list and work your way down only if rejected. So you are guaranteed to the best you could possibly do.

        Imagine A ranks X,Y,Z in that order B ranks Y,X,Z in that order C ranks X,Y,Z

        X, Y, Z rank A,B,C in that order.

        A will propose to X and match. B will propose to Y and match. C will propose to X and get rejected. C will propose to Y and get rejected. C will propose to Z and match.

        Y will never get a proposal from A. Z will never get a proposal from A or B.

        Edit: I think I fixed it.

        1. jb1991 · · focus · HN ↗
          Why will B propose to X first if their first choice is Y?
          1. 2muchcoffeeman · · focus · HN ↗
            You’re absolutely right. I’m on my phone trying to imagine the scenarios in my head and trying to find the simplest possible example.

            Maybe 4 participants is too few to clearly see what happens.

            1. computably · · focus · HN ↗
              (A,X),(B,Y) as the proposals is fine for the point being made. The issue is if we reverse which group is the proposer, we still end up with the same matching, because (A,X) strictly prefer each other.

              The minimal example with 4 participants is if each person P has unique preferences and P's 1st choice has P as 2nd choice. So in this case just flip X:

              A:XY B:YX X:BA Y:AB

              If A,B propose you get AX,BY. If X,Y propose you get BX,AY. Both are stable because the proposers are getting their first choice.

              1. jb1991 · · focus · HN ↗
                I find this algorithm to have a curious definition of the word "stable."
                1. computably · · focus · HN ↗
                  Not sure if you're referring to the actual definition. It's basically "no two participants from different pairs in the matching would prefer each other to their current matches." It seems an elegant definition to me.

                  This obviously doesn't factor in most of the complexity of romantic relationships: not knowing your own preferences, evolving preferences, incomplete/imperfect information in general, etc. Plus it assumes a global 1:1 matching across two categories, and people can of course be LGBT or choose to be single.

        2. bluefirebrand · · focus · HN ↗
          The big assumption here is that people are either proposers or receivers and never switch roles.

          Which may be largely true for many people but it's definitely not a fixed thing!

          When I was dating, I initiated with a lot of women, but the woman I wound up marrying messaged me first.

          1. yurish · · focus · HN ↗
            This assumption is built-in for Gale-Shapley algorithm.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.