Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  Nurse Rostering Problem

    Posted Mon November 09, 2020 08:58 AM
    Edited by System Admin Fri January 20, 2023 04:41 PM

    Hi IBM,
    It has been a while. I am back ^^
    My end-goal is to model a Contact Center Scheduling Problem in CP. In order to get there, I started with Nurse Scheduling Problem. 
    I was able to reproduce an MIP model for the same problem in the attached paper. The problem is more like an allocation problem. But, I decided to try a CP model and I became lost even after several years of CP experiences. The most tricky one to model the problem in CP are following constraints: maximum consecutive shifts, minimum consecutive shifts, minimum consecutive days off. Here are my questions:

    (1) can you please give me a sketch how would you model the Nurse Scheduling Problem in CP?
    (2) I am trying to pre-calculate all feasible work plans (it will be very large count; I will limit first 1000, for instance) for each agent and use alternative method to assign one of feasible plans to agent so that the three constraints could be already met. For this, I need your help. How to create a tuple AGENT2 out of AGENT with condition? In the following example, I am trying to keep only agent "A" in AGENT2. How can I do that? I have tried the codes in below, but it did not work.

    AGENT={
    < A,[28,28],8640,7560,5,2,2,2 >
    < B,[28,0],8640,7560,5,2,2,2 >
    < C,[28,28],8640,7560,5,2,2,2 >
    };

    using CP;
    tuple t_AGENT {
    key string a; //agent
    int ms[1..2]; //shift length in minutes
    int maxMin; //MaxTotalMinutes
    int minMin; //MinTotalMinutes
    int maxConS; //MaxConsecutiveShifts
    int minConS; //MinConsecutiveShifts
    int minConDOff; //MinConsecutiveDaysOff
    int maxWeekends; // MaxWeekends
    }
    {t_AGENT} AGENT = ...;

    //{t_AGENT} AGENT2 = {a in AGENT: a.a=="A"};
    //{t_AGENT} AGENT2 = {<a.a,a.ms,a.maxMin,a.minMin,a.maxConS,a.minConS,a.minConDOff,a.maxWeekends> | a in AGENT: a.a=="A"};

    execute {  writeln(AGENT);}

    Thanks,
    Andy


    #DecisionOptimization


  • 2.  RE: Nurse Rostering Problem

    Posted Fri November 13, 2020 10:24 AM
    Hello,
    you can find an OPL example for nurse rostering in the OPL examples directory (nurse.mod).
    As for your question 2, you can write:
    {t_AGENT} AGENT2 = {b | b in AGENT: b.a=="A"};
    Regards,
    Olivier

    ------------------------------
    Olivier Lhomme
    ------------------------------



  • 3.  RE: Nurse Rostering Problem

    Posted Fri November 13, 2020 10:45 AM
    Edited by System Admin Fri January 20, 2023 04:38 PM

    1. Thanks for the trick {b | b in AGENT: b.a=="A"};
    2. The OPL example (nurse.mod) is significantly different problem with the one in the article. Plus, I am looking for CP solution, not MIP.

    http://www.schedulingbenchmarks.org/nrp/
    Rahimian, E., Akartunalı, K., & Levine, J. (2017). A hybrid integer programming and variable neighbourhood search algorithm to solve nurse rostering problems. European Journal of Operational Research258(2), 411-423.


    Thanks,
    Andy


    #DecisionOptimization