# Stable marriage with indifference

Stable marriage with indifference is a variant of the stable marriage problem. Like in the original problem, the goal is to match all men to all women such that no pair of man and woman who are unmarried to each other, would simultaneously like to leave their present partners and pair with each other instead.

In the classic version of the problem, each person must rank the members of the opposite sex in strict order of preference. However, in a real-world setting, a person may prefer two or more persons as equally favorable partner. Such tied preference is termed as indifference.

Below is such an instance where ${\displaystyle m_{2}}$ finds tie between ${\displaystyle w_{3}\&w_{1}}$ and ${\displaystyle w_{2}}$ finds tie between ${\displaystyle m_{1}\&m_{2}}$.

${\displaystyle m_{1}[\ w_{2}\ w_{1}\ w_{3}\ ]\ \ \ \ \ \ w_{1}[\ m_{3}\ m_{2}\ m_{1}\ ]}$

${\displaystyle m_{2}[\left(w_{3}\ w_{1}\right)w_{2}]\ \ \ \ \ \ w_{2}[\left(m_{1}\ m_{2}\right)m_{3}]}$

${\displaystyle m_{3}[\ w_{1}\ w_{2}\ w_{3}\ ]\ \ \ \ \ \ w_{3}[\ m_{2}\ m_{3}\ m_{1}\ ]}$

If tied preference lists are allowed then the stable marriage problem will have three notions of stability which are discussed in the below sections.

1. A matching is called weakly stable unless there is a couple each of whom strictly prefers the other to his/her partner in the matching. Robert W. Irving[1] has extended the Gale–Shapley algorithm as below to provide such weakly stable matching in ${\displaystyle O(n^{2})}$ time where n is size of stable marriage problem. Ties in men and women's preference list are broken arbitrarily. Preference lists are reduced as algorithm proceeds.

 1 Assign each person to be free;
2 	while (some man m is free) do
3 	begin
4 		w := first woman on m’s list;
5 		m proposes, and becomes engaged, to w;
6 		if (some man m' is engaged to w) then
7 		    assign m' to be free;
8 		for each (successor m'' of m on w’s list) do
9 			delete the pair (m'', w)
10 	end;
11 	output the engaged pairs, which form a stable matching


2. A matching is called super-stable if there is no couple each of whom either strictly prefers the other to his/her partner or is indifferent between them. Robert W. Irving[1] has modified the above algorithm to check whether such super stable matching exists and outputs matching in ${\displaystyle O(n^{2})}$ time if it exists. Below is the pseudo-code.

 1 assign each person to be free;
2 repeat
3 	while (some man m is free) do
4 	  for each (woman w at the head of m’s list) do
5 	  begin
6 	  m proposes, and becomes engaged, to w;
7 		for each (strict successor m' of m on w’s list) do
8 		begin
9 			if (m' is engaged) to w then
10 			   break the engagement;
11 			delete the pair (m'. w)
12 		end
13 	  end
14 	for each (woman w who is multiply engaged) do
15 	begin
16 		break all engagements involving W;
17 		for each (man m at the tail of w’s list) do
18 		  delete the pair (m. w)
19     end;
20 until (some man’s list is empty) or (everyone is engaged);
21 if everyone is engaged then
22 	the engagement relation is a super-stable matching
23 else
24 	no super-stable matching exists


3. A matching is strongly stable if there is no couple x, y such that x strictly prefers y to his/her partner and y either strictly prefers x to his/her partner or is indifferent between them. Robert W. Irving[1] has provided the algorithm which checks if such strongly stable matching exists and outputs the matching if it exists. The algorithm computes perfect matching between sets of men and women, thus finding the critical set of men who are engaged to multiple women. Since such engagements are never stable, all such pairs are deleted and the proposal sequence will be repeated again until either 1) some man's preference list becomes empty (in which case no strongly stable matching exists) or 2) strongly stable matching is obtained. Below is the pseudo-code for finding strongly stable matching. It runs in ${\displaystyle O(n^{4})}$ time which is explained in the Lemma 4.6 of .[1]

 1 Assign each person to be free;
2 repeat
3 	while (some man m is free) do
4 	  for each (woman w at the head of m's list) do
5 	  begin
6 	  m proposes, and becomes engaged, to w;
7 		for each (strict successor m' of m on w’s list) do
8 		begin
9 			if (m' is engaged) to w then
10 			   break the engagement;
11 			delete the pair (m'. w)
12 		end
13 	  end
14     if (the engagement relation does not contain a perfect matching) then
15     begin
16 	    find the critical set Z of men;
17 	    for each (woman w who is engaged to a man in Z) do
18 	    begin
19 	        break all engagements involving w;
20   	        for each man m at the tail of w’s list do
21 	            delete the pair (m, w)
22 	    end;
23     end;
24 until (some man’s list is empty) or (everyone is engaged);
25 if everyone is engaged then
26 	the engagement relation is a super-stable matching
27 else
28 	no strongly stable matching exists


## Structure of stable marriage with indifference

In many problems, there can be several different stable matchings. The set of stable matchings has a special structure. David F. Manlove[2] proved that, both the set of strong stable matchings and the set of super stable matchings form a distributive lattice.

## References

1. ^ a b c d Irving, Robert W. (1994-02-15). "Stable marriage and indifference". Discrete Applied Mathematics. 48 (3): 261–272. doi:10.1016/0166-218X(92)00179-P.
2. ^ Manlove, David F. (2002-10-15). "The structure of stable marriage with indifference". Discrete Applied Mathematics. 122 (1): 167–181. doi:10.1016/S0166-218X(01)00322-5. ISSN 0166-218X.