dwave.system.composites.VirtualGraphComposite.adjacency¶
-
VirtualGraphComposite.
adjacency
= None¶ dict[variable, set] – The adjacency structure.
Examples
>>> class StructuredObject(dimod.Structured): ... @property ... def nodelist(self): ... return [0, 1, 2] ... ... @property ... def edgelist(self): ... return [(0, 1), (1, 2)] >>> test_obj = StructuredObject() >>> for u, v in test_obj.edgelist: ... assert u in test_obj.adjacency[v] ... assert v in test_obj.adjacency[u]