0

I am a newbie to google or tools and currently i am working on an employee scheduling problem. the problem have a constraint that, as per the footfall of the shift, employees are assigned to the shifts. each employee is ranked from 1-n, and are assigned to the shift, such that better ranked employee get assigned to higher footfall shift. I have the data for the shift priorities, and employee ranks, but i am unable to proceed with the constraint to be provided to the solver. Please help.

no0bCoder
  • 95
  • 1
  • 1
  • 11

2 Answers2

2

I don't know enough about the model to give an authoritative answer. But here we go. I would consider making this part of the objective instead of a hard constraint. Suppose we modeled the assignment of employees to shifts using a binary variable:

x[i,k] = 1 if employee i is assigned to shift k
         0 otherwise

Then add to the objective a term

sum( (i,k), x[i,k] * rank[i] * footfall[k])

such that this term is maximized.

Erwin Kalvelagen
  • 15,677
  • 2
  • 14
  • 39
0

You can have a look at this starting example:

https://github.com/google/or-tools/blob/stable/examples/python/shift_scheduling_sat.py

Laurent Perron
  • 8,594
  • 1
  • 8
  • 22