void write(Graph graph, String filename) throws FileNotFoundException, IOException
filename
.graph
- the graph to be writtenfilename
- the filename of the file to which the graph is writtenFileNotFoundException
- thrown if the file exists but is a directory rather than a
regular file, does not exist but cannot be created, or cannot be opened for any other reasonIOException
- thrown if an I/O error occurs while writing the graph