#

Note

This documents the development version of NetworkX. Documentation for the current release can be found here.

#

networkx.algorithms.approximation.steinertree.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

G (NetworkX graph)

Returns

Metric closure of the graph G.

Return type

NetworkX graph