Return an undirected representation of the digraph.
Returns: | G : Graph
|
---|
Notes
If edges in both directions (u,v) and (v,u) exist in the graph, attributes for the new undirected edge will be a combination of the attributes of the directed edges. The edge data is updated in the (arbitrary) order that the edges are encountered. For more customized control of the edge attributes use add_edge().
This is similar to Graph(self) which returns a shallow copy. self.to_undirected() returns a deepcopy of edge, node and graph attributes.