I have been tasked to do a scheduling program in my company. Basically given N employee you should schedule them shift for the month. I tried to do this via brute force and ordered priority of constraint. However, I am having problem when trying to maintain vertical and horizontal constraints.
Vertical constraints, all person should have equal number of shift per month. (e.g. They should be within the average number of day shift, night shift, rest day, early shift) However, there is also a day horizontal constraint that the number of shift per day should be equal daily.
I tried searching the internet and I usually read answer on using Genetic Algorithm. In my study of Genetic Algorithm, it seems the algorithm is not that suitable in my case. Does anybody know how to solve such problem?
Additional Illustration based on Enigmativity's comment: Basically there are 4 shifts,
The Y's are the employee shift total for the month which needs to be evenly distributed per employee. (ie each employee should have equal (or just difference by one) amount of shift type for the month) - Vertical constraint.
The X's are the daily total for all employee, basically each shift should also be evenly distributed for weedays and for weekends. - Horizontal constaint
Also, there are other constraint like desired shifts and adjacent shifts. But I tried to simplify it with just these even out rules for now.
--------------------------------------------------------------------------------
| Employee | 1 | 2 | 3 | 4 | + + + | 28 | 29 | 30 | 31 | S1 | S2 | S3 | S4 |
--------------------------------------------------------------------------------
| EmpA | S3 | S4 | S1 | S2 | + + + | S3 | S4 | S1 | S2 | Y | Y | Y | Y |
--------------------------------------------------------------------------------
| EmpB | S1 | S3 | S4 | S1 | + + + | S2 | S3 | S4 | S1 | Y | Y | Y | Y |
--------------------------------------------------------------------------------
| EmpC | S2 | S1 | S3 | S4 | + + + | S1 | S2 | S3 | S4 | Y | Y | Y | Y |
--------------------------------------------------------------------------------
| EmpD | S2 | S2 | S2 | S3 | + + + | S4 | S1 | S2 | S3 | Y | Y | Y | Y |
--------------------------------------------------------------------------------
| S1 | X | X | X | X | + + + | X | X | X | X | | | | |
--------------------------------------------------------------------------------
| S2 | X | X | X | X | + + + | X | X | X | X | | | | |
-------------------------------------------------------------------------------
| S3 | X | X | X | X | + + + | X | X | X | X | | | | |
--------------------------------------------------------------------------------
| S4 | X | X | X | X | + + + | X | X | X | X | | | | |
--------------------------------------------------------------------------------