dimod.AdjVectorBQM.relabel_variables_as_integers

AdjVectorBQM.relabel_variables_as_integers(self, inplace=True)

Relabel as integers the variables of a binary quadratic model.

Uses the natural labelling of the underlying C++ objects.

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:

A 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