dimod.ConstrainedQuadraticModel.set_objective#
- ConstrainedQuadraticModel.set_objective(objective)[source]#
Set the objective of the constrained quadratic model.
- Parameters:
objective – Binary quadratic model (BQM) or quadratic model (QM) or an iterable of tuples.
Examples
>>> from dimod import Integer, ConstrainedQuadraticModel >>> i = Integer('i') >>> j = Integer('j') >>> cqm = ConstrainedQuadraticModel() >>> cqm.set_objective(2*i - 0.5*i*j + 10)