Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

create_empty_copy

create_empty_copy(G, with_nodes=True)[source]

Return a copy of the graph G with all of the edges removed.

Parameters :

G : graph

A NetworkX graph

with_nodes : bool (default=True)

Include nodes.

Notes

Graph, node, and edge data is not propagated to the new graph.