Graph input-output demo, some documentation.
2 #include <lemon/list_graph.h>
6 typedef lemon::ListGraph Graph;
7 typedef Graph::EdgeIt EdgeIt;
8 typedef Graph::NodeIt NodeIt;
13 for (int i = 0; i < 3; i++)
16 for (NodeIt i(g); i!=INVALID; ++i)
17 for (NodeIt j(g); j!=INVALID; ++j)
18 if (i != j) g.addEdge(i, j);
20 std::cout << "Hello World!" << std::endl;
21 std::cout << std::endl;
22 std::cout << "This is library LEMON here! We have a graph!" << std::endl;
23 std::cout << std::endl;
25 std::cout << "Nodes:";
26 for (NodeIt i(g); i!=INVALID; ++i)
27 std::cout << " " << g.id(i);
28 std::cout << std::endl;
30 std::cout << "Edges:";
31 for (EdgeIt i(g); i!=INVALID; ++i)
32 std::cout << " (" << g.id(g.source(i)) << "," << g.id(g.target(i)) << ")";
33 std::cout << std::endl;