We propose an algorithm for finding a POM in an instance of CA, which is in a certain sense a generalization of Serial Dictatorship thus named Generalized Serial Dictatorship Mechanism with ties (GSDT). The algorithm starts by setting the quotas of all applicants to 0 and those of courses at the original values given by q. At each stage i, the algorithm selects a single applicant whose original capacity has not been reached, and increases only her capacity by 1. The algorithm terminates after \(B={\sum }_{a\in A} b(a)\) stages, i.e., once the original capacities of all applicants have been reached. In that respect, the algorithm assumes a ‘multisequence’ Σ=(a
1, a
2,…, a
B) of applicants such that each applicant a appears b(a) times in Σ; e.g., for the instance of Table 1 and the sequence Σ=(a
1, a
1, a
2, a
2, a
3, a
2, a
3), the vector of capacities evolves as follows:
$$(0,0,0), (1,0,0), (2,0,0), (2,1,0), (2,2,0), (2,2,1), (2,3,1), (2,3,2).$$
Let us denote the vector of applicants’ capacities in stage i by b
i, i.e., b
0 is the all-zeroes vector and b
B = b. Clearly, each stage corresponds to an instance I
i similar to the original instance except for the capacities vector b
i. At each stage i, our algorithm obtains a matching μ
i for the instance I
i. Since the single matching of stage 0, i.e., the empty matching, is a POM in I
0, the core idea is to modify μ
i−1 in such way that if μ
i−1 is a POM with respect to I
i−1 then μ
i is a POM with respect to I
i. To achieve this, the algorithm relies on the following flow network.
Consider the digraph D = (V, E). Its node set is V = A∪T∪C∪{σ, τ} where σ and τ are the source and the sink and vertices in T correspond to the ties in the preference lists of all applicants; i.e., T has a node (a, t) per applicant a and tie t such that \({C^{a}_{t}} \neq \emptyset \). Its arc set is E = E
1∪E
2∪E
3∪E
4 where E
1 = {(σ, a):a∈A}, \(E_{2}=\{(a,(a,t)): a\in A, {C^{a}_{t}} \neq \emptyset \}\), \(E_{3}=\{((a,t),c): c\in {C^{a}_{t}}\}\) and E
4 = {(c, τ):c∈C}. The graph D for the instance of Table 1 appears in Fig. 1, where an oval encircles all the vertices of T that correspond to the same applicant, i.e., one vertex per tie.
Using digraph D = (V, E), we obtain a flow network N
i at each stage i of the algorithm, i.e., a network corresponding to instance I
i, by appropriately varying the capacities of the arcs. (For an introduction on network flow algorithms see, e.g., [3].) The capacity of each arc in E
3 is always 1 (since each course may be received at most once by each applicant) and the capacity of an arc e = (c, τ)∈E
4 is always q(c). The capacities of all arcs in E
1∪E
2 are initially 0 and, at stage i, the capacities of only certain arcs associated with applicant a
i are increased by 1. For this reason, for each applicant a we use the variable curr(a) that indicates her ‘active’ tie; initially, curr(a) is set to 1 for all a∈A.
In stage i, the algorithm computes a maximum flow f
i whose saturated arcs in E
3 indicate the corresponding matching μ
i. The algorithm starts with f
0 = 0 and μ
0 = ∅. Let the applicant a
i∈A be a copy of applicant a considered in stage i. The algorithm increases by 1 the capacity of arc (σ, a)∈E
1 (i.e., the applicant is allowed to receive an additional course). It then examines the tie curr(a) to check whether the additional course can be received from tie curr(a). To do this, the capacity of arc (a,(a, curr(a)))∈E
2 is increased by 1. The network in stage i where tie curr(a
i) is examined is denoted by \(N^{i,curr(a^{i})}\). If there is an augmenting σ−τ path in this network, the algorithm augments the current flow f
i−1 to obtain f
i, accordingly augments μ
i−1 to obtain μ
i (i.e., it sets μ
i to the symmetric difference of μ
i−1 and all pairs (a, c) for which there is an arc ((a, t), c) in the augmenting path) and proceeds to the next stage. Otherwise, it decreases the capacity of (a,(a, curr(a))) by 1 (but not the capacity of arc (σ, a)) and it increases curr(a) by 1 to examine the next tie of a; if all (non-empty) ties have been examined, the algorithm proceeds to the next stage without augmenting the flow. Note that an augmenting σ−τ path in the network \(N^{i,curr(a^{i})}\) corresponds to an augmenting path coalition in μ
i−1 with respect to I
i.
A formal description of GSDT is provided by Algorithm 1, where w(e) denotes the capacity of an arc e∈E and ⊕ denotes symmetric difference. Observe that all arcs in E
2 are saturated, except for the arc corresponding to the current applicant and tie, thus any augmenting path has one arc from each of E
1, E
2 and E
4 and all other arcs from E
3; as a consequence, the number of courses each applicant receives at stage i in any tie cannot decrease at any subsequent step. Also, μ
i dominates μ
i−1 with respect to instance I
i if and only if there is a flow in N
i that saturates all arcs in E
2.
To prove the correctness of GSDT, we need two intermediate lemmas. Let \(e_{t} \in \mathbb {R}^{n_{2}}\) be the vector having 1 at entry t and 0 elsewhere.
Lemma 5
Let N
i,t
be the network at stage i while tie t of applicant a
i
is examined. Then, there is an augmenting path with respect to f
i−1
in N
i,t
if and only if there is a matching μ such that
$$\chi_{a}(\mu(a))=\chi_{a}(\mu^{i-1}(a)) \text{\ for each\ } a\ne a^{i} \text{\ and\ } \chi_{a^{i}}(\mu(a^{i}))=\chi_{a^{i}}(\mu^{i-1}(a^{i}))+ e_{t}.$$
Proof
Note that the flows f
i−1 and f
i, corresponding to μ
i−1 and μ
i respectively, are feasible in N
i. Moreover, f
i−1 is feasible in N
i, t and, if there is an augmenting path with respect to f
i−1 in N
i, t, then f
i is feasible in N
i, t too.
If there is a path augmenting f
i−1 by 1 in N
i, t thus obtaining f
i, the number of courses assigned per tie and applicant remain identical except for a
i that receives an extra course from tie t. Thus, χ
a
(μ(a)) is identical to χ
a
(μ
i−1(a)) for all a∈A except for a
i whose characteristic vector has its t’th entry increased by 1.
Conversely, if the above equation holds, flow f
i is larger than f
i−1 in the network N
i, t. Thus standard network flow theory implies the existence of a path augmenting f
i−1. As a side remark, since the network N
i, t has similar arc capacities with the network N
i−1 except for the arcs (σ, a
i) and (a
i,(a
i, t)), this augmenting path includes these two arcs. □
Lemma 6
Let S≽
a
U and |S|≥|U|. If c
S
and c
U
denote a least preferred course of applicant a in S and U, respectively, then S∖{c
S
}≽
a
U∖{c
U
}.
Proof
For convenience, we denote S∖{c
S
} by S′ and U∖{c
U
} by U′. Let
$$\chi_{a}(S)=(s_{1},s_{2},\ldots, s_{n_{2}}), \ \chi_{a}(U)=(u_{1},u_{2},\ldots, u_{n_{2}})$$
and
$$\chi_{a}(S^{\prime})=(s^{\prime}_{1},s^{\prime}_{2},\ldots, s^{\prime}_{n_{2}}),\ \chi_{a}(U^{\prime})=(u^{\prime}_{1},u^{\prime}_{2},\ldots, u^{\prime}_{n_{2}}).$$
If S≃
a
U, then c
S
≃
a
c
U
and χ
a
(S) = χ
a
(U), therefore χ
a
(S′) = χ
a
(U′) and S′≃
a
U′. Otherwise, S≻
a
U implies that there is k∈[n
2] such that s
j
= u
j
for each j<k and s
k
>u
k
.
If there is j ≥ k+1 with s
j
>0, then \(c_{S}\in {C_{r}^{a}}\) with r ≥ k+1. It follows that \(s^{\prime }_{k}=s_{k}>u_{k}\geq u^{\prime }_{k}\) while \(s^{\prime }_{j} \geq u^{\prime }_{j}\) for all j<k, thus χ
a
(S′)>
lex
χ
a
(U′), i.e., S′≻
a
U′. The same follows if s
k
≥u
k
+2 because then \(s^{\prime }_{k} \geq s_{k}-1 > u_{k}\geq u^{\prime }_{k}\).
It remains to examine the case where s
j
= 0 for all j ≥ k+1 and s
k
= u
k
+1. In this case, \(c_{S}\in {C_{k}^{a}}\) thus \(s^{\prime }_{k}=s_{k}-1=u_{k}\), while |S|≥|U| implies that either u
j
= 0 for all j ≥ k+1 or there is a single k′>k such that \(u_{k^{\prime }}=1\). In the former case \(c_{U}\in {C_{r}^{a}}\) for r≤k thus χ
a
(S′)>
lex
χ
a
(U′), whereas in the latter one \(u^{\prime }_{k}=u_{k}=s_{k}-1=s^{\prime }_{k}\) and \(s^{\prime }_{j}=u^{\prime }_{j}=0\) for all j>k hence χ
a
(S′) = χ
a
(U′). □
Theorem 7
For each i, the matching μ
i
obtained by GSDT is a POM for instance I
i.
Proof
We apply induction on i. Clearly, μ
0 = ∅ is the single matching in I
0 and hence a POM in I
0. We assume that μ
i−1 is a POM in I
i−1 and prove that μ
i is a POM in I
i.
Assume to the contrary that μ
i is not a POM in I
i. This implies that there is a matching ξ in I
i that dominates μ
i. Then, for all a∈A, ξ(a)≽
a
μ
i(a)≽
a
μ
i−1(a). Recall that the capacities of all applicants in I
i are as in I
i−1 except for the capacity of a
i that has been increased by 1. Hence, for all a∈A∖{a
i
}, |ξ(a)| does not exceed the capacity of a in instance I
i−1, namely b
i−1(a), while |ξ(a
i)| may exceed b
i−1(a
i) by at most 1.
Moreover, it holds that |ξ(a
i)|≥|μ
i(a
i)|. Assuming to the contrary that |ξ(a
i)|<|μ
i(a
i)| yields that ξ is feasible also in instance I
i−1. In addition, |ξ(a
i)|<|μ
i(a
i)| implies that it cannot be the case that \(\xi (a^{i}) \simeq _{a^{i}} \mu ^{i}(a^{i})\), and this, together with \(\xi (a^{i}) \succeq _{a^{i}} \mu ^{i}(a^{i})\succeq _{a^{i}} \mu ^{i-1}(a^{i})\), yields \(\xi (a^{i}) \succ _{a^{i}} \mu ^{i}(a^{i}) \succeq _{a^{i}} \mu ^{i-1}(a^{i})\). But then ξ dominates μ
i−1 in I
i−1, a contradiction to μ
i−1 being a POM in I
i−1.
Let us first examine the case in which GSDT enters the ‘while’ loop and finds an augmenting path, hence μ
i dominates μ
i−1 in I
i only with respect to applicant a
i that receives an additional course. This is one of her worst courses in μ
i(a
i) denoted as c
μ
. Let c
ξ
be a worst course for a
i in ξ(a
i). Let also ξ′ and μ′ denote ξ∖{(a
i, c
ξ
)} and μ
i∖{(a
i, c
μ
)}, respectively. Observe that both ξ′ and μ′ are feasible in I
i−1, while having shown that |ξ(a
i)|≥|μ
i(a
i)| implies through Lemma 6 that ξ′ weakly dominates μ′ which in turn weakly dominates μ
i−1 by Lemma 5. Since μ
i−1 is a POM in I
i−1, ξ′(a)≃
a
μ′(a)≃
a
μ
i−1(a) for all a∈A, therefore ξ dominates μ
i only with respect to a
i and \(c_{\xi } \succ _{a^{i}} c_{\mu }\). Overall, ξ(a)≃
a
μ
i(a)≃
a
μ
i−1(a) for all a∈A∖{a
i} and \(\xi (a^{i}) \succ _{a^{i}} \mu ^{i}(a^{i})\succ _{a^{i}} \mu ^{i-1}(a^{i})\).
Let t
ξ
and t
μ
be the ties of applicant a
i containing c
ξ
and c
μ
, respectively, where t
ξ
<t
μ
because \(c_{\xi } \succ _{a^{i}} c_{\mu }\). Then, Lemma 5 implies that there is a path augmenting f
i−1 (i.e., the flow corresponding to μ
i−1) in the network \(N^{i,t_{\xi }}\). Let also t′ be the value of curr(a
i) at the beginning of stage i. Since we examine the case where GSDT enters the ‘while’ loop and finds an augmenting path, \(C^{a^{i}}_{t^{\prime }} \neq \emptyset \). Thus, t′ indexes the least preferred tie from which a
i has a course in μ
i−1. The same holds for ξ′ since \(\xi ^{\prime }(a^{i}) \simeq _{a^{i}} \mu ^{i-1}(a^{i})\). Because ξ′ is obtained by removing from a
i its worst course in ξ(a
i), that course must belong to a tie of index no smaller than t′, i.e., t′≤t
ξ
. This together with t
ξ
<t
μ
yield t′≤t
ξ
<t
μ
, which implies that GSDT should have obtained ξ instead of μ
i at stage i, a contradiction.
It remains to examine the cases where, at stage i, GSDT does not enter the ‘while’ loop or enters it but finds no augmenting path. For both these cases, μ
i = μ
i−1, thus ξ dominating μ
i means that ξ is not feasible in I
i−1 (since it would then also dominate μ
i−1). Then, it holds that |ξ(a
i)| exceeds b
i−1(a
i) by 1, thus |ξ(a
i)|>|μ
i(a
i)| yielding \(\xi (a^{i}) \succ _{a^{i}} \mu ^{i}(a^{i})\). Let t
ξ
be defined as above and t′ now be the most preferred tie from which a
i has more courses in ξ than in μ
i. Clearly, t′≤t
ξ
since t
ξ
indexes the least preferred tie from which a
i has a course in ξ. If t′<t
ξ
, then the matching ξ′, defined as above, is feasible in I
i−1 and dominates μ
i−1 because \(\xi ^{\prime }(a^{i}) \succ _{a^{i}} \mu ^{i-1}(a^{i})\), a contradiction; the same holds if t′ = t
ξ
and a
i has in ξ at least two more courses from t
ξ
than in μ
i. Otherwise, t′ = t
ξ
and a
i has in ξ exactly one more course from t
ξ
than in μ
i; that, together with |ξ(a
i)|>|μ
i(a
i)| and the definition of t
ξ
, implies that the index of the least preferred tie from which a
i has a course in μ
i−1 and, therefore, the value of curr(a
i) in the beginning of stage i, is at most t′. But then GSDT should have obtained ξ instead of μ
i at stage i, a contradiction. □
The following statement is now direct.
Corollary 8
GSDT produces a POM for instance I.
To derive the complexity bound for GSDT, let us denote by L the length of the preference profile in I, i.e., the total number of courses in the preference lists of all applicants. Notice that |E
3| = L and neither the size of any matching in I nor the total number of ties in all preference lists exceeds L.
Within one stage, several searches in the network might be needed to find a tie of the active applicant for which the current flow can be augmented. However, one tie is unsuccessfully explored at most once, hence each search either augments the flow thus adding a pair to the current matching or moves to the next tie. So the total number of searches performed by the algorithm is bounded by the size of the obtained matching plus the number of ties in the preference profile, i.e., it is O(L). A search requires a number of steps that remains linear in the number of arcs in the current network (i.e., \(N^{i,curr(a^{i})}\)), but as at most one arc per E
1, E
2 and E
4 is used, any search needs O(|E
3|) = O(L) steps. This leads to a complexity bound O(L
2) for GSDT.
The next theorem will come in handy when implementing Algorithm 1, as it implies that for each applicant a only one node in T corresponding to a has to be maintained at a time.
Theorem 9
Let N
i,t
be the network at stage i while tie t of applicant a
i
is examined. Then, there is no augmenting path with respect to f
i−1
in N
i,t
that has an arc of the form ((a
j
,ℓ),c) where j≤i and ℓ<curr(a
j
).
Proof
Assume otherwise. Let \(\mathfrak {P}\) be such an augmenting path that is found in round i and used to obtain μ
i. Hence \(\mathfrak {P}\) corresponds to an augmenting path coalition \(\mathfrak {C}\) of the following form 〈a
i, c
r
,…, c
s
, a
j, c
q
,…〉 where c
r
is in the t’th indifference class of a
i and both c
s
and c
q
are in the ℓ’th indifference class of a
j, ℓ<curr(a
j). Note that as ℓ ≥ 1 thus curr(a
j)>1. It then follows from the description of Algorithm 1 that either a
j is matched to at least one course in curr(a
j) under μ
i or she is exposed (which would be the case when curr(a
j)>n
2 or \(C^{a^{j}}_{curr(a^{j})} =\emptyset \)).
We first show that a
i and a
j are not the same applicant. Otherwise, \(\mathfrak {C}^{\prime } = \langle a^{j}, c_{q}, {\ldots } \rangle \)—obtained from \(\mathfrak {C}\) by discarding all courses and applicants that appear before a
j—is an augmenting path coalition with respect to μ
i−1 in I
i. Clearly the matching obtained from μ
i−1 by satisfying \(\mathfrak {C}^{\prime }\) Pareto dominates μ
i, as ℓ<t, contradicting that μ
i is a POM in I
i.
In the remainder of the proof we assume that a
i≠a
j. Let us first consider the case where a
j is matched to a course in \(C^{a^{j}}_{curr(a^{j})}\) under μ
i, and therefore by Lemma 1 to a course \(c\in C^{a^{j}}_{curr(a^{j})}\) under μ
i−1. Let \(\mathfrak {C}^{\prime } = \langle c,a^{j},c_{q},\dots \rangle \), i.e., \(\mathfrak {C}^{\prime }\) is obtained from \(\mathfrak {C}\) by discarding all courses and applicants that appear before a
j and replacing them with c. Since ℓ<curr(a
j), we have \(c_{q} {\succ }_{a^{j}} c\). It is then easy to see that \(\mathfrak {C}^{\prime }\) is an alternating path coalition with respect to μ
i−1 in I
i−1, and hence μ
i−1 is not a POM in I
i−1, a contradiction. We now consider the case where a
j is exposed in μ
i, and hence exposed in μ
i−1 with respect to I
i−1. Let \(\mathfrak {C}^{\prime } = \langle a^{j},c_{q},\dots \rangle \), i.e., \(\mathfrak {C}^{\prime }\) is obtained from \(\mathfrak {C}\) by discarding all courses and applicants that appear before a
j. It is clear that \(\mathfrak {C}^{\prime }\) is an augmenting path coalition with respect to μ
i−1 in I
i−1, contradicting that μ′ is a POM in I
i−1. □
Next we show that GSDT can produce any POM. Our proof makes use of a subgraph of the extended envy graph of Definition 1.
Theorem 10
Given a CA instance I and a POM μ, there exists a suitable priority ordering over applicants Σ given which GSDT can produce μ.
Proof
Given an instance I and a POM μ, let G = (V, E) be a digraph such that V = {ac:(a, c)∈μ} and there is an arc from ac to a′c′ if a≠a′, c′∉μ(a) and c′≽
a
c. An arc (ac, a′c′) has weight −1 if a prefers c′ to c and has weight 0 if she is indifferent between the two courses. Note that G is a subgraph of the extended envy graph G(μ) introduced in Definition 1. We say that ac envies a′c′ if (ac, a′c′) has weight −1.
Note that if there exists an applicant-course pair ac∈μ and a course c′ such that c′≻
a
c and ac′∉μ, then c′ must be full under μ, or else μ admits an alternating path coalition and is not a POM.
Moreover, all arcs in any given strongly connected component (SCC) of G have weight 0. To see this, note that by the definition of a SCC, there is a path from any node to every other node in the component. Hence, if there is an arc in a SCC with weight −1, then there must be a cycle of negative weight in that SCC. It is then straightforward to see that, by Lemma 1, μ admits a cyclic coalition, a contradiction.
It then follows that if c′≻
a
c, then ac′ and ac cannot belong to the same SCC. Should that occur, there would be an arc (of weight 0) from ac′ to some vertex a′c
∗ in the same SCC, implying that c
∗≃
a
c′ and thus c
∗≻
a
c. This in turn would yield that there is an arc of weight −1 from ac to a′c
∗ in this SCC, a contradiction.
We create the condensation G′ of the graph G. It follows from the definition of SCCs that G′ is a DAG. Hence G′ admits a topological ordering. Let X′ be a reversed topological ordering of G′ and X be an ordering of the vertices in G that is consistent with X′ (the vertices within one SCC may be ordered arbitrarily). Let Σ be an ordering over applicant copies that is consistent with X (we can think of it as obtained from X by removing the courses). We show that GSDT can produce μ given Σ. Note that technically Σ must contain b(a) copies of each applicant a. However, as μ is Pareto optimal, upon obtaining μ the algorithm will not be able to allocate any more courses to any of the applicants, even if we append more applicant copies to the end of Σ.
We continue the proof with an induction. Recall that X is an ordering over the matched pairs in μ. We let X(a
i) = c where a
i
c is the ith element of X. Let μ
i denote the matching that corresponds to the first i elements of X; hence μ
|μ| = μ. We claim that given Σ, GSDT is able to produce μ
i at stage i, after augmenting f
i−1 through an appropriate augmenting path.
For the base case, note that a
1
X(a
1) does not envy any other vertex in G and hence it can only be that \(X(a^{1}) \in C^{1}_{a^{1}}\). It is then easy to see that the path 〈σ, a
1,(a
1,1), X(a
1), τ〉 is a valid augmenting path in N
1,1 and hence GSDT might choose it.
Assume that GSDT produces μ
ℓ at the end of each stage ℓ for all ℓ<i. We prove that it can produce μ
i at the end of stage i. Assume, for a contradiction, that this is not the case. Let r denote the indifference class of a
i to which X(a
i) belongs. Note that course X(a
i) is not full in I
i, so if the path 〈σ, a
i,(a
i, r), X(a
i), τ〉 is not chosen by GSDT, it must be the case that GSDT finds an augmenting path in N
i, t for some t<r. Let \(\mathfrak {C}\) denote the corresponding augmenting path coalition with respect to the matching μ
i−1, which would be of the form
$$a^{i},c_{j_{1}},a^{i_{1}},\ldots,c_{i_{y-1}},a^{i_{y-1}},c_{j_{y}} $$
where \(c_{j_{1}} \in C^{t}_{a_{i}}\) and \(c_{j_{y}}\) is exposed in μ
i−1. It follows, from the definition of an augmenting path, that there is an edge \((a^{i_{k}}c_{j_{k}}, a^{i_{k+1}}c_{j_{k+1}})\) in G for all k, 1≤k≤y−2. Furthermore, as \(c_{j_{1}} {\succ }_{a^{i}} \mu (a^{i})\), there is an edge of weight −1 in G from a
i
X(a
i) to \(a^{i_{1}}c_{j_{1}}\); therefore \(a^{i_{1}}c_{j_{1}}\) belongs to a SCC of higher priority than the one to which a
i
X(a
i) belongs. If \(c_{j_{y}}\) is exposed in μ, then \(\mathfrak {C}^{\prime }\) that is obtained by adding X(a
i) to the beginning of \(\mathfrak {C}\) is an alternating path coalition in μ, a contradiction to μ being a POM. Therefore \(c_{j_{y}}\) must be full in μ.
As \(c_{j_{y}}\) is not full in μ
i−1 and full in μ, there must exist an a
z, z>i, such that \((a^{z},c_{j_{y}}) \in \mu \). It follows, from the augmenting path coalition \(\mathfrak {C}\), that there is a path in G from \(a^{i_{1}}c_{j_{1}}\) to \(a^{z}c_{j_{y}}\). If there is also a path from \(a^{z}c_{j_{y}}\) to \(a^{i_{1}}c_{j_{1}}\), then the two vertices belong to the same SCC; as \(a^{i_{1}}c_{j_{1}}\) belongs to a SCC of higher priority than the one to which a
i
X(a
i) belongs, so must \(a^{z}c_{j_{y}}\), implying that \(a^{z}c_{j_{y}}\) must have appeared before a
i
X(a
i) in X, a contradiction to z>i. If there is no such a path, then \(a^{z}c_{j_{y}}\) belongs to a SCC that is prioritized even over the SCC to which \(a^{i_{1}}c_{j_{1}}\) belongs, and hence must have appeared before a
i
X(a
i) in X, a contradiction to z>i. □