Which algorithm for assigning shifts (discrete optimization problem)

后端 未结 9 2578
说谎
说谎 2020-12-15 05:34

I\'m developing an application that optimally assigns shifts to nurses in a hospital. I believe this is a linear programming problem with discrete variables, and therefore p

相关标签:
9条回答
  • 2020-12-15 05:38

    Mike,

    Don't know if you ever got a good answer to this, but I'm pretty sure that constraint programming is the ticket. While a GA might give you an answer, CP is designed to give you many answers or tell you if there is no feasible solution. A search on "constraint programming" and scheduling should bring up lots of info. It's a relatively new area and CP methods work well on many types of problems where traditional optimization methods bog down.

    0 讨论(0)
  • 2020-12-15 05:45

    Umm, did you know that some ILP-solvers do quite a good job? Try AIMMS, Mathematica or the GNU programming kit! 600 Variables is of course a lot more than the Lenstra theorem will solve easily, but sometimes these ILP solvers have a good handle and in AIMMS, you can modify the branching strategy a little. Plus, there's a really fast 100%-approximation for ILPs.

    0 讨论(0)
  • Dynamic programming a la Bell? Kinda sounds like there's a place for it: overlapping subproblems, optimal substructures.

    0 讨论(0)
  • 2020-12-15 05:53

    I solved a shift assignment problem for a large manufacturing plant recently. First we tried generating purely random schedules and returning any one which passed the is_schedule_valid test - the fallback algorithm. This was, of course, slow and indeterminate.

    Next we tried genetic algorithms (as you suggested), but couldn't find a good fitness function that closed on any viable solution (because the smallest change can make the entire schedule RIGHT or WRONG - no points for almost).

    Finally we chose the following method (which worked great!):

    1. Randomize the input set (i.e. jobs, shift, staff, etc.).
    2. Create a valid tuple and add it to your tentative schedule.
    3. If not valid tuple can be created, rollback (and increment) the last tuple added.
    4. Pass the partial schedule to a function that tests could_schedule_be_valid, that is, could this schedule be valid if the remaining tuples were filled in a possible way
    5. If !could_schedule_be_valid, simply rollback (and increment) the tuple added in (2).
    6. If schedule_is_complete, return schedule
    7. Goto (2)

    You incrementally build a partial shift this way. The benefit is that some tests for valid schedule can easily be done in Step 2 (pre-tests), and others must remain in Step 5 (post-tests).

    Good luck. We wasted days trying the first two algorithms, but got the recommended algorithm generating valid schedules instantly in under 5 hours of development.

    Also, we supported pre-fixing and post-fixing of assignments that the algorithm would respect. You simply don't randomize those slots in Step 1. You'll find that the solutions doesn't have to be anywhere near optimal. Our solution is O(N*M) at a minimum but executes in PHP(!) in less than half a second for an entire manufacturing plant. The beauty is in ruling out bad schedules quickly using a good could_schedule_be_valid test.

    The people that are used to doing it manually don't care if it takes an hour - they just know they don't have to do it manually any more.

    0 讨论(0)
  • 2020-12-15 05:53

    I think you should use genetic algorithm because:

    • It is best suited for large problem instances.
    • It yields reduced time complexity on the price of inaccurate answer(Not the ultimate best)
    • You can specify constraints & preferences easily by adjusting fitness punishments for not met ones.
    • You can specify time limit for program execution.
    • The quality of solution depends on how much time you intend to spend solving the program..

      Genetic Algorithms Definition

      Genetic Algorithms Tutorial

      Class scheduling project with GA

    Also take a look at :a similar question and another one

    0 讨论(0)
  • 2020-12-15 05:55

    Using CSP programming I made programms for automatic shitfs rostering. eg:

    1. 2-shifts system - tested for 100+ nurses, 30 days time horizon, 10+ rules
    2. 3-shifts system - tested for 80+ nurses, 30 days time horizon, 10+ rules
    3. 3-shifts system, 4-teams - tested for 365 days horizon, 10+ rules,

    and a couple of similiar systems. All of them were tested on my home PC (1.8GHz, dual-core). Execution times always were acceptable ie. for 3/ it took around 5 min and 300MB RAM.

    Most hard part of this problem was selecting proper solver and proper solving strategy.

    0 讨论(0)
提交回复
热议问题