Added class Writer.java to write the graph on the output file