COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/work/athos/minlength_demo.cc @ 557:9c0ce0a1f000

Last change on this file since 557:9c0ce0a1f000 was 511:325c9430723e, checked in by athos, 21 years ago

getPath() function implemented.

File size: 1.1 KB
Line 
1#include <iostream>
2#include <fstream>
3
4#include <list_graph.h>
5#include <dimacs.h>
6#include <minlengthpaths.h>
7//#include <time_measure.h>
8
9using namespace hugo;
10
11// Use a DIMACS max flow file as stdin.
12// read_dimacs_demo < dimacs_max_flow_file
13int main(int argc, char ** argv) {
14  typedef ListGraph Graph;
15
16  typedef Graph::Node Node;
17  //typedef Graph::EachEdgeIt EachEdgeIt;
18
19  Graph G;
20  Node s, t;
21  Graph::EdgeMap<int> cap(G);
22  readDimacsMaxFlow(std::cin, G, s, t, cap);
23
24  std::cout << "preflow demo (ATHOS)..." << std::endl;
25  //Graph::EdgeMap<int> flow(G); //0 flow
26
27  //  double pre_time=currTime();
28
29  int k=1;
30  if (argc>1)
31    k = atoi(argv[1]);
32  MinLengthPaths<Graph, Graph::EdgeMap<int> >
33    surb_test(G,cap);
34  std::cout << surb_test.run(s,t,k) << std::endl;
35  std::cout << surb_test.totalLength() << std::endl;
36  //preflow_push<Graph, int> max_flow_test(G, s, t, cap);
37  //int flow_value=max_flow_test.run();
38
39  //double post_time=currTime();
40
41  //std::cout << "elapsed time: " << post_time-pre_time << " sec"<< std::endl;
42  //std::cout << "flow value: "<< flow_value << std::endl;
43
44  return 0;
45}
Note: See TracBrowser for help on using the repository browser.