dimod.AdjDictBQM.relabel_variables_as_integers

AdjDictBQM.relabel_variables_as_integers(inplace=True)[source]

Relabel the variables of the binary quadratic model to integers.

Parameters

inplace (bool, optional, default=True) – If True, the binary quadratic model is updated in-place; otherwise, a new binary quadratic model is returned.

Returns

A 2-tuple containing:

Binary quadratic model with the variables relabeled. If inplace is set to True, returns itself.

dict: Mapping that restores the original labels.

Return type

tuple