DiscreteQuadraticModel.add_linear_equality_constraint(terms: List[Tuple] | Generator[Tuple, None, None], lagrange_multiplier: float, constant: float)[source]#

Add a linear constraint as a quadratic objective.

Adds a linear constraint of the form \(\sum_{i,k} a_{i,k} x_{i,k} + C = 0\) to the discrete quadratic model as a quadratic objective.

  • terms – A list of tuples of the type (variable, case, bias). Each tuple is evaluated to the term (bias * variable_case). All terms in the list are summed.

  • lagrange_multiplier – The coefficient or the penalty strength

  • constant – The constant value of the constraint.