athos@1181: #include athos@1181: #include athos@1181: athos@1181: using namespace lemon; athos@1181: athos@1181: int main() athos@1181: { athos@1181: typedef ListGraph Graph; athos@1181: typedef Graph::Edge Edge; athos@1181: typedef Graph::InEdgeIt InEdgeIt; athos@1181: typedef Graph::OutEdgeIt OutEdgeIt; athos@1181: typedef Graph::EdgeIt EdgeIt; athos@1181: typedef Graph::Node Node; athos@1181: typedef Graph::NodeIt NodeIt; athos@1181: athos@1181: Graph g; athos@1181: athos@1181: for (int i = 0; i < 3; i++) athos@1181: g.addNode(); athos@1181: athos@1181: for (NodeIt i(g); i!=INVALID; ++i) athos@1181: for (NodeIt j(g); j!=INVALID; ++j) athos@1181: if (i != j) g.addEdge(i, j); athos@1181: athos@1181: std::cout << "Nodes:"; athos@1181: for (NodeIt i(g); i!=INVALID; ++i) athos@1181: std::cout << " " << g.id(i); athos@1181: std::cout << std::endl; athos@1181: athos@1181: std::cout << "Edges:"; athos@1181: for (EdgeIt i(g); i!=INVALID; ++i) athos@1181: std::cout << " (" << g.id(g.source(i)) << "," << g.id(g.target(i)) << ")"; athos@1181: std::cout << std::endl; athos@1181: }