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.Graph()
>>> G.add_path([0,1,2,3])
>>> G=nx.freeze(G)
>>> try:
... G.add_edge(4,5)
... except nx.NetworkXError as e:
... print(str(e))
Frozen graph can't be modified