dimod.QuadraticModel.relabel_variables_as_integers

QuadraticModel.relabel_variables_as_integers(inplace: bool = True) Tuple[dimod.quadratic.quadratic_model.QuadraticModel, Mapping[Hashable, Hashable]][source]

Relabel the variables as [0, n) and return the mapping.

Parameters

inplace – If set to False, returns a new binary quadratic model mapped to the new labels.

Returns

The original or new quadratic model with updated variable labels.