# Save graph nx.write_gml(G, "path_where_graph_should_be_saved.gml") # Read graph G = nx.read_gml('path_to_graph_graph.gml')