If you need to visualise graphs, such as directed acyclic graphs, then yEd is a nice open-source tools to use. Save the graph to gml as show below. Then open up yEd, you can open it directly from yWorks website using webstart. For DAGs, I've found "hierarchical - interactive" view with "hierarchical - topmost" layout the best way to layout the graph.
DirectedGraph graph = new DefaultDirectedGraph(...);
GmlExporter gmlExporter = new GmlExporter();
File file = ...
Writer fileWriter = new BufferedWriter(new FileWriter(file));