Skip to content

Commit

Permalink
Using a bipartite matching algorithm (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlarson1 authored Jan 16, 2025
1 parent 72f81cc commit 8ecf9a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/find_optimal_communication_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get_qubit_assignment(
graph = build_placement_graph(code, folded_layout, max_comm_dist)
if graph is None:
return None
matching = nx.max_weight_matching(graph, maxcardinality=True)
matching = nx.bipartite.maximum_matching(graph)
return matching if nx.is_perfect_matching(graph, matching) else None


Expand Down

0 comments on commit 8ecf9a6

Please sign in to comment.