Write graph structure to disk.