src/work/marci/preflow_demo_leda_uj.cc
changeset 626 0015642b0990
equal deleted inserted replaced
-1:000000000000 0:1214283f90fa
       
     1 #include <iostream>
       
     2 #include <fstream>
       
     3 
       
     4 #include <LEDA/graph.h>
       
     5 #include <LEDA/graph_alg.h>
       
     6 #include <LEDA/dimacs.h>
       
     7 
       
     8 #if defined(LEDA_NAMESPACE)
       
     9 using namespace leda;
       
    10 #endif
       
    11 
       
    12 using namespace std;
       
    13 
       
    14 #include <time_measure.h>
       
    15 
       
    16 // Use a DIMACS max flow file as stdin.
       
    17 // read_dimacs_demo_leda < dimacs_max_flow_file
       
    18 int main() 
       
    19 {
       
    20   GRAPH<int,int> G;
       
    21   leda_node s,t;
       
    22   leda_edge_array<int> cap;
       
    23   Read_Dimacs_MF(cin,G,s,t,cap);
       
    24  
       
    25   leda_edge_array<int> flow(G);
       
    26 
       
    27   std::cout << "preflow demo (LEDA)..." << std::endl;
       
    28   double pre_time=currTime();
       
    29   int flow_value = MAX_FLOW(G,s,t,cap,flow); 
       
    30   double post_time=currTime();
       
    31   //std::cout << "maximum flow: "<< std::endl;
       
    32   //std::cout<<std::endl;
       
    33   std::cout << "elapsed time: " << post_time-pre_time << " sec"<< std::endl; 
       
    34   std::cout << "flow value: "<< flow_value << std::endl;
       
    35 
       
    36   return 0;
       
    37 }