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