5 #include <list_graph.h>
6 //#include <smart_graph.h>
7 #include <hugo/dimacs.h>
8 #include <hugo/time_measure.h>
9 #include <for_each_macros.h>
10 #include <bfs_iterator.h>
15 typedef ListGraph Graph;
16 typedef Graph::Node Node;
17 typedef Graph::NodeIt NodeIt;
18 typedef Graph::Edge Edge;
19 typedef Graph::EdgeIt EdgeIt;
20 typedef Graph::OutEdgeIt OutEdgeIt;
24 Graph::EdgeMap<int> cap(g);
25 //readDimacsMaxFlow(std::cin, g, s, t, cap);
26 readDimacs(std::cin, g);
28 Graph::NodeMap<OutEdgeIt> pred(g);
32 Graph::NodeMap<bool> reached(g);
35 std::queue<Node> bfs_queue;
37 while (!bfs_queue.empty()) {
38 Node v=bfs_queue.front();
41 for(g.first(e,v); g.valid(e); g.next(e)) {
51 std::cout << ts << std::endl;
56 BfsIterator< Graph, Graph::NodeMap<bool> > bfs(g);
57 bfs.pushAndSetReached(s);
59 while (!bfs.finished()) {
61 if (g.valid(bfs) && bfs.isBNodeNewlyReached())
62 pred.set(bfs.bNode(), bfs);
64 std::cout << ts << std::endl;