5 //#include <sage_graph.h>
 
     6 #include <lemon/smart_graph.h>
 
     7 #include <lemon/list_graph.h>
 
     8 #include <lemon/dimacs.h>
 
     9 #include <lemon/time_measure.h>
 
    10 //#include <lemon/for_each_macros.h>
 
    12 #include <lemon/bfs.h>
 
    14 using namespace lemon;
 
    20   //  typedef SageGraph Graph; 
 
    21   typedef SmartGraph Graph ;
 
    22   //typedef ListGraph Graph; 
 
    23   typedef Graph::Node Node;
 
    24   typedef Graph::NodeIt NodeIt;
 
    25   typedef Graph::Edge Edge;
 
    26   typedef Graph::EdgeIt EdgeIt;
 
    27   typedef Graph::OutEdgeIt OutEdgeIt;
 
    30   readDimacs(std::cin, g);
 
    33   cout << g.nodeNum() << endl;
 
    34   cout << g.edgeNum() << endl;
 
    36   Graph::NodeMap<Edge> pred(g);
 
    37   cout << "iteration time of bfs written by hand..." << endl;
 
    40   for (int i=0; i<100; ++i)
 
    42     Graph::NodeMap<bool> reached(g);
 
    45     std::queue<Node> bfs_queue;
 
    47     while (!bfs_queue.empty()) {
 
    48       Node v=bfs_queue.front();	
 
    50       for(OutEdgeIt e(g,v); e!=INVALID; ++e) {
 
    60   std::cout << ts << std::endl;
 
    62   cout << "iteration time with bfs iterator..." << endl;
 
    64   for (int i=0; i<100; ++i)
 
    66     Graph::NodeMap<bool> reached(g);
 
    67     marci::BfsIterator< Graph, Graph::NodeMap<bool> > bfs(g, reached);
 
    68     bfs.pushAndSetReached(s);
 
    70     while (!bfs.finished()) { 
 
    72       if (Graph::Edge(bfs)!=INVALID && bfs.isBNodeNewlyReached()) 
 
    73 	pred.set(bfs.target(), Graph::Edge(bfs));
 
    76   std::cout << ts << std::endl;
 
    78   cout << "iteration time with bfs aplar..." << endl;
 
    80   for (int i=0; i<100; ++i)
 
    86   std::cout << ts << std::endl;