Instead of storing the graph in memory, directly write it out