I have a data similar to,
df = pd.DataFrame({'users': ['John', 'Bob', 'Alice', 'John', 'Alice','Bob','Alice','John', 'Bob', 'Alice'],
'class': ['Economics','Economics','Economics','Maths','Maths','Physics','Physics','CS','CS','CS'],
'rank':[2,1,3,1,2,2,1,3,1,2],
'total_students':[10,10,10,20,20,12,12,30,30,30]})
Unique users will be assigned to a class by meeting below requirements,
- John should teach 10% - 30% of total students
- Bob - min 10% of total students
- Alice - max 10% of total students
I have to find the optimal combination to assign user to a class which can be measured by min (total rank * total students)
I have tried few things but requires manual intervention as and when the % changes, Is there an algorithm to find optimal combination?