metric_closure#
- metric_closure(G, weight='weight')[source]#
Return the metric closure of a graph.
The metric closure of a graph G is the complete graph in which each edge is weighted by the shortest path distance between the nodes in G .
- Parameters:
- GNetworkX graph
- Returns:
- NetworkX graph
Metric closure of the graph
G
.
Notes
Deprecated since version 3.6:
metric_closure
is deprecated and will be removed in NetworkX 3.8. Usenetworkx.all_pairs_shortest_path_length()
instead.