diff -r c914e7ec2b7b -r d99c3c84f797 demo/hello_lemon.cc --- a/demo/hello_lemon.cc Mon Jul 04 07:51:57 2005 +0000 +++ b/demo/hello_lemon.cc Mon Jul 04 13:08:31 2005 +0000 @@ -5,17 +5,38 @@ { typedef lemon::ListGraph Graph; typedef Graph::EdgeIt EdgeIt; + typedef Graph::Edge Edge; typedef Graph::NodeIt NodeIt; + typedef Graph::Node Node; + typedef Graph::EdgeMap LengthMap; using lemon::INVALID; Graph g; - for (int i = 0; i < 3; i++) - g.addNode(); + Node s=g.addNode(); + Node v2=g.addNode(); + Node v3=g.addNode(); + Node v4=g.addNode(); + Node v5=g.addNode(); + Node t=g.addNode(); + + Edge s_v2=g.addEdge(s, v2); + Edge s_v3=g.addEdge(s, v3); + Edge v2_v4=g.addEdge(v2, v4); + Edge v2_v5=g.addEdge(v2, v5); + Edge v3_v5=g.addEdge(v3, v5); + Edge v4_t=g.addEdge(v4, t); + Edge v5_t=g.addEdge(v5, t); - for (NodeIt i(g); i!=INVALID; ++i) - for (NodeIt j(g); j!=INVALID; ++j) - if (i != j) g.addEdge(i, j); + LengthMap length(g); + + length.set(s_v2, 10); + length.set(s_v3, 10); + length.set(v2_v4, 5); + length.set(v2_v5, 8); + length.set(v3_v5, 5); + length.set(v4_t, 8); + length.set(v5_t, 8); std::cout << "Hello World!" << std::endl; std::cout << std::endl; @@ -31,4 +52,13 @@ for (EdgeIt i(g); i!=INVALID; ++i) std::cout << " (" << g.id(g.source(i)) << "," << g.id(g.target(i)) << ")"; std::cout << std::endl; + std::cout << std::endl; + + std::cout << "There is a map on the edges (length)!" << std::endl; + std::cout << std::endl; + for (EdgeIt i(g); i!=INVALID; ++i) + std::cout << "length(" << g.id(g.source(i)) << "," << g.id(g.target(i)) << ")="<