klao@125: #include <iostream>
klao@125: #include <fstream>
klao@125: 
klao@125: #include <LEDA/graph.h>
klao@125: #include <LEDA/graph_alg.h>
klao@125: #include <LEDA/dimacs.h>
klao@125: 
klao@125: #if defined(LEDA_NAMESPACE)
klao@125: using namespace leda;
klao@125: #endif
klao@125: 
klao@125: using namespace std;
klao@125: 
klao@125: #include <time_measure.h>
klao@125: 
klao@125: // Use a DIMACS max flow file as stdin.
klao@125: // read_dimacs_demo_leda < dimacs_max_flow_file
klao@125: int main() 
klao@125: {
klao@125:   GRAPH<int,int> G;
klao@125:   leda_node s,t;
klao@125:   leda_edge_array<int> cap;
klao@125:   Read_Dimacs_MF(cin,G,s,t,cap);
klao@125:  
klao@125:   leda_edge_array<int> flow(G);
klao@125: 
klao@125:   std::cout << "preflow demo (LEDA)..." << std::endl;
klao@125:   double pre_time=currTime();
klao@125:   int flow_value = MAX_FLOW(G,s,t,cap,flow); 
klao@125:   double post_time=currTime();
klao@125:   //std::cout << "maximum flow: "<< std::endl;
klao@125:   //std::cout<<std::endl;
klao@125:   std::cout << "elapsed time: " << post_time-pre_time << " sec"<< std::endl; 
klao@125:   std::cout << "flow value: "<< flow_value << std::endl;
klao@125: 
klao@125:   return 0;
klao@125: }