dimod.AdjVectorBQM.remove_variable

AdjVectorBQM.remove_variable(self, v=None)

Remove a variable and its associated interactions.

Parameters

v (variable, optional) – The variable to be removed from the binary quadratic model. If not provided, the last variable added is removed.

Returns

The removed variable.

Return type

variable

Raises

ValueError – If the binary quadratic model is empty or if v is not a variable.