Giter Club home page Giter Club logo

nurse-scheduling's Issues

run error

Hi,
When I run python nurse_scheduling.py, following error occurred:

Traceback (most recent call last):
File "nurse_scheduling.py", line 166, in
sampler = LeapHybridSampler()
File "/Users/jinzhe/opt/anaconda3/lib/python3.8/site-packages/dwave/system/samplers/leap_hybrid_sampler.py", line 97, in init
self.client = Client.from_config(
File "/Users/jinzhe/opt/anaconda3/lib/python3.8/site-packages/dwave/cloud/client.py", line 344, in from_config
return _clients_client
File "/Users/jinzhe/opt/anaconda3/lib/python3.8/site-packages/dwave/cloud/client.py", line 386, in init
raise ValueError("API token not defined")
ValueError: API token not defined

I installed dwave with pip install dwave-system.
Could you help me?
Thanks,

Trouble reproducing the exact qubo equation

I refer to both the hard shift and soft nurse constraint.

In doing my algebra, I wasn't able to reproduce the exact equation found in the documentations for both constraints.
I think I may have gotten rusty at my high school math but please look at the following and enlighten me:

Mine: Expanding the following equation and removing the constant:

    lagrange_hard_shift * sum_d ( effort * sum_n q_i(n,d) - workforce ) ** 2

gives me the following:

    lagrange_hard_shift * effort ** 2 * sum_d sum_m sum_n q_i(n,d) q_j(m, d)   (Similar)
    - 2 * lagrange_hard_shift * sum_d sum_n q_i(n,d) * effort * workforce   (Different)

Documentation: Notice the (Different) parts - above vs the bottom one:

    lagrange_hard_shift * (effort ** 2 - 2 effort * workforce) * sum_d sum_n q_i(n,d)   (Different)
    + lagrange_hard_shift * effort ** 2 * sum_d sum_m sum_n q_i(n,d) q_j(m, d)    (Similar)

There is an additional effort **2 among other things. Can someone please kindly explain the differences?
Thanks

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.