IBMDecisionOptimization/docplex-examples

Obvious wrong solution for "nurses_scheduling.ipynb"

Closed this issue · 3 comments

You only need to look at the plot and you will see that it is an incorrect solution.

image

The code is also clear that it is incorrect.
image
For almost all rows you don't have enough nurses for the pass.

I haven't changed anything, just printed the solution.

I hope you can fix the example :)

The nurse problem is a demo of the relaxation mechanism of docplex, as such this problem is infeasible (see Bound infeasibility column 'NurseWorkTime_Betsy'. in the notebook) because some requirements are too strict.
That's why we use the relaxation mechanism of CPLEX to compute a feasible solution.
Among the relaxed requirements, you will find all the requirements you hightlighed, for example:

* number of relaxations: 35
 - relaxed: high_req_min_EMER_Mon_18_3, with relaxation: -3.0
 - relaxed: high_req_min_CONS_Mon_08_10, with relaxation: -7.0
 - ...

So the gantt is displaying a feasible solution, not the optimal solution.

I understand that it is an example, but it removes a whole shift!!!
Finding a solution to this problem is not particularly difficult if you remove certain work shifts.

The problem is that people don't only get sick during the day, but people always get sick around the clock. This means that you actually have to have staff on site 24/7. Then it is wrong that the solution means that one should not work at night. That's not how it actually works in healthcare in real life.

This line remove the whole shift.
``

  • relaxed: high_req_min_EMER_Mon_18_3, with relaxation: -3.0
    ``

Is it possible to change that it is not allowed to draw down to zero staff?

notebook have been updated