iduedu.write_gml

iduedu.write_gml(graph, gml_path)[source]

Write a NetworkX graph to GML, coercing node coordinates to plain floats.

Ensures node attributes x and y are Python float, then writes the graph using stringizer=str so any non-primitive attribute values are serialized as strings.

Parameters:
  • graph (networkx.Graph) – Input graph. Not mutated — a sanitized copy is written.

  • gml_path (str) – Output GML file path.

Returns:

The sanitized copy of the graph that was written to disk.

Return type:

(nx.Graph)