Click here to Skip to main content
15,913,941 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to make a program that schedules fairly day shifts for a month between 15 people more or less.Every day 2 people have to be on duty(one primary and one substitute).the minimum time between 2 shifts is 3 days.a person has the option to choose a few days(give dates) for which he does not want to be on duty.of course i must schedule the shifts fairly(e.g a person cannot take 4 weekend shifts where another has 4 daily). The idea is to represent each person with a weight and sort the list of people according to that weight(ascending).starting from the beginning of the month i will choose the first person on the list(if the restrictions are ok) for the first shift and increase his weight by lets say 1(for weekends it should be more) and sort the list.accordingly for the second shift and so on..
i just want to know your thoughts for the above solution(or a better idea of course) before i start implementing it.
Posted

1 solution

It looks like you have thought about what you want to do, and that is good. Go ahead and code it. Come back here if you have problems with bits of code.
A suggestion: When you have chosen your person and assigned the shift, you don't need to do a full sort of the list, but just move that person down the list, just like one pass of a bubble sort.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900