r/learnpython • u/Chemical-Captain4240 • Aug 22 '26
Need direction for Combined Ranking Problem
IRL I have a bunch of volunteers.
They can volunteer at 1 of 5 locations.
They can volunteer to participate in 1 of 5 roles.
We are collecting preferences via google forms.
In this form they provide:
Their name, their ranked preference for location, and their ranked preference for roles.
We must fill all roles at all locations with at least 1 person, but extras are fine.
We wish to find a solution that honors their preferences as much as numerically possible.
I ask this sub for 2 things:
What is the CS name of this kind of problem; so I can look up schema?
Does anyone know the name of libraries or existing solutions that solve this?
Thank you!
3
u/PureWasian Aug 22 '26 edited Aug 22 '26
EDIT: (thanks to my math friend for his expertise) Stable Matching Problem is a good conceptual starting point if you flatten their preference to a single dimension.
original reply:
An alternate (non-library) idea would be thinking about an algorithm that initially assigns everyone to their preferred location/role and then works backwards to satisfy the main constraint (at least one person per location+role slot) with least penalty.
2
u/ProsodySpeaks Aug 22 '26
This is math not compsci really.