diff -r ee5959aa4410 -r c280de819a73 src/work/athos/bfs_test.cc --- a/src/work/athos/bfs_test.cc Sun Apr 17 18:57:22 2005 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -// -*- c++ -*- -#include -#include - -#include -//#include -#include -#include -#include -#include - -using namespace lemon; - -int main() { - typedef SageGraph Graph; - typedef Graph::Node Node; - typedef Graph::NodeIt NodeIt; - typedef Graph::Edge Edge; - typedef Graph::EdgeIt EdgeIt; - typedef Graph::OutEdgeIt OutEdgeIt; - - Graph g; - Node s, t; - Graph::EdgeMap cap(g); - //readDimacsMaxFlow(std::cin, g, s, t, cap); - readDimacs(std::cin, g); - - Graph::NodeMap pred(g); - - Timer ts; - /* - { - ts.reset(); - Graph::NodeMap reached(g); - reached.set(s, true); - pred.set(s, INVALID); - std::queue bfs_queue; - bfs_queue.push(t); - while (!bfs_queue.empty()) { - Node v=bfs_queue.front(); - bfs_queue.pop(); - OutEdgeIt e; - for(g.first(e,v); g.valid(e); g.next(e)) { - Node w=g.target(e); - if (!reached[w]) { - bfs_queue.push(w); - reached.set(w, true); - pred.set(w, e); - } - } - } - - std::cout << ts << std::endl; - } - */ - - { - ts.reset(); - Graph::NodeMap bfs_reached(g); - Graph::NodeMap bfs_pred(g); - Graph::NodeMap bfs_dist(g); - - Bfs< Graph, Graph::NodeMap, - Graph::NodeMap, Graph::NodeMap > - bfs(g,bfs_reached, bfs_pred, bfs_dist ); - bfs.run(s); - /* - pred.set(s, INVALID); - while (!bfs.finished()) { - ++bfs; - if (g.valid(bfs) && bfs.isBNodeNewlyReached()) - pred.set(bfs.bNode(), bfs); - } - */ - std::cout << ts << std::endl; - } - - return 0; -}