Coder Social home page Coder Social logo

dwave-examples / employee-scheduling Goto Github PK

View Code? Open in Web Editor NEW
22.0 6.0 22.0 12.48 MB

Schedule employees using a constrained quadratic model with a hybrid solver.

License: Apache License 2.0

Python 68.40% CSS 31.60%
optimization hybrid-solution cqm intermediate

employee-scheduling's Introduction

Open in GitHub Codespaces

Employee Scheduling

Employee scheduling is a common industry problem that often becomes complex due to real-world constraints. This example demonstrates a scheduling scenario with a variety of employees and rules.

Screen Image

Installation

You can run this example without installation in cloud-based IDEs that support the Development Containers specification (aka "devcontainers").

For development environments that do not support devcontainers, install requirements:

pip install -r requirements.txt

If you are cloning the repo to your local system, working in a virtual environment is recommended.

Usage

Your development environment should be configured to access Leap’s Solvers. You can see information about supported IDEs and authorizing access to your Leap account here.

To run the demo, type the python app.py command into your terminal and then open a web browser to the URL printed to the terminal.

Set any of the input options to configure the problem and then click the "Solve CQM" button. While the problem is being solved, you can see status updates in the browser and terminal.

Introducing the Demo

The employee availability chart shows employee shift preferences and unavailable days (PTO). Preferred shifts are in teal and marked with a 'P', while unavailable shifts are in orange and marked with an 'X'.

In the chart, there are three different types of employees.

  • Managers: These are employees with 'Mgr' at the end of their name.
  • Employees: These are employees with no tag at the end of their name.
  • Trainees: These are employees with 'Tr' at the end of their name. The trainee has the same name as their trainer. The trainee can only be scheduled to work on a shift that their trainer is also scheduled to work.

The chart displays employee preferences and availability for this month. It will always display the current month, with one column for each day in this current month.

Inputs

Input options under the Basic Configuration tab are as follows:

  • Number of employees: Schedules always include 2 managers and 1 trainee.
  • Example scenario: Auto-populates all settings with scenarios of varying sizes that produce feasible solutions.

Additional input options under the Advanced Configuration tab are as follows:

  • Allow isolated days off: Unchecked, this option means that employees are scheduled at least two consecutive days off between work days.
  • Require a manager on every shift: Checked, this option means that every shift must have exactly one manager on duty to supervise.
  • Min/max shifts per employee: The range you set determines the number of shifts an employee can work in the month.
  • Min/max employees per shift: The range you set determines how many employees need to be assigned to each shift.
  • Max consecutive shifts: The maximum number of consecutive shifts an employee can be scheduled before a day off must be scheduled.
  • Random seed: Optional; use if you want consistency between subsequent runs of the example.

Outputs

Once the problem has completed, the best solution returned is displayed in place of "Employee Availability". Click back to "Employee Availability" using the tabs at the top of the schedule card.

The solution returned is either the best feasible solution (if a feasible solution is found) or the best infeasible solution (if no feasible solution is found). If an infeasible solution is found, scrolling down shows the list of constraints that were violated.

employee-scheduling's People

Contributors

arcondello avatar hemantdwave avatar joelpasvolsky avatar randomir avatar thisac avatar vgoliber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

employee-scheduling's Issues

Consider scheduling in two week shifts rather than one month

Many companies schedule on two weeks at a time. We should consider switching the schedule from monthly to biweekly. Probably also calling out weekends/weekdays.

IMO ideal would be keeping the "real" date, so having the schedule starting on the next Sunday from the current date, or something like that.

Constraints

I'm curious if this can take several constraints, such as I want the person to have x attributes and to be available for a template of shifts so on 2/22/2022, 4/22/2022, 4/25/2022, etc. or find the top x people who fits most of those.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.