• No results found

2.4 Maximum Pareto optimal matchings

2.4.2 Phase 3 of the algorithm

2.4.2.3 Correctness of Phase 3 loop

If there are unlabelled agents at the start of the main Phase 3 loop, there must exist at least one cyclic coalition with respect to M involving a subset of these agents by Lemma 2.4.2. The following lemma strengthens this result by showing that if there exist any unlabelled agents at any point of time in the execution of Phase 3, then a cyclic coalition must exist.

Lemma 2.4.3. Consider a given iteration of the for loop in Phase 3. If there exists an agent who remains unlabelled, then a cyclic coalition must exist with respect to M . Proof. Let a0be an agent who is unlabelled during a given iteration of the for loop of Phase

3. Then, a0 is not assigned in M0 to his reduced first choice p(a0). It follows that p(a0) 6=

M (a0). Now, p(a0) must be full in M for otherwise M is not trade-in-free, a contradiction.

However, p(a0) cannot be full in M0 for otherwise p(a0) would have been removed from

a0’s preference list by Process(Q) and cannot be the reduced first-choice house of a0. Now,

each agent a0 ∈ A becomes assigned in M0 to either M (a0) when M (a0) = p(a0), or to p(a0)

when we satisfy a cyclic coalition involving a0. Since p(a0) is currently undersubscribed in

M0, it follows that there exists a non-empty subset of agents As such that each agent a

in As belongs to M (p(a0))\M0(p(a0)) and a is currently unassigned in M0. Let a1 ∈ As.

It must be the case that p(a1) 6= M (a1) and hence, p(a1) 6= p(a0). By reusing the same

argument, it follows that we can trace a sequence of agents S = ha0, a1, ...i such that ai is

assigned in M but unassigned in M0 and p(ai) = M (ai+1) for i ≥ 0. Since the number of

agents is finite, there must be some r such that ax = ar for some 0 ≤ x < r − 1, where

without loss of generality ax, ax+1, ..., ar−1 are distinct agents. However, the substring

of agents C = hax, ax+1, ..., ar−1i within S must then constitute a cyclic coalition with

respect to M .

The next lemma shows that when all agents are assigned in M0, we then obtain a cyclic-coalition-free matching.

Lemma 2.4.4. If no unlabelled agents remain at any stage of Phase 3, then M0 is cyclic- coalition-free.

Proof. If there does not exist any unlabelled agents, then every agent is assigned in M0. Let a0 be an arbitrary agent. Suppose that there is a cyclic coalition C = ha0, a1, ..., ar−1i

with respect to M0 involving a0. Let M0(a0) = hj and let M0(a1) = hk. By definition of

C, a0 must prefer hk to hj. Since a0 was assigned to hj instead of hk in M0, it follows

that hk must have been full in M0 at the time that a0 was assigned to hj in M0. It must

then be the case that a1 was considered by Phase 3 before a0 or else M0(a1) 6= hk. Now,

by applying the same argument to the remaining agents in C, we can establish that ar−1

must have been considered by Phase 3 before a0. Let M0(ar−1) = hl. It follows that ar−1

must prefer hj to hl. Now, it must be the case that at the time that ar−1 was assigned in

M0, hj must have been undersubscribed for otherwise a0 could not have been assigned to

hj later on. However, this gives a contradiction for ar−1 prefers hj to hl and should then

be assigned to hj by Phase 3 instead.

Suppose that the envy graph involves the sequence of agents S = ha0, a1, ..., ar−1i and

suppose that only a substring of these agents C = hai, ai+1, ..., ar−1i constitute a cyclic

coalition where 0 ≤ i < r − 1. Let us call the agents in the substring ha0, a1, ..., ai−1i the

tail of C. Now, if certain houses become full in M0 as a result of satisfying C, thereby causing M (ai−1) to become the reduced first choice house for the agent ai−1, then ai−1

gets added to Q and assigned to M (ai−1) in M0 subsequently by Process(Q). Note that

this can cause an unwinding effect in the tail in which each agent ak (0 ≤ k ≤ i − 2),

such that M (ak) lies immediately after p(ak) in ak’s reduced preference list, gets added

to Q and assigned to M (ak) in M0 by Process(Q) in descending agent subscript order

until either we reach an agent ak−1 such that there exists a house between p(ak−1) and

M (ak−1) in ak−1’s reduced preference list or the tail becomes empty as a result. In the

former case, the main Phase 3 loop then extends P by following the reduced first-choice edge of ak−1. In the latter case, the main Phase 3 loop tries to extend P by following the

reduced first-choice edge of the next unlabelled agent, if one exists.

It is straightforward to see that the labelling of agents and the maintenance of c(ai)

for each agent ai ensures that no agent ai is added more than twice to P in Phase 3.

Clearly, if P is non-empty, P must cycle at some point of time in the execution of Phase 3 (as observed by Lemma 2.4.3). Since each agent ai that we add to P belongs to a cyclic

coalition or to the tail of a cyclic coalition, we are bound to remove ai from P as a result.

It also follows by the labelling of agents that any agent added to Q by the for loop in the main Phase 3 loop is not added to Q again by Process(Q) and vice versa. Hence, no agent gets added to Q twice.

Hence, Phase 3 must terminate when no unlabelled agents remain. When this happens, it follows by Lemma 2.4.4 that M0 must be a cyclic-coalition-free matching. We next show that each agent ai assigned in M at the end of Phase 2 must also be assigned in M0 at

the end of Phase 3.

Lemma 2.4.5. Each agent ai assigned in M at the end of Phase 2 is also assigned in M0

at the end of Phase 3.

Proof. Suppose not. Then, let ai be an agent who is unassigned in M0. Let M (ai) = hj.

Then, ai ∈ M (hj)\M0(hj). It follows that hj cannot have been the first house on ai’s

preference list, or else pre-processing would have assigned M0(ai) to be hj. Hence, there

exists at least one house that ai prefers to hj. Now, if ai is not assigned in M0 to any of

these houses, then the pointer p(ai) should move across ai’s preference list until it points at

hj. When this happens, aishould then be assigned to hj in M0. However, ai is unassigned

in M0 so that hj must have been removed from ai’s preference list prior to this as a result

of it becoming full in M0. Now, if hj is full in M0, then for every ak ∈ M0(hj), either

ak∈ M (hj) or there exists a unique al∈ M (hj)\M0(hj) such that akand al belong to the

same cyclic coalition. However, this implies that cj+ 1 agents were assigned to hj in M ,

a contradiction.

Since M is a matching that is also maximum, it follows by Lemma 2.4.5 that M0 is also a maximum matching.