0

i have a problem that i'll explain and i don't know if it is a scheduling problem :

for 30 or 31 days/month we want to assign doctors to shifts with some constraints :

1-every doctor must be assigned to specific number of days (e.g 10 or 12)

2-everyday we need specific number of doctors (e.g 3 doctors for normal days and 4 for tuesdays and 3

3-there's also some custom constraints like : no one could stay for 2 continuous days or 3 in some cases

4-special days like holidays are predefined, for example doctors 1-4 must stay for 2 holidays and doctors 5-8 must stay for 1 holidays.

5-finally some points of the table are predefined, for example doctor 1 want to stay for 3th and want no shift for 5th.

...

I myself now trying to treat the problem like a CSP :

a table[#doctors][#days]. each cell could be red green or white and doing a dfs search :

1-start with choosing a cell to assign
2-assigning red or green if it is valid (in stochastic order) or backtrack if it is not valid
3-check if solution reached

O( 2^(#days*#doctors) ) without any invalidity prediction

now my algorithm is really slow and i don't know if it could be faster using better function for predicting invalid nodes and backtrack sooner, i'm only good in binary constraints CSP but it is not

i want an algorithm finding the solution in about 10 minute or less

any idea or a better Algorithm class for this kind of problem ?

thanks alot

Dominique Fortin
  • 2,212
  • 15
  • 20
ameerosein
  • 523
  • 3
  • 16
  • 1
    Use a better constraint solver. – David Eisenstat Oct 27 '15 at 19:58
  • Simulated Annealing [works well for me](https://www.youtube.com/watch?v=7nPagqJK3bs) on Nurse Roster scheduling for INRC2010. On first sight, your constraints seems to be a subset of the constraints defined by [INRC2010](https://www.kuleuven-kulak.be/nrpcompetition). – Geoffrey De Smet Oct 28 '15 at 15:42

0 Answers0