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