dwave.optimization.model.Symbol.iter_successors#

Symbol.iter_successors()#

Iterate over a node’s successors in the model.

Examples

This example constructs iterates over the successor nodes of a DisjointLists symbol.

>>> from dwave.optimization.model import Model
>>> model = Model()
>>> lsymbol, lsymbol_lists = model.disjoint_lists(
...     primary_set_size=5,
...     num_disjoint_lists=2)
>>> lsymbol_lists[0].equals(next(lsymbol.iter_successors()))
True