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.