pub fn to_json(graph: &Graph) -> String
Serialize a graph to pretty-printed JSON.
This format is intended for debugging and inspection. For production use, prefer the binary format which is more compact.