RoadMap to more general flow algs.
3 // Use a DIMACS max flow file as stdin.
4 // dim_to_dot < dimacs_max_flow_file > dot_output_file
5 // This program makes a dot file from a dimacs max flow file.
6 // This program can be an aid in making up to date visualized documantation
12 #include <lemon/smart_graph.h>
13 #include <lemon/dimacs.h>
15 using namespace lemon;
22 typedef SmartGraph Graph;
24 typedef Graph::Edge Edge;
25 typedef Graph::Node Node;
26 typedef Graph::EdgeIt EdgeIt;
27 typedef Graph::NodeIt NodeIt;
28 typedef Graph::EdgeMap<int> LengthMap;
34 readDimacs(std::cin, g, length, s, t);
36 cout << "digraph lemon_dot_example {" << endl;
37 cout << " node [ shape=ellipse, fontname=Helvetica, fontsize=10 ];" << endl;
38 for(NodeIt n(g); n!=INVALID; ++n) {
40 cout << " n" << g.id(n)
41 << " [ label=\"" << g.id(n) << " (s)\" ]; " << endl;
44 cout << " n" << g.id(n)
45 << " [ label=\"" << g.id(n) << " (t)\" ]; " << endl;
47 cout << " n" << g.id(n)
48 << " [ label=\"" << g.id(n) << "\" ]; " << endl;
52 cout << " edge [ shape=ellipse, fontname=Helvetica, fontsize=10 ];" << endl;
53 for(EdgeIt e(g); e!=INVALID; ++e) {
54 cout << " n" << g.id(g.source(e)) << " -> " << " n" << g.id(g.target(e))
55 << " [ label=\"" << g.id(e)
56 << ", length:" << length[e] << "\" ]; " << endl;