Changeset 71:1d8d806ac8e0 in lemon-0.x
- Timestamp:
- 02/12/04 19:11:08 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@87
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/read_dimacs_demo.cc
r69 r71 1 #include <sys/time.h> 1 2 #include <iostream> 2 3 #include <fstream> 4 3 5 #include <list_graph.hh> 4 6 #include <dimacs.hh> … … 6 8 7 9 using namespace marci; 10 11 double currTime() { 12 timeval tv; 13 //timezone tz; 14 gettimeofday(&tv, 0); 15 return double(tv.tv_sec)+double(tv.tv_usec)/1000000.0; 16 } 8 17 9 18 // Use a DIMACS max flow file as stdin. … … 20 29 std::cout << "augmenting path flow algorithm demo..." << std::endl; 21 30 ListGraph::EdgeMap<int> flow(G); //0 flow 31 32 double preTime=currTime(); 22 33 MaxFlow<ListGraph, int, ListGraph::EdgeMap<int>, ListGraph::EdgeMap<int> > max_flow_test(G, s, t, flow, cap); 23 34 max_flow_test.run(); 24 35 double pushTime=currTime(); 25 36 std::cout << "maximum flow: "<< std::endl; 26 37 for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) { … … 28 39 } 29 40 std::cout<<std::endl; 41 std::cout << "elapsed time: " << pushTime-preTime << " sec"<< std::endl; 30 42 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 31 43
Note: See TracChangeset
for help on using the changeset viewer.