src/work/jacint/prim.cc
changeset 1365 c280de819a73
parent 1364 ee5959aa4410
child 1366 d00b85f8be45
     1.1 --- a/src/work/jacint/prim.cc	Sun Apr 17 18:57:22 2005 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,50 +0,0 @@
     1.4 -#include <iostream>
     1.5 -#include <fstream>
     1.6 -
     1.7 -#include <smart_graph.h>
     1.8 -#include <list_graph.h>
     1.9 -#include <dimacs.h>
    1.10 -#include <prim.h>
    1.11 -#include <time_measure.h>
    1.12 -
    1.13 -#include <bin_heap.h>
    1.14 -#include <fib_heap.h>
    1.15 -
    1.16 -using namespace lemon;
    1.17 -
    1.18 -int main(int, char **) {
    1.19 -  typedef SmartGraph::Node Node;
    1.20 -
    1.21 -  SmartGraph G;
    1.22 -  Node s, t;
    1.23 -  SmartGraph::EdgeMap<int> cap(G);
    1.24 -  readDimacsMaxFlow(std::cin, G, s, t, cap);
    1.25 -
    1.26 -  std::cout << "prim demo ..." << std::endl;
    1.27 -  
    1.28 -  double pre_time=currTime();
    1.29 -    Prim<SmartGraph, int, FibHeap<SmartGraph::Node, int, 
    1.30 -    SmartGraph::NodeMap<int> > > prim_test(G, cap);
    1.31 -    prim_test.run();
    1.32 -  double post_time=currTime();
    1.33 -    
    1.34 -  std::cout << "running time with fib_heap: " 
    1.35 -	    << post_time-pre_time << " sec"<< std::endl; 
    1.36 - 
    1.37 -  pre_time=currTime();
    1.38 -  Prim<SmartGraph, int, BinHeap<SmartGraph::Node, int, 
    1.39 -    SmartGraph::NodeMap<int> > > prim_test2(G, cap);
    1.40 -  prim_test2.run();
    1.41 -  post_time=currTime();
    1.42 -  
    1.43 -  std::cout << "running time with bin_heap: " 
    1.44 -	    << post_time-pre_time << " sec"<< std::endl; 
    1.45 -  
    1.46 -  std::cout<<"A minimalis feszitofa sulya fib kupaccal: "<< prim_test.weight() <<std::endl;
    1.47 -  std::cout<<"A minimalis feszitofa sulya bin kupaccal: "<< prim_test2.weight() <<std::endl;
    1.48 -  if ( prim_test.weight() != prim_test2.weight() ) 
    1.49 -    std::cout<<"Nem egyezik meg!"<<std::endl; 
    1.50 -  else std::cout<<"Megegyezik."<<std::endl; 
    1.51 -
    1.52 -  return 0;
    1.53 -}