Constrained Quadratic Models vs Binary Quadratic Models
Hello,
I am trying to understand what model fits better my purpose. I have a binary quadratic function to minimise with a lot of constraints. So far I have explicitly constructed the qubo but I need to refactor the formulation from scracth and I want to use some of the handy methods of the models' classes.
I have noticed I can add constraints to both the Binary and Constrained Quadratic Model.
For the Binary one, we have a soft constrain, with a lagrange multiplier, which corresponds to what I have done with my original formulation.
For the Constrained one instead it seems it is using hard constrains, in particular it says:
Constraints added by this method are guaranteed to be satisfied in solutions returned by the LeapHybridCQMSampler hybrid sampler.
My questions are:
- Are there any differences (behind the scenes) between the two models when passed to the solver? Is the constrained one just applying a soft constraint (with a Lagrange multiplier I cannot control) + filtering on the sampled solutions?
- In case there are differences between the two, given I have quite a few constraints in my QUBO, what model should I opt for?
- I have used SimulatedAnnealingSampler for debugging locally, which sampler can I use with the Constrained Quadratic Sampler? The exact one fails quite quickly due to the number of variables.
Comments
Hello,
Please see below for a response to your questions:
1. The two models have different types of input used to represent the problem. The CQM model allows for a higher-level representation of constraint inputs, while the BQM gives a closer look at the individual variables.
Unfortunately our HSS Solvers are proprietary so we can't discuss details about how they function.
For the CQM, there are both hard and soft constraints. Take a look at the weight parameter in the documentation for adding constraints.
2. For problems with constraints we recommend using the CQM.
3. We only have the LeapHybridCQMSampler and ExactCQMSampler for CQMs and just the latter for testing locally.
Thank you for reaching out to us. Please let us know if you have any more questions.
Please sign in to leave a comment.