dwave.optimization.symbols.DisjointBitSets#
- class DisjointBitSets#
Disjoint-sets decision-variable symbol.
Examples
This example adds a disjoint-sets symbol to a model.
>>> from dwave.optimization.model import Model >>> model = Model() >>> s = model.disjoint_bit_sets(primary_set_size=100, num_disjoint_sets=5) >>> type(s[0]) <class 'dwave.optimization.symbols.DisjointBitSets'>
- __init__(*args, **kwargs)#
Methods
__init__
(*args, **kwargs)equals
(other)Compare whether two nodes are identical.
expired
()has_state
([index])Return the initialization status of the indexed state.
iter_predecessors
()Iterate over a node's predecessors in the model.
iter_successors
()Iterate over a node's successors in the model.
maybe_equals
(other)Compare to another node.
num_disjoint_sets
()Return the number of disjoint sets in the symbol.
reset_state
(index)Reset the state of a node and any successor symbols.
set_state
(index, state)Set the state of the disjoint-sets symbol.
shares_memory
(other)Determine if two symbols share memory.
state_size
()Return an estimated size, in bytes, of the node's state.
topological_index
()Topological index of the node.
Attributes
model