1.1 --- a/src/work/marci/max_flow_1.cc Sun Apr 17 18:57:22 2005 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,60 +0,0 @@
1.4 -// -*- c++ -*-
1.5 -#include <iostream>
1.6 -#include <fstream>
1.7 -
1.8 -#include <sage_graph.h>
1.9 -#include <lemon/smart_graph.h>
1.10 -#include <lemon/dimacs.h>
1.11 -#include <lemon/time_measure.h>
1.12 -//#include <graph_wrapper.h>
1.13 -#include <lemon/max_flow.h>
1.14 -//#include <preflow_res.h>
1.15 -#include <for_each_macros.h>
1.16 -
1.17 -using namespace lemon;
1.18 -
1.19 -// Use a DIMACS max flow file as stdin.
1.20 -// read_dimacs_demo < dimacs_max_flow_file
1.21 -
1.22 -
1.23 -int main(int, char **) {
1.24 -
1.25 - typedef SageGraph MutableGraph;
1.26 -
1.27 - typedef SmartGraph Graph;
1.28 - // typedef ListGraph Graph;
1.29 - typedef Graph::Node Node;
1.30 - typedef Graph::EdgeIt EdgeIt;
1.31 -
1.32 -
1.33 - Graph g;
1.34 - Node s, t;
1.35 - Graph::EdgeMap<int> cap(g);
1.36 - //readDimacsMaxFlow(std::cin, g, s, t, cap);
1.37 - readDimacs(std::cin, g, cap, s, t);
1.38 - Timer ts;
1.39 - Graph::EdgeMap<int> flow(g); //0 flow
1.40 - MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
1.41 - max_flow_test(g, s, t, cap, flow);
1.42 -
1.43 - {
1.44 - std::cout << "preflow ..." << std::endl;
1.45 - FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
1.46 - ts.reset();
1.47 - max_flow_test.preflowPhase1(MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >::ZERO_FLOW);
1.48 - std::cout << "elapsed time: " << ts << std::endl;
1.49 - std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
1.50 - }
1.51 -
1.52 - {
1.53 - std::cout << "preflow ..." << std::endl;
1.54 - FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
1.55 - ts.reset();
1.56 - max_flow_test.preflowPhase1(MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >::ZERO_FLOW);
1.57 - std::cout << "elapsed time: " << ts << std::endl;
1.58 - std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
1.59 - }
1.60 -
1.61 -
1.62 - return 0;
1.63 -}