dimod.DiscreteQuadraticModel.relabel_variables_as_integers#

DiscreteQuadraticModel.relabel_variables_as_integers(inplace=True)[source]#

Relabel the variables of the DQM to integers.

Parameters:

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

Returns:

A 2-tuple containing:

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

dict: The mapping that will restore the original labels.

Return type:

tuple