From Help, the procedure StableMarriage was an element of the Combinatorica, but it is available in the built-in FindIndependentEdgeSet since Mathematica 10.

But it is not clear from the documentation how to use FindIndependentEdgeSet as a Gale-Shapley algorithm straightforwardly. So, the procedure FindIndependentEdgeSet can find an independent edge set and, for weighted graphs, maximal total-valued independent edge set. But this is no the same as a stable matching. How to solve it?

Explicitly: The input of the StableMarriage is a pair of permutations describing male and female preferences. But that is not acceptable input for FindIndependentEdgeSet procedure

  • 6
    $\begingroup$ I think that the fact that you got multiple upvotes but no answers indicates that how to do this is not at all obvious (if possible at all!). I would contact Wolfram Support and ask about it. They should be able to contact whoever wrote that documentation page and ask for clarifications. $\endgroup$
    – Szabolcs
    Commented Mar 2, 2019 at 9:35
  • 2
    $\begingroup$ tried SparseArray`StableMarriage[mpref, fpref] (where mpref and fpref are the matrices of male and female preferences)? $\endgroup$
    – kglr
    Commented Aug 28, 2019 at 11:09

1 Answer 1


The function FindStableMatching is now in the Wolfram Function Repository:



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.