dwave.embedding.zephyr.find_biclique_embedding¶
-
find_biclique_embedding(a, b, m=None, target_graph=None)[source]¶ Find an embedding for a biclique in a Zephyr graph.
Given a biclique (a bipartite graph where every vertex in a set in connected to all vertices in the other set) and a target Zephyr graph, attempts to find an embedding.
Parameters: - a (int/iterable) – Describes the left shore of the biclique to embed. If
ais an integer, the left shore will be labelled [0, a-1]. Ifais an iterable, the left shore will be labelled bya. - b (int/iterable) – Describes the right shore of the biclique to embed. If
bis an integer andais an iterable, the right shore will be labelled [0, b-1]. If bothaandbare integers, the right shore will be labelled [a, a+b-1]. Ifbis an iterable, the right shore will be labelled byb. - m (int) – Number of tiles in a row of a square Zephyr graph. Required to
generate an
m-by-mZephyr graph whentarget_graphis None. - target_graph (
networkx.Graph) – A Zephyr graph. Required whenmis None.
Returns: A 2-tuple containing:
dict: An embedding mapping the left shore of the biclique to the Zephyr lattice.
dict: An embedding mapping the right shore of the biclique to the Zephyr lattice.
Return type: Examples
This example finds an embedding for an alphanumerically labeled biclique in a 2x2 Zephyr graph.
>>> from dwave.embedding.zephyr import find_biclique_embedding >>> left, right = find_biclique_embedding(['a', 'b', 'c'], ['d', 'e'], 2) >>> print(left, right) {'a': (0,), 'b': (4,), 'c': (8,)} {'d': (80,), 'e': (84,)}
- a (int/iterable) – Describes the left shore of the biclique to embed. If