I am wondering if there are any scheduling examples for DEAP?
I want to use a genetic algorithm to search for an optimal schedule for in-home care giving services, where there are
- M nurses, providing
- N patient-services, over
- L time-slots (or shifts).
My first issue is with representation:
I thought of creating an individual type based on a numpy array with shape (N,2).
For example: np.array( [4,8], [5,4] ) , represents two patient-services, where the first is performed by nurse_id "4"' in shift_id "8", and the second patient_service is performed by nurse_id "5" in shift_id "4".
There are quite a lot of hard-constraints,
For example,
a) a nurse can only perform one patient-service during a shift, ( any one nurse-shift pairing [4,8] can occur only once in the individuals)
b) each nurse must be "qualified" to perform the assigned patient service. we could maintain a 2d array "qualified", where q[i,j] =1, means nurse i is qualified to take on patient-service j.
And some soft constraints:
a) each patient has preferences - e.g. pref[i,j] means patient j has a preference for nurse i (3 is highest preference, 0 is lowest preference)
To implement the hard-constraints, I can use tools.DeltaPenalty to wrap a feasibility check over the individuals.
However, if the individual is no good, I want to either repair it, or return the closest feasible individual. What is the most straightforward way to "repair" such a complex individual? It seems non-trivial to find a good "close" individual.
Also, would you suggest a different representation?
Thanks
Ilana