Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add target_edges parameter to pegasus.find_clique_embedding #293

Closed
JoelPasvolsky opened this issue Apr 29, 2020 · 3 comments
Closed

Add target_edges parameter to pegasus.find_clique_embedding #293

JoelPasvolsky opened this issue Apr 29, 2020 · 3 comments

Comments

@JoelPasvolsky
Copy link
Contributor

JoelPasvolsky commented Apr 29, 2020

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

@boothby
Copy link
Contributor

boothby commented Apr 30, 2020

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)

@arcondello
Copy link
Member

See also dwavesystems/dwave-networkx#165

@arcondello
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants