Modify graph to prevent addition of nodes or edges.
Parameters: | G : graph
|
---|
See also
Notes
This does not prevent modification of edge data.
To “unfreeze” a graph you must make a copy.
Examples
>>> G=nx.path_graph(4)
>>> G=nx.freeze(G)
>>> G.add_edge(4,5)
...
NetworkXError: Frozen graph can't be modified