Since you have not provided more details, we can only give you broad pointers.
The first way out: A stable marriage problem .
And also search the Internet for Bipartite matching (or in the case of weighted edges: An assignment problem that can be solved with: Hungaring algorithm ).
Please note that resolving the problem of stable marriage can also solve your problem, albeit with a fake project β student preference.
I expect one of the above (stable marriage / bipartisan matching / appointment) will work for you, but cannot really say without additional information.
Aryabhatta
source share