M?g ?rtam bele 2 dolgot, meg a tesztelot is kibovitettem.
4 #include <list_graph.hh>
7 #include <time_measure.h>
14 int main(int, char **) {
15 typedef ListGraph::NodeIt NodeIt;
19 ListGraph::EdgeMap<int> cap(G);
20 readDimacsMaxFlow(std::cin, G, s, t, cap);
22 std::cout << "prim demo ..." << std::endl;
24 double pre_time=currTime();
25 Prim<ListGraph, int, FibHeap<ListGraph::NodeIt, int,
26 ListGraph::NodeMap<int> > > prim_test(G, cap);
28 double post_time=currTime();
30 std::cout << "running time with fib_heap: "
31 << post_time-pre_time << " sec"<< std::endl;
34 Prim<ListGraph, int, BinHeap<ListGraph::NodeIt, int,
35 ListGraph::NodeMap<int> > > prim_test2(G, cap);
39 std::cout << "running time with bin_heap: "
40 << post_time-pre_time << " sec"<< std::endl;
42 std::cout<<"A minimalis feszitofa sulya fib kupaccal: "<< prim_test.weight() <<std::endl;
43 std::cout<<"A minimalis feszitofa sulya bin kupaccal: "<< prim_test2.weight() <<std::endl;
44 if ( prim_test.weight() != prim_test2.weight() )
45 std::cout<<"Nem egyezik meg!"<<std::endl;
46 else std::cout<<"Megegyezik."<<std::endl;