src/work/marci/preflow_demo_leda_uj.cc
author deba
Wed, 08 Sep 2004 12:06:45 +0000 (2004-09-08)
changeset 822 88226d9fe821
permissions -rw-r--r--
The MapFactories have been removed from the code because
if we use macros then they increases only the complexity.

The pair iterators of the maps are separeted from the maps.

Some macros and comments has been changed.
     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 }