Has anyone used the google OR tools in python to solve the workforce scheduling problem. Can you please let me know
- Advantages and Disadvantages
- Any issues faced during usage and implementation
Operations Research Stack Exchange is a question and answer site for operations research and analytics professionals, educators, and students. It only takes a minute to sign up.
Sign up to join this communityHas anyone used the google OR tools in python to solve the workforce scheduling problem. Can you please let me know
In addition to the answer from @Mehdi... I've recently started to work with OR-tools and find it very nice for prototyping. The Python interface allowed me to produce a first version of my model within one day. The times to obtain a first solution seem good - it performed very favorable in the MiniZinc Challenge 2018.
The main struggles/disadvantages that I've run into so far are the very limited support for floating point numbers. Compared to MiniZinc for example (which I also used) there is no possibility to have cumulative constraints with floats. Also, some constraints seem to be lacking from the catalog/ that MiniZinc offers. For example the AddMaxEquality
function allows only variables and no expressions to be used, so you'll have to add additional variables.
I also found that the documentation could use some improvements - for example the solver parameters were hidden in the source code and there was no dedicated place where they were listed (or I looked in the wrong directions).
I used OR-tools for TSP and VRP. These are my observations:
1- It provides a good quality solution in reasonable time. However, it is not the optimal solution and in some cases you can find much better solutions easily.
2- The implantation in Python is straightforward.
3- It is not flexible. You can not add many extensions to the problem, just basic assumptions and constraints.
4- You will have some option such as giving the initial solution, the algorithm settings.
If you want a good solution fast and you are sure you will not expand the problem later, then go for it.
Workforce scheduling describes many different problems.
The best technology for those is IMO CP-SAT (see the introduction, the reference manual in the CP-SAT sections and a set of recipes).
A popular concert is shift scheduling. This example has gained a lot of traction in the past. It shows how to implement useful constraints on the problem that contains fixed daily shifts.