Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail in bqm init when max_time is increased #7

Open
rugantio opened this issue Feb 4, 2021 · 1 comment
Open

fail in bqm init when max_time is increased #7

rugantio opened this issue Feb 4, 2021 · 1 comment

Comments

@rugantio
Copy link

rugantio commented Feb 4, 2021

Hello,
While trying this code, I noticed that the method to construct the bqm, get_jss_bqm, breaks when max_time is increased.
I set up a minimal experiment:

  • 2 machines
  • 3 jobs (1st job: 2 ops, 2nd job: 2 ops, 3rd job: 1 op)
  • all ops of take time 1 to complete
    this was solved easily when max_time <= 8 but, as soon as max_time == 9, this is the error that I obtain:
  File "<ipython-input-4-7aaea837e31a>", line 96, in <module>
    bqm = get_jss_bqm(jobs, max_time, stitch_kwargs)

  File "..t/job_shop_scheduler.py", line 74, in get_jss_bqm
    return scheduler.get_bqm(stitch_kwargs)

  File "../job_shop_scheduler.py", line 352, in get_bqm
    bqm = dwavebinarycsp.stitch(self.csp, **stitch_kwargs)

  File "/usr/lib/python3.8/site-packages/dwavebinarycsp/compilers/stitcher.py", line 188, in stitch
    if pmodel.classical_gap >= min_classical_gap:

AttributeError: 'NoneType' object has no attribute 'classical_gap'

I made some edits to the files for visualization purposes so the line number might be different, but this error seems to be quite common (I encountered it also in other set-ups)

Let me know if you can reproduce the error and if you need to know further details. Thank you!

@mcfarljm
Copy link

mcfarljm commented Feb 6, 2021

Hi, I'm able to recreate what may be a similar issue by setting max_time to 7 or larger in demo.py with all other settings the same. For me, this produces an ImpossibleBQM exception. I suspect it is related to setting the max time to a value that is larger than the worst case scenario, which for demo.py is 6. See the notes about max_time in the README file. You might try using a value of None for max_time, which defaults to the worst case. However, I have noticed that this can also lead to the exception identified in Issue #9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants