alpar@222: #include alpar@222: #include alpar@222: alpar@222: #include alpar@222: #include alpar@222: #include alpar@222: #include alpar@222: #include alpar@222: klao@258: #include alpar@222: #include alpar@222: alpar@222: using namespace hugo; alpar@222: alpar@222: int main(int, char **) { alpar@222: typedef SmartGraph::Node Node; alpar@222: typedef SmartGraph::NodeIt NodeIt; alpar@222: typedef SmartGraph::InEdgeIt InEdgeIt; alpar@222: alpar@222: SmartGraph G; alpar@222: Node s, t; alpar@222: SmartGraph::EdgeMap cap(G); alpar@222: Timer tim; alpar@222: std::cout << "DIMACS load ..." << std::endl; alpar@222: readDimacsMaxFlow(std::cin, G, s, t, cap); alpar@222: std::cout << " " << tim <, alpar@247: // FibHeap > alpar@247: // > dijkstra_test(G, cap); alpar@247: alpar@247: Dijkstra , FibHeap > alpar@247: dijkstra_test(G, cap); alpar@222: alpar@222: dijkstra_test.run(s); alpar@222: //double post_time=currTime(); alpar@222: alpar@222: std::cout << "running time with fib_heap: " alpar@222: // << post_time-pre_time << " sec" alpar@222: << tim alpar@222: << std::endl; alpar@222: alpar@222: //pre_time=currTime(); alpar@222: tim.reset(); alpar@247: // Dijkstra < SmartGraph, alpar@247: // SmartGraph::EdgeMap, alpar@247: // BinHeap > > alpar@247: // dijkstra_test2(G, cap); alpar@247: alpar@247: Dijkstra , BinHeap > alpar@247: dijkstra_test2(G, cap); alpar@222: alpar@222: dijkstra_test2.run(s); alpar@222: //post_time=currTime(); alpar@222: alpar@222: std::cout << "running time with bin_heap: " alpar@222: // << post_time-pre_time << " sec" alpar@222: << tim alpar@222: << std::endl; alpar@222: alpar@222: alpar@222: int hiba_fib=0; alpar@222: int hiba_bin=0; alpar@222: NodeIt u; alpar@222: for ( G.first(u) ; G.valid(u); G.next(u) ) { alpar@222: InEdgeIt e; alpar@222: for ( G.first(e,u); G.valid(e); G.next(e) ) { alpar@222: Node v=G.tail(e); alpar@222: if ( dijkstra_test.dist(u) - dijkstra_test.dist(v) > cap[e] ) alpar@222: { alpar@222: std::cout<<"Hibas el a fibonaccis Dijkstraban: " alpar@222: << dijkstra_test.dist(u) - dijkstra_test.dist(v) - alpar@222: cap[e]< cap[e] ) alpar@222: { alpar@222: std::cout<<"Hibas el a binarisos Dijkstraban: " alpar@222: << dijkstra_test2.dist(u) - dijkstra_test2.dist(v) - alpar@222: cap[e]<