You need to be an expert in minizinc for this job!
I am trying to write hospital schedule for my wife. This is often referred to as a “nurse scheduling problem”. The constraint program needs to be written in minizinc. I started with the model, but my underlying solvers (Geocode, Chuffed, OR) cannot handle my code (too complex and / or too poorly written).
The aim is to develop a working minizinc model which will be hosted on a website at a later stage.
--------------------------------
Requirements:
----------------------------------
• Parameters
o All data/parameters will be stored in a separate data file
amount of days (e.g. 90), people (e.g. Chris), shifts (e.g. evening)
shifts require working hours
people have contractual working time / hours
people may have overtime from previous schedule
hard constraint & soft constraint data
• Hard constraints
o shifts defined per day (e.g. every Monday two evening shifts)
o shifts defined per specific day (e.g. Tuesday the 30th four evening shifts)
o shifts defined per day per person (e.g. Chris every Monday two day shifts)
o shifts defined per specific day per person (e.g. Chris on Friday the 31st is off)
o within 5 consecutive days at least 1 day is off
o sum of working hours per schedule <= contractual working time + overtime
o Total amount of night shifts equally distributed
o Total amount of weekend shifts equally distributed
o Shifts depending on other shifts during per day (e.g. if there is a morning shift on Sunday, there needs to be an evening shift)
o Shifts depending on other shifts on previous days (e.g. if Chris had a nightshift yesterday, today he may only either be off or have another nightshift)
• Soft constraints
o Each shift per day has a “penalty” (e.g. Monday evening shift = 10, Monday day = 0)
o Sum of penalty to be as equal as possible within all people
o If specific shifts are scheduled on specific days (e.g. every Tuesday, every second Saturday, the 30th of Ocotober), there is a specific “benefit” allocated (e.g. 20)
• Solve
o Utility = sum of benefit – sum of penalty
o Solve maximize utility
• Output
o Schedule (days horizontal, people vertical)
o Time accounting
How many hours available per contract per person
How many hours worked per person
How many shifts worked on which days per person
o Shift accounting:
How many shifts scheduled?
How many shifts scheduled per day?