dimod.AdjDictBQM.degree

AdjDictBQM.degree(v)[source]

Return degree of the specified variable.

The degree is the number of variables sharing an interaction with v.

Parameters

v (hashable) – Variable in the binary quadratic model.

Returns

Degree of v.

Raises

ValueError – If v is not a variable in the binary quadratic model.