The ward has 8 employees, 4 full-timers, and 4 part-timers.
  1. The full-timers A, B, C, and D work 36 h/week, and hence can work 18 shifts of 8 hours in 4 weeks.
  2. The part-timers E, F, G, and H work 20 h/week, and hence can work 10 shifts of 8 hours in 4 weeks.
The ward has only day shifts (D) and night shifts (N). For day shifts we need 3 each day, while each day there starts one night shift. Hence 4 weeks contain 4x28 = 112 shifts, which can be covered exactly by the staff provided above (4x18 + 4x10 = 112).

The day shift D starts at 8 AM and ends at 5 PM; there is a break from 12 to 1 PM.
The night shift N starts at 11 PM, and is shown in the schedule on the day it starts. The shifts ends at 7 AM the next day. The night shift starting at 11 PM on Friday is considered a weekend shift, as well the the shifts starting on Saturday and Sunday.

The scheduling period of 28 days is from January 2, 2006 to (inclusive) January 29, 2006.

The hard constraints are:
  1. To a full-timer 18 shifts have to be assigned.
  2. To a part-timer 10 shifts have to be assigned.
  3. Each day there starts at most one shift for an employee.
  4. Each employee gets at most 4 night shifts, of which at most 3 on consecutive days.
  5. Each employee works at most 6 days in a row.
  6. Each any 3 consecutive weekend, at least one is free of labour.
  7. After a series of 1,2, or 3 night shifts, there is 48 hours free of labour.
The soft constraints for an employee are:
  1. A single night shift gets penalty 100.  (A single night shift  on January 29 is not penalised by this rule.)
  2. A stand-alone shift gets penalty 100 . (A stand-alone shift  on January 29 is not penalised by this rule.)
  3. A weekend with 1 shift gets penalty 100.
  4. A rest of one day gets penalty 10. (Work on January 28, and rest on January 29 is not penalised by this rule.)
  5. A full-timer gets 4 or 5 shifts per week (from Monday till Monday), and a part-timer 2 or 3. Penalty 1, 4, 9, 16 for deviation of 1, 2, 3 or 4.
  6. A full-timer gets series of length 4 to 6, and a part-timer of lengte 2 or 3. Penalty 1,4,9 for deviation 1,2,3. (Too short series at the end of the schedule are not penalised!)
Pre-assigned are:

To A: D on January 2 and D on January 3.
To C: D on January 2 and D on January 3.
To D: N on January 2 and N on January 3.
To E: D on January 2 and D on January 3.