590 likes | 698 Views
Algorithms for Student-Project Allocation. David Manlove University of Glasgow Department of Computing Science Joint work with David Abraham and Rob Irving. S upported by E PSR C grant GR/R84597/01, Nuffield Foundation award NUF-NAL-02, and RSE / SEETLLD Personal Research Fellowship.
E N D
Algorithms for Student-Project Allocation David Manlove University of GlasgowDepartment of Computing Science Joint work with David Abraham and Rob Irving Supported by EPSRC grant GR/R84597/01,Nuffield Foundation award NUF-NAL-02, and RSE / SEETLLD Personal Research Fellowship
Background • Students may undertake project work during degree course • Set of students, projects and lecturers • Typically a wide range of projects – exceeding number of students • Students may rank projects in preference order • Lecturers may rank students in preference order • Projects / lecturers may have capacities
Efficient algorithms • Growing interest in automating the allocation process • Efficient algorithms are important • Can identify a family of matching problems • Range of optimisation criteria possible • Cases considered:
Case 1: formal definition • No explicit preferences; project capacities only • Set of students S={s1, s2, …, sn} • Set of projects P={p1, p2, …, pm} • Set of lecturers L={l1, l2, …, lq} • Each lecturer lkoffers a set of projects Pk P • assume that P1, P2, …, PqpartitionsP • Each project pjhas a capacitycj • Each student sifinds acceptable a set of projects Ai P
Definition of a matching • An assignment M is a subset of S×P • If (si, pj)M, where lk offers pj, we say that • siis assigned topj • siis assigned tolk • pj isassignedsi • lk is assignedsi • A matching M is an assignment such that: • ifsiis assigned topjin Mthensi findspjacceptable • siis assigned to at most one project in M • pj is assigned at most cj students in M
Case 1: example • Set of students, projects and lecturers: • S={s1, s2, s3,s4,s5}, P={p1, p2, p3,p4,p5}, L={l1, l2, l3} • Lecturers offer projects as follows: • P1={p1, p2}, P2={p3}, P3={p4, p5} • Project capacities: • c1= c2 =c4 =c5 =1, c3 =2 • Students find projects acceptable as follows: • A1={p1, p3} • A2={p1 , p4} • A3={p2, p4} • A4={p1, p2, p4} • A5={p2, p4}
Corresponding bipartite graph capacity s1 p1 1 s2 p2 1 s3 p3 2 s4 p4 1 p5 s5 1
A matching s1 p1 1 capacity s2 p2 1 s3 p3 2 s4 p4 1 p5 s5 1 • A set of edges Mis a matching inGif: • each student siis incident to at most one edge of M • each project pjis incident to at most cjedges of M
A maximum matching s1 p1 1 capacity s2 p2 1 s3 p3 2 s4 p4 1 p5 s5 1 Degree-constrained subgraph problem: A maximum matching may be found in time O where L is the number of edges (Gabow, 1983)
Case 2: student preferences • Assume that each student si has a strictly-ordered ranking list Ri over Ai • Project capacities only • Let r denote the maximum length of any student’s preference list • Define the signature of a matching M to be an r-tuple x1, x2, …, xrwhere xi denotes the number of students assigned in M to theirith-choiceproject • A matching M is greedy if M has maximum signature (with respect to lexicographic order) • i.e. the maximum number of students obtain their first-choice project, and subject to this condition, the maximum number of students obtain their second-choice project, etc.
Case 2: example • Set of students, projects and lecturers: • S={s1, s2, s3}, P={p1, p2, p3}, L={l1} • Project capacities are all 1 • Student preference lists: • s1 : p1 • s2 :p2p1 p3 • s3 : p2p3 • Matching M1={(s1, p1) (s2, p3) (s3, p2)}, signature 2, 0, 1 • Matching M2={(s1, p1) (s2, p2) (s3, p3)}, signature 2, 1, 0 • M2 is greedy
Case 2: example • Set of students, projects and lecturers: • S={s1, s2, s3}, P={p1, p2, p3}, L={l1} • Project capacities are all 1 • Student preference lists: • s1 : p1 • s2 :p2p1 p3 • s3 : p2p3 • Matching M1={(s1, p1), (s2, p3), (s3, p2)}, signature 2, 0, 1 • Matching M2={(s1, p1) (s2, p2) (s3, p3)}, signature 2, 1, 0 • M2 is greedy
Case 2: example • Set of students, projects and lecturers: • S={s1, s2, s3}, P={p1, p2, p3}, L={l1} • Project capacities are all 1 • Student preference lists: • s1 : p1 • s2 :p2p1 p3 • s3 : p2p3 • Matching M1={(s1, p1), (s2, p3), (s3, p2)}, signature 2, 0, 1 • Matching M2={(s1, p1), (s2, p2), (s3, p3)}, signature 2, 1, 0 • M2is greedy
Finding a greedy matching • Traditional method: transform to instance of assignment problem • Create weighted bipartite graph G=(V,E) with V=SP and E={(si,pj) : pjAi} • For any student si and project pj Ai, define ranki(pj)=k,wherepjis the kth-choice project of si • Weight of edge(si,pj)is nr-k where k=ranki(pj) • Compute a maximum weight matching in G • Complexity of algorithm: O(rn(L+nlog n))(Fredman and Tarjan, 1987) • Two problems: • Arithmetic operations involving edge weights O(r) • Possible implementation difficulties
A direct algorithm • Combinatorial algorithm: O(min(n+R, Rn)m) where R is the largest rank used in a greedy matching (Irving, Kavitha, Mehlhorn, Michail and Paluch, “Rank-Maximal Matchings”, to appear in SODA 2004) • Algorithm can be generalised to deal with arbitrary project capacities
Greedy matchings vs maximum matchings • Greedy matchings need not be maximum matchings • E.g. set of students, projects and lecturers: • S={s1, s2, s3}, P={p1, p2, p3}, L={l1} • Project capacities are all 1 • Student preference lists: • s1 : p1p3 • s2 : p2 • s3 : p2p1
Greedy matchings vs maximum matchings • Greedy matchings need not be maximum matchings • E.g. set of students, projects and lecturers: • S={s1, s2, s3}, P={p1, p2, p3}, L={l1} • Project capacities are all 1 • Student preference lists: • s1 :p1p3 • s2 : p2 • s3 : p2p1 • Two greedy matchings: • M1={(s1, p1), (s2, p2)}, signature 2, 0 • M2={(s1, p1), (s3, p2)}, signature 2, 0
Greedy matchings vs maximum matchings • Greedy matchings need not be maximum matchings • E.g. set of students, projects and lecturers: • S={s1, s2, s3}, P={p1, p2, p3}, L={l1} • Project capacities are all 1 • Student preference lists: • s1 : p1p3 • s2 : p2 • s3 : p2p1 • Two greedy matchings: • M1={(s1, p1), (s2, p2)}, signature 2, 0 • M2={(s1, p1), (s3, p2)}, signature 2, 0 • Maximum matching • M3={(s1, p3), (s2, p2), (s3, p1)}, signature 1, 2
Greedy maximum matchings and rank-minimum matchings • Define a greedy maximum matching to be a matching with maximum signature, taken over all maximum (cardinality) matchings • The existence of a direct (combinatorial) algorithm for finding a greedy maximum matching remains open • Greedy matchings could leave some people very badly off • Alternative notion of optimality: define the cost of a matching M to be: cost(M)={ranki(pj) : (si, pj)M} • Define a rank-minimum matching to be a matching with minimum cost, taken over all maximum matchings
Greedy matchings vsrank-minimum matchings • E.g. set of students, projects and lecturers: • S={s1, s2, s3,, s4,s5}, P={p1, p2, p3, p4,p5}, L={l1} • Project capacities are all 1 • Student preference lists: • s1 : p1 • s2 : p2p5 • s3 : p3 • s4 : p4 • s5 : p1p2 p3p4 p5 • Greedy matching: • M1={(s1, p1), (s2, p2), (s3, p3), (s4, p4), (s5, p5)}, signature 4, 0, 0, 0, 1,cost9 • Rank-minimum matching • M2={(s1, p1), (s2, p5), (s3, p3), (s4, p4), (s5, p2)}, signature 3, 2, 0, 0, 0,cost 7
Greedy matchings vsrank-minimum matchings • E.g. set of students, projects and lecturers: • S={s1, s2, s3,, s4,s5}, P={p1, p2, p3, p4,p5}, L={l1} • Project capacities are all 1 • Student preference lists: • s1 : p1 • s2 : p2p5 • s3 : p3 • s4 : p4 • s5 : p1p2 p3p4 p5 • Greedy matching: • M1={(s1, p1), (s2, p2), (s3, p3), (s4, p4), (s5, p5)}, signature 4, 0, 0, 0, 1,cost9 • Rank-minimum matching • M2={(s1, p1), (s2, p5), (s3, p3), (s4, p4), (s5, p2)}, signature 3, 2, 0, 0, 0,cost 7
Greedy matchings vsrank-minimum matchings • E.g. set of students, projects and lecturers: • S={s1, s2, s3,, s4,s5}, P={p1, p2, p3, p4,p5}, L={l1} • Project capacities are all 1 • Student preference lists: • s1 : p1 • s2 : p2p5 • s3 : p3 • s4 : p4 • s5 : p1p2p3p4 p5 • Greedy matching: • M1={(s1, p1), (s2, p2), (s3, p3), (s4, p4), (s5, p5)}, signature 4, 0, 0, 0, 1,cost9 • Rank-minimum matching • M2={(s1, p1), (s2, p5), (s3, p3), (s4, p4), (s5, p2)}, signature 3, 2, 0, 0, 0,cost7
Case 3: lecturer capacities • Assume that each lecturer lkhas a capacity dk • Assume that each student si ranks Ai as before • Projects have capacities as before • A matching M is an assignment such that: • ifsiis assigned topjin Mthensi findspjacceptable • siis assigned to at most one project in M • pj is assigned at most cj students in M • lk is assigned at most dk students in M • An optimal solution is a rank-minimum matching
Finding a rank-minimum matching (1) • Define a weighted network N as follows: • Vertices are V={s}SPL{t} (s is source and t is sink) • Add an edge (s, si) of capacity 1 for each si • Add an edge (si, pj) of capacity 1 for each si and pj Ai • Add an edge (pj, lk) of capacity cj for each lk and pj Pk • Add an edge (lk, t) of capacity dk for each lk • Edge (si, pj) has cost ranki(pj) • All other edges have cost 0
Finding a rank-minimum matching (2) • The cost of a flow f is cost(f)={cost(e)f(e):eE} • Find a min cost-max flow f in N • Using f, create an assignment M as follows: • For each si and pj , if f(si,pj)=1 add (si,pj ) to M • M is a rank-minimum matching • Complexity of algorithm: O(e(e+vlog v)log B/(m+n))where v is number of vertices,eis number of edges andBis sum of edge capacitiesin N(Goldfarb and Jin, 1999)
Case 3: example • Set of students, projects and lecturers: • S={s1, …,s5}, P={p1, …,p7}, L={l1, l2, l3} • Lecturers offer projects as follows: • P1={p1, p2}, P2={p3,p4}, P3={p5, p6,p7} • Project capacities: • p5has capacity 2; all others have capacity 1 • Lecturer capacities: • d1=2, d2=1,d3=2 • Student preference lists: • s1 : p1p3p5 • s2 :p1 p4p6 • s3 :p4p1p5 • s4 : p1p6p7 • s5 : p5p3p2
Example network N Edge costs in green Edge capacities in red p1 1 1 s1 p2 1 1 s2 p3 l1 1 2 1 s 1 1 t 1 s3 p4 l2 1 2 2 1 s4 p5 l3 1 2 3 p6 1 s5 All these edges have capacity 1 p7
Min cost-max flow f in N p1 s1 p2 s2 p3 l1 2 s t 1 s3 p4 l2 2 s4 p5 l3 p6 s5 cost(f)=10 Blue edges have flow >0 - flow is 1 unless stated otherwise p7
Case 4:student and lecturer preferences • Assume that each student si has a strictly-ordered ranking list Ri over Ai • For each lecturer lk , let Bk denote the set of students who find acceptable a project offered by lk • lk has a strictly-ordered ranking list over Bk • A solution is a stable matching • A matching M is stable if it admits no blocking pair • Formal definition to follow • For any student si matched in M, M(si) denotes the project thatsi is assigned to • For any project pj, M(pj) denotes the set of students assigned topj • For any lecturerlk, M(lk) denotes the set of students assigned toprojects offered bylk
Definition of a blocking pair • (si, pj)M is a blocking pair ofMif: • pj Ai • Either si is unmatched in M, or si prefers pj to M(si) • Either • pjis under-subscribed and lk is under-subscribed • pj is under-subscribed and lk is full, and either siM(lk) or lkprefers si to the worst student in M(lk) • pj is full and lkprefers si to the worst student in M(pj) where lk is the lecturer who offerspj • Given this preference and capacity information, the problem of finding a stable matching is called the Student-Project Allocation Problem (SPA)
Example SPA instance Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 l1offers p1, p2, p3 s3 :p2p1p4 s4 : p2 l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offersp7, p8 c1 = 2;all other projects have capacity 1
SPA instance: blocking pair Student preferences Lecturer preferences s1 : p1p7l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p2 p1 l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2 l2 :s3s2s6s7s5 d2 = 2 s5 :p1p2p3p4 p4p6l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8l3 :s1s7d3 = 2 p7 p8 l3offers p7, p8 c1 = 2;all other projects have capacity 1 (s1, p1) forms a blocking pair: • s1prefers p1 to M(s1)=p7 • p1is under-subscribed and l1is under-subscribed
SPA instance: blocking pair Student preferences Lecturer preferences s1 : p1p7l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p2 p1 l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2 l2 :s3s2s6s7s5 d2 = 2 s5 :p1p2p3p4 p4p6l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8l3 :s1s7d3 = 2 p7 p8 l3offers p7, p8 c1 = 2;all other projects have capacity 1 (s6, p5) forms a blocking pair: • s6prefers p5 to M(s6)=p6 • p5is under-subscribed and s6 is assigned to a project offered by l2
SPA instance: blocking pair Student preferences Lecturer preferences s1 : p1p7l1 : s7s4s1s3s2s5s6d1= 3 s2 :p1p2p3p4p5p6 p2 p1 p3l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 p4p5l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 :p5p3p8 l3 :s1s7 d3 = 2 p7l3offers p7, p8 c1 = 2;all other projects have capacity 1 (s1, p1) forms a blocking pair: • s1prefers p1 to M(s1)=p7 • p1is under-subscribed and l1 is full and l1 prefers s1 to the worst student assigned to l1
SPA instance: blocking pair Student preferences Lecturer preferences s1 : p1p7l1 : s7s4s1s3s2s5s6d1= 3 s2 :p1p2p3p4p5p6 p2 p1 p3l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 p4p5l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 :p5p3p8 l3 :s1s7 d3 = 2 p7l3offers p7, p8 c1 = 2;all other projects have capacity 1 (s5, p3) forms a blocking pair: • s5is unmatched and finds p3 acceptable • p3is full and l1 prefers s5 to the worst student assigned to p3
SPA instance: stable matching Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p3 p2p1l1offers p1, p2, p3 s3 :p2p1p4 s4 :p2l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 p4p5l2offers p4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offers p7, p8 c1 = 2;all other projects have capacity 1 The matching is stable
Finding a stable matching • Every instance of SPA admits at least one stable matching • Previous stable matching was student-optimal • Each student obtains the best project that he/she could obtain in any stable matching • HR is a special case of SPA in which all lecturers have capacity • Linear-time algorithms for HR produce stable matchings that are student-optimal or lecturer-optimal (Gusfield and Irving, 1989) • For SPA with arbitrary lecturer capacities, there are also linear-time algorithms giving student-optimal and lecturer-optimal stable matchings (Abraham, Irving, Manlove, “The Student-Project Allocation Problem”, to appear in ISAAC 2003)
Execution of the algorithm Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2 l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offersp7, p8 c1 = 2;all other projects have capacity 1
Execution of the algorithm Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p1l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2 l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offersp7, p8 c1 = 2;all other projects have capacity 1 s1 applies to p1 p1 remains under-subscribed l1 remains under-subscribed
Execution of the algorithm Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p1 p1l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2 l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offersp7, p8 c1 = 2;all other projects have capacity 1 s2 applies to p1 p1 becomes full; p1 deleted from list of s5 l1 remains under-subscribed
Execution of the algorithm Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p1 p2p1l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2 l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offersp7, p8 c1 = 2;all other projects have capacity 1 s3 applies to p2 p2 becomes full; p2 deleted from lists of s2, s5and s6 l1 becomes full; p3 deleted from lists of s5and s6
Execution of the algorithm Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p2 p1 p2p1l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offersp7, p8 c1 = 2;all other projects have capacity 1 s4 applies to p2 p2 becomes over-subscribed; p2 rejects s3
Execution of the algorithm Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p2 p1 p1l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offersp7, p8 c1 = 2;all other projects have capacity 1 s4 applies to p2 p2 becomes over-subscribed; p2 rejects s3 p2 becomes full; p2 deleted from list of s3 l1 remains full
Execution of the algorithm Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p2 p1 p1p1l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offersp7, p8 c1 = 2;all other projects have capacity 1 s3 applies to p1 p1 becomes over-subscribed; p1 rejects s2
Execution of the algorithm Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p2 p1 p1l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offersp7, p8 c1 = 2;all other projects have capacity 1 s3 applies to p1 p1 becomes over-subscribed; p1 rejects s2 p1 becomes full; p1 deleted from list of s2 l1 remains full; p3 deleted from list of s2
Execution of the algorithm Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p2 p1 p1l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 p4l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offersp7, p8 c1 = 2;all other projects have capacity 1 s2 applies to p4 p4 becomes full; p4 deleted from list of s5 ands6 l2 remains under-subscribed
Execution of the algorithm Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p2 p1 p1l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 p4p5l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offersp7, p8 c1 = 2;all other projects have capacity 1 s6 applies to p5 p5 becomes full; p5 deleted from list of s7 l2 becomes full
Execution of the algorithm Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p3p2 p1 p1l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 p4p5l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offersp7, p8 c1 = 2;all other projects have capacity 1 s7 applies to p3 l1 becomes over-subscribed; l1 rejects s3
Execution of the algorithm Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p3p2 p1l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 p4p5l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offersp7, p8 c1 = 2;all other projects have capacity 1 s7 applies to p3 l1 becomes over-subscribed; l1 rejects s3 p3 becomes full l1 becomes full; p1 deleted from list of s3
Execution of the algorithm Student preferences Lecturer preferences s1 : p1p7 l1 : s7s4s1s3s2s5 s6 d1= 3 s2 :p1p2p3p4p5p6 p3p2 p1l1offersp1, p2, p3 s3 :p2p1p4 s4 : p2l2 :s3s2s6s7s5 d2 = 2 s5 : p1p2p3p4 p4p4p5l2offersp4, p5, p6 s6 : p2p3p4p5p6 s7 : p5p3p8 l3 :s1s7 d3 = 2 l3offersp7, p8 c1 = 2;all other projects have capacity 1 s3 applies to p4 p4 becomes over-subscribed; p4 rejects s2