No need to call graph.WriteFile() if the graph is empty.