COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/work/marci/preflow_demo_leda.cc @ 148:004fdf703abb

Last change on this file since 148:004fdf703abb was 73:1b4a25e49222, checked in by marci, 21 years ago

.

File size: 775 bytes
Line 
1#include <iostream.h>
2#include <fstream.h>
3
4#include <LEDA/graph.h>
5#include <LEDA/graph_alg.h>
6#include <LEDA/dimacs.h>
7
8#include <time_measure.h>
9
10// Use a DIMACS max flow file as stdin.
11// read_dimacs_demo_leda < dimacs_max_flow_file
12int main()
13{
14  GRAPH<int,int> G;
15  leda_node s,t;
16  leda_edge_array<int> cap;
17  Read_Dimacs_Maxflow(cin,G,cap,s,t);
18 
19  leda_edge_array<int> flow(G);
20
21  std::cout << "preflow demo (LEDA)..." << std::endl;
22  double pre_time=currTime();
23  int flow_value = MAX_FLOW(G,s,t,cap,flow);
24  double post_time=currTime();
25  //std::cout << "maximum flow: "<< std::endl;
26  //std::cout<<std::endl;
27  std::cout << "elapsed time: " << post_time-pre_time << " sec"<< std::endl;
28  std::cout << "flow value: "<< flow_value << std::endl;
29
30  return 0;
31}
32
33
Note: See TracBrowser for help on using the repository browser.