- randint(graph: Union[int, Tuple[Collection[Hashable], Collection[Tuple[Hashable, Hashable]]], Collection[Tuple[Hashable, Hashable]], networkx.classes.graph.Graph], vartype: Union[dimod.vartypes.Vartype, str, frozenset], low: int = 0, high: int = 1, cls: None = None, seed: Optional[int] = None) dimod.binary.binary_quadratic_model.BinaryQuadraticModel ¶
Generate a binary quadratic model with random biases and offset.
Biases and offset are integer-valued in specified range.
graph – The graph to build the binary quadratic model (BQM) on. Either an integer n, interpreted as a complete graph of size n, a nodes/edges pair, a list of edges or a NetworkX graph.
Variable type for the BQM. Accepted input values:
low – Inclusive low end of the range for the random biases.
high – Inclusive high end of the range for the random biases.
cls – Deprecated. Does nothing.
seed – Random seed.
A binary quadratic model.
Deprecated since version 0.10.13: The
clskeyword argument will be removed in 0.12.0. It currently does nothing.