2

I'm trying to schedule 30 teaching assistants to cover about 118 hours of office hours. Office hours at different times of day need different coverage (0, 1, 2, or 3 asssistants). People are scheduled on the half hour.

I've made an integer linear program such that I have a 0/1 variable indexed by worker and shift: 0 if not working then, 1 if working then. Coverage is easy, but it leads to some workers being scheduled for only a half-hour shift, which is not fair to them.

My second attempt was to have a richer set of indexed variables, by (worker, start time, length of shift). This is where the snags begin:

  • If I limit the number of shifts per worker to one shift per day, the IP solver grinds away for hours with no solution.

  • If I allow two shifts per worker per day, things work pretty well, except sometimes the solver schedules a single worker for two shifts that overlap. Which means the solver thinks I have 3 people on duty but I really only have 2.

  • My final attempt was to introduce constraints such that no worker can ever be scheduled for two shifts that overlap. At this point my tools grind for a while and then blow up with an out-of-memory error.

I'm using the RIMA optimization package with the COIN CPB solver. (Have also tried lpsolve.)

I feel like 30 workers into circa 150 slots should not be that difficult! So I think I must be formulating the problem in a stupid way. Thus my question: how can I learn how to formulate my scheduling problem in a way that solvers will do well with it?

(If it matters, the objective function I am trying to maximize is the total utility to all the workers of all the shifts they have been assigned. It's just a number indexed by worker and shift.)

Rodrigo de Azevedo
  • 1,097
  • 9
  • 17
Norman Ramsey
  • 198,648
  • 61
  • 360
  • 533
  • (1) It's hard to digest anything here as there is no code and only unspecific-descriptions (2) Maybe MIP can work, but maybe SAT / CP / Metaheuristics or Hybrids of those are more suited for this problem. (3) *Not fair to them* often calls for some kind of regularization / objective term to handle this: often some kind of norm: l1/l2 (4) *grinds away for hours with no solution*: tune solver-params or try other alts for feas sol (5) Overlapping: many things are possible; but something i learned in the past: interval-graph = chordal = max-cliques calc in poly-time = convex-hull for IP = powerful – sascha Jan 14 '18 at 02:23
  • (6) We can't debug out of memory errors without code or analyzing your tools in use (7) Solver is called **CBC**. (8) *I feel like 30 workers into circa 150 slots should not be that difficult!* Well... if it's NP-hard, there will always be instances with asymptotics like 2*30 or worse. That's the basic message of NP-hardness. Of course real-world instances can look different, but we don't know your data. – sascha Jan 14 '18 at 02:25
  • Sometimes column generation approaches work very well for this type of models. – Erwin Kalvelagen Jan 14 '18 at 13:36
  • @sascha I wouldn't want to inflict my code on anyone. I want to learn how to formulate ILP problems, not to get help debugging my code. – Norman Ramsey Jan 15 '18 at 13:54

1 Answers1

1

This problem is almost exactly the set covering problem albeit with added constraints. The correct way to model this with integer programming is to use a column generation approach. This example of the cutting stock problem from IBM's CPLEX should be clear enough that you would most likely be able to adapt it to your problem.