Roster problem The objective of the problem is to cover a weekly work load with morning-, day- and evening shifts. The shifts must be arranged in a circular grid complying to construction and social rules. For each week-day of a typical week, the number of shifts per type is given. Some supplementary `joker' shifts are added in order to manage absenteeism. Last but not least, the days-off must be planned. The number of required shift types days-off are given for a N line grid of weeks. They have to be set in a circular grid in order to cover the demand for each day. Each different shift type has a label: M : Morning shift J : Mid-Day shift (late start, early end) E : Evening shift K : Joker R : Day-off Some social rules must be respected and are reflected in the constraints below. Hard constraints The first constraint is the number of labels for every day of the week. Over the N weeks, the number of shifts types for each weekday must sum up to the required number. The second constraint is the length of a working period: No more than 6 consecutive days without a day-off. The third constraint is not to have more than 3 days-off consecutively. Flexible constraints The soft constraints are: - not to have isolated days off - not to have a morning shift after a day with an evening shift Objective The program purpose is to minimise the cost, which is defined as the number of violations of soft constraints. Example 5-week problem: Requirements data: Mo Tu We Th Fr Sa Su R = 3 2 1 0 1 1 5 Days off M = 1 0 1 0 1 2 0 Morning shift E = 1 2 0 1 1 1 0 Evening shift J = 0 1 2 2 2 1 0 Mid-day shift K = 0 0 1 2 0 0 0 Joker A sample solution with cost 1 is: week1 R R M E R R R week2 M R R J M M R week3 R E J J E E R week4 R E J K J M R week5 E J K K J J R The violation is that there is an isolated R (day off) in week 4.