I am trying to find an algorithm which calculates an optimal and stable allocation of $n$ students to $m$ projects, where each student strictly ranks all projects by preference. The available projects are predetermined and of fixed number and each student needs to be allocated to exactly one project. Each project needs at least one student, but can hold up to a maximum of $y$ students.
For my purposes, there will be on average between 8 to 15 projects available and 80 to 250 students to assign to these projects, resulting in average group sizes of 8 to 15 students per project. A reasonable value for $y$ is usually $\frac{n}{m}+2$.
The definition of optimal and stable as put by @Gassa:
(1) There is no student $S$ assigned to project $P$ such that $S$ likes $Q$ more and $Q$ has an empty slot; (2) there is no pair of students $(S,T)$ such that the current assignments are $S→P$ and $T→Q$, but $S→Q$ and $T→P$ would both be more preferred.
All sort relevant sources I could find so far (listed below) either require an equal number of students and projects (stable marriage) or allocate only one student to each project (exchange-stable matching [1] / the matching problem) and I find it non-trivial to adapt these algorithms for the described purpose.
Sources
- [1] Pages 41ff of Algorithmics of Two-Sided Matching Problems by David J. Abraham
- [2] A Systematic Approach to the Implementation of Final Year Project in an Electrical Engineering Undergraduate Course by C. Y. Teo and D. J. Ho
- [3] Student Project Allocation Using Integer Programming by A. A. Anwar and A. S. Bahaj
- [4] Similar (but not identical) question Assignment based on ranked preference on Stack Exchange