src/work/alpar/f_ed_ka_demo.cc
changeset 1365 c280de819a73
parent 1364 ee5959aa4410
child 1366 d00b85f8be45
     1.1 --- a/src/work/alpar/f_ed_ka_demo.cc	Sun Apr 17 18:57:22 2005 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,51 +0,0 @@
     1.4 -#include <iostream>
     1.5 -#include <fstream>
     1.6 -
     1.7 -#include "smart_graph.h"
     1.8 -
     1.9 -#include "../list_graph.hh"
    1.10 -#include "../marci/dimacs.hh"
    1.11 -#include "f_ed_ka.h"
    1.12 -#include "../marci/time_measure.h"
    1.13 -
    1.14 -using namespace lemon;
    1.15 -
    1.16 -// Use a DIMACS max flow file as stdin.
    1.17 -// read_dimacs_demo < dimacs_max_flow_file
    1.18 -
    1.19 -int main(int, char **) {
    1.20 -  typedef SmartGraph Graph;
    1.21 -  //typedef ListGraph Graph;
    1.22 -
    1.23 -  typedef Graph::NodeIt NodeIt;
    1.24 -  typedef Graph::EachNodeIt EachNodeIt;
    1.25 -  typedef Graph::EachEdgeIt EachEdgeIt;
    1.26 -
    1.27 -  Graph G;
    1.28 -  NodeIt s, t;
    1.29 -  Timer ts;
    1.30 -  Graph::DynEdgeMap<int> cap(G);
    1.31 -  readDimacsMaxFlow(std::cin, G, s, t, cap);
    1.32 -
    1.33 -  std::cout << "loading time: " << ts << std::endl;
    1.34 -  ts.reset();
    1.35 -  std::cout << "edmonds karp demo..." << std::endl;
    1.36 -  Graph::DynEdgeMap<int> flow(G); //0 flow
    1.37 -  
    1.38 -  int ret;
    1.39 -  //  double pre_time=currTime();
    1.40 -  
    1.41 -  ret = maxFlow(G,flow,cap,s,t);
    1.42 -  //  double post_time=currTime();
    1.43 -  std::cout << "running time: " << ts << std::endl;
    1.44 -
    1.45 -  //std::cout << "maximum flow: "<< std::endl;
    1.46 -  //for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) { 
    1.47 -  //  std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
    1.48 -  //}
    1.49 -  //std::cout<<std::endl;
    1.50 -  //  std::cout<<"elapsed time: " << post_time-pre_time << " sec"<< std::endl; 
    1.51 -  std::cout << "flow value: "<< ret << std::endl;
    1.52 -
    1.53 -  return 0;
    1.54 -}