dwavesystems / dwavesystems/dimod
Solving Constrained Quadratic Models with LeaphHybridCQMSampler class
- Dominant language
- Python
- Stars
- 143
- Forks
- 91
- Avg merge
- 1h 24m
- Merged PRs (30d)
- 3
Description
Working with Constrained Quadratic Models, I have tried to implement the example of the bin packing problem which appears on :
[https://docs.ocean.dwavesys.com/en/latest/docs_dimod/reference/constrained.html#dimod.ConstrainedQuadraticModel
](url)
On this easy problem, clearly the best solution is to use 2 bins.
Applying the same exact code as it appears on the link, I try to solve it calling the sample:
`LeapHybridCQMSampler().sample_cqm(cqm)`
But it returns each time a different result (most of the time a bad one).
What could this be due to?? The problem can be solved manually, so the solver should arrive almost always to the optimal solution. Moreover, as we are working with Leap's Hybrid, the only parameter of the solver that may be changed is `time_limit,` which would have no effect.
I reformulated the problem as QUBO (assigning different weights to the constraints) and I got a good result using `LeapHybridSampler`
Contributor guide
Assessment
This issue has not been assessed yet.