Skip to content

Solving Constrained Quadratic Models with LeaphHybridCQMSampler class #1031

Open
@pabloT97

Description

@pabloT97

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion or general discussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions