dwave.embedding.zephyr.find_clique_embedding#

find_clique_embedding(k, m=None, target_graph=None)[source]#

Find an embedding for a clique in a Zephyr graph.

Given a clique (fully connected graph) and target Zephyr graph, attempts to find an embedding.

Parameters:
  • k (int/iterable/networkx.Graph) – A complete graph to embed, formatted as a number of nodes, node labels, or a NetworkX graph.

  • m (int) – Number of tiles in a row of a square Zephyr graph. Required to generate an m-by-m Zephyr graph when target_graph is None.

  • target_graph (networkx.Graph) – A Zephyr graph. Required when m is None.

Returns:

An embedding as a dict, where keys represent the clique’s nodes and values, formatted as lists, represent chains of zephyr coordinates.

Return type:

dict

Examples

This example finds an embedding for a \(K_5\) complete graph in a 2-by-2 Zephyr graph.

>>> from dwave.embedding.zephyr import find_clique_embedding
>>> find_clique_embedding(5, 2)
{0: (16, 96), 1: (18, 98), 2: (20, 100), 3: (22, 102), 4: (24, 104)}