I am not sure what the function of the last column in these two tables is, but I translated this into:
---- 61 SET mmen
m1, m2, m3
---- 61 SET wwomen
w1, w2, w3
---- 61 PARAMETER mpref preferences of men for women (ranking,1=best)
w1 w2 w3
m1 123
m2 312
m3 231
---- 61 PARAMETER wprefpreferences of women for men (ranking,1=best)
m1 m2 m3
w1 321
w2 132
w3 213
This is not exactly standard notation (it is explained in [3]). Another notation I see being used is:
| Stable Marriage Problem |
|---|
| \[\begin{align}&\sum_m \color{darkred}x_{m,w} = 1 && \forall w \\&\sum_w \color{darkred}x_{m,w} = 1 && \forall m \\&\sum_{m'\lt_w m} \color{darkred}x_{m',w} -\sum_{w'\gt_m w} \color{darkred}x_{m,w'} \le 0 && \forall m,w\\ & \color{darkred}x_{m,w}\in \{0,1\} \end{align}\] |
This needs some explanation.
- \(\displaystyle\sum_{m'\lt_w m} \color{darkred}x_{m',w}=1\) indicates an inferior man \(m'\) compared to \(m\) (according to \(w\)) has been assigned to \(w\),
- \(\displaystyle\sum_{w'\gt_m w} \color{darkred}x_{m,w'}=1\) indicates a superior woman \(w'\) compared to \(w\) (according to \(m\)) has been assigned to \(m\),
- the complete constraint \[\sum_{m'\lt_w m} \color{darkred}x_{m',w} -\sum_{w'\gt_m w} \color{darkred}x_{m,w'} \le 0 \>\> \forall m,w\] can be interpreted as: if \(w\) marries someone less desirable than \(m\) then \(m\) must be matched to a woman better than \(w\). If this is not the case then both \(m\) and \(w\) are better off marying each other. That would not be "stable."
- A feasible solution to these equations gives us a stable matching.
*---------------------------------------------------------------- |
---- 61 SET worseMenworse men than m for w
m1 m2 m3
w1.m2 YES
w1.m3 YES YES
w2.m1 YES YES
w2.m3 YES
w3.m1 YES
w3.m2 YES YES
---- 61 SET betterWomenbetter women than w for m
w1 w2 w3
m1.w2 YES
m1.w3 YES YES
m2.w1 YES YES
m2.w3 YES
m3.w1 YES
m3.w2 YES YES
* if m marries someone worse than w then w must marry someone stability(m,w).. |
Enumerating stable matchings
Let's go back to the example in [2]. It says:
Let's see if we can reproduce this. There are at least three ways to attack this:
- Solve the problem. Add a constraint that forbids the current solution and repeat until things become infeasible.
- For large problems with many solutions, we can use a MIP solver with a solution pool.
- Or we can use a Constraint Programming based solver that allows producing multiple or all solutions.
For this small problem, I decided to use use the first approach. Here is the output:
---- 127 PARAMETER solutions enumerated solutions
INDEX 1 = sol1
w1 w2 w3
m1 1
m2 1
m3 1
INDEX 1 = sol2
w1 w2 w3
m1 1
m2 1
m3 1
So my little experiment can not reproduce the results. It is quite an unequal situation: there are three authors plus say three reviewers, so at least six people have looked at this carefully, versus just me. So let's analyze this a bit further.
---- stability =G= stability constraint
stability(m1,w2).. x(m1,w1) - x(m2,w2) - x(m3,w2) =G= 0 ; (LHS = -1, INFES = 1 ****)
stability(m1,w3).. x(m1,w1) + x(m1,w2) - x(m3,w3) =G= 0 ; (LHS = 0)
stability(m2,w1).. - x(m1,w1) + x(m2,w2) + x(m2,w3) =G= 0 ; (LHS = 0)
stability(m2,w3).. - x(m1,w3) + x(m2,w2) - x(m3,w3) =G= 0 ; (LHS = -1, INFES = 1 ****)
stability(m3,w1).. - x(m1,w1) - x(m2,w1) + x(m3,w3) =G= 0 ; (LHS = -1, INFES = 1 ****)
stability(m3,w2).. - x(m2,w2) + x(m3,w1) + x(m3,w3) =G= 0 ; (LHS = 0)
So introducing the match \((m_1,w_2)\) seems beneficial for both \(m_1\) and \(w_2\). We can see this from:
Conclusion
References
- Stable marriage problem, https://en.wikipedia.org/wiki/Stable_marriage_problem
- Alvin E. Roth, Uriel G. Rothblum and John H. Vande Vate, Stable Matchings, Optimal Assignments, and Linear Programming, Mathematics of Operations Research, Vol. 18, No. 4 (1993), pp. 803-828
- John H. Vande Vate, Linear Programming brings Marital Bliss, Operations Research Letters 8 (1989) pp. 147-153.
Appendix: GAMS code
$ontext |



