This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.
Return a copy of the graph.
G : Graph
A copy of the graph.
- return a directed copy of the graph.
This makes a complete copy of the graph including all of the node or edge attributes.
>>> G = nx.Graph() # or DiGraph, MultiGraph, MultiDiGraph, etc >>> G.add_path([0,1,2,3]) >>> H = G.copy()