dwave-system icon indicating copy to clipboard operation
dwave-system copied to clipboard

Add `target_edges` parameter to pegasus.find_clique_embedding

Open JoelPasvolsky opened this issue 5 years ago • 2 comments

Current Problem Unlike the Chimera version of find_clique_embedding, the Pegasus version requires a NetworkX graph.

Proposed Solution Similar parameter to Chimera's find_clique_embedding

Alternatives Considered Grunt work to use the existing function:

G =nx.Graph()
G.add_nodes_from(qpu.nodelist)
G.add_edges_from(qpu.edgelist)
p6 = dnx.pegasus_graph(6)
missing_nodes = [node for node in p6.nodes if node not in G.nodes]
missing_edges = [edge for edge in p6.edges if edge not in G.edges]
p6.remove_nodes_from(missing_nodes)
p6.remove_edges_from(missing_edges)

Additional context Advantage

JoelPasvolsky avatar Apr 29 '20 19:04 JoelPasvolsky

Preferred Alternative:

import dwave_networkx as dnx
import dwave.embedding as dwe
p = dnx.pegasus_graph(6, node_list = qpu.nodelist, edge_list = qpu.edgelist)
# even more preferable, already-requested feature:
# p = dnx.pegasus_graph(solver=qpu)
emb = dwe.pegasus.find_clique_embedding(k, target_graph=p)

boothby avatar Apr 30 '20 16:04 boothby

See also https://github.com/dwavesystems/dwave_networkx/issues/165

arcondello avatar Apr 30 '20 16:04 arcondello

I think this has largely been resolved by the addition to to_networkx_graph() method.

arcondello avatar Jan 26 '23 18:01 arcondello