ladanyi@63: #include <vector> ladanyi@63: #include <iostream> ladanyi@63: #include <list_graph.hh> ladanyi@63: #include <bfs_iterator.hh> ladanyi@63: #include <loader.h> ladanyi@63: alpar@106: using namespace hugo; ladanyi@63: ladanyi@63: int main(int, char **) { ladanyi@63: typedef ListGraph::NodeIt NodeIt; ladanyi@63: typedef ListGraph::EdgeIt EdgeIt; ladanyi@63: typedef ListGraph::EachNodeIt EachNodeIt; ladanyi@63: typedef ListGraph::EachEdgeIt EachEdgeIt; ladanyi@63: typedef ListGraph::OutEdgeIt OutEdgeIt; ladanyi@63: typedef ListGraph::InEdgeIt InEdgeIt; ladanyi@63: typedef ListGraph::SymEdgeIt SymEdgeIt; ladanyi@63: ladanyi@63: ListGraph G; ladanyi@63: LoadGraph(G, "demo.in"); ladanyi@63: ladanyi@63: std::cout << "bfs from the first node" << std::endl; ladanyi@63: bfs<ListGraph> bfs_test(G, G.first<EachNodeIt>()); ladanyi@63: bfs_test.run(); ladanyi@63: std::cout << "reached: "; ladanyi@63: for(EachNodeIt i=G.first<EachNodeIt>(); i.valid(); ++i) { ladanyi@63: std::cout << bfs_test.reached.get(i) << " "; ladanyi@63: } ladanyi@63: std::cout<<std::endl; ladanyi@63: std::cout << "dist: "; ladanyi@63: for(EachNodeIt i=G.first<EachNodeIt>(); i.valid(); ++i) { ladanyi@63: std::cout << bfs_test.dist.get(i) << " "; ladanyi@63: } ladanyi@63: std::cout<<std::endl; ladanyi@63: }