dimod.Structured.edgelist

Structured.edgelist

list[(node, node)] – Edges/interactions allowed by the sampler, formatted as a list where each edge/interaction is a 2-tuple.

Examples

This example defines the edgelist for a structured sampler that can only sample from a binary quadratic model with a single interaction between two variables.

class TwoVariablesSampler(dimod.Sampler, dimod.Structured):
    @property
    def edgelist(self):
        return [(0, 1)]

    # Remaining properties and code for the sampler