*** empty log message ***
authorjacint
Sun, 22 Feb 2004 12:17:16 +0000
changeset 113cf7b01232d86
parent 112 0220e23a954c
child 114 bb07dd5b2d67
*** empty log message ***
src/work/jacint/preflow.cc
src/work/jacint/preflow.h
     1.1 --- a/src/work/jacint/preflow.cc	Sun Feb 22 11:45:38 2004 +0000
     1.2 +++ b/src/work/jacint/preflow.cc	Sun Feb 22 12:17:16 2004 +0000
     1.3 @@ -30,8 +30,10 @@
     1.4      if ( mintime > post_time-pre_time ) mintime = post_time-pre_time;
     1.5    }
     1.6  
     1.7 -  preflow<ListGraph, int> max_flow_test(G, s, t, cap);
     1.8 -  
     1.9 +  double pre_time=currTime();
    1.10 +    preflow<ListGraph, int> max_flow_test(G, s, t, cap);
    1.11 +  double post_time=currTime();
    1.12 +    
    1.13    ListGraph::NodeMap<bool> cut(G);
    1.14    max_flow_test.minCut(cut); 
    1.15    int min_cut_value=0;
    1.16 @@ -56,6 +58,10 @@
    1.17        }
    1.18    
    1.19    std::cout << "min time of 10 runs: " << mintime << " sec"<< std::endl; 
    1.20 +  std::cout << "phase 0: " << max_flow_test.time-pre_time 
    1.21 +	    << " sec"<< std::endl; 
    1.22 +  std::cout << "phase 1: " << post_time-max_flow_test.time 
    1.23 +	    << " sec"<< std::endl; 
    1.24    std::cout << "flow value: "<< max_flow_test.maxFlow() << std::endl;
    1.25    std::cout << "min cut value: "<< min_cut_value << std::endl;
    1.26    std::cout << "min min cut value: "<< min_min_cut_value << std::endl;
     2.1 --- a/src/work/jacint/preflow.h	Sun Feb 22 11:45:38 2004 +0000
     2.2 +++ b/src/work/jacint/preflow.h	Sun Feb 22 12:17:16 2004 +0000
     2.3 @@ -8,7 +8,7 @@
     2.4   list 'level_list' on the nodes on level i implemented by hand
     2.5   stack 'active' on the active nodes on level i implemented by hand
     2.6   runs heuristic 'highest label' for H1*n relabels
     2.7 - runs heuristic 'dound decrease' for H0*n relabels, starts with 'highest label'
     2.8 + runs heuristic 'bound decrease' for H0*n relabels, starts with 'highest label'
     2.9   
    2.10  Parameters H0 and H1 are initialized to 20 and 10.
    2.11  
    2.12 @@ -44,6 +44,8 @@
    2.13  #include <vector>
    2.14  #include <queue>
    2.15  
    2.16 +#include <time_measure.h>
    2.17 +
    2.18  namespace hugo {
    2.19  
    2.20    template <typename Graph, typename T, 
    2.21 @@ -65,7 +67,7 @@
    2.22      T value;
    2.23  
    2.24    public:
    2.25 -    
    2.26 +    double time;
    2.27      preflow(Graph& _G, NodeIt _s, NodeIt _t, CapMap& _capacity ) :
    2.28        G(_G), s(_s), t(_t), flow(_G, 0), capacity(_capacity)
    2.29      {
    2.30 @@ -166,7 +168,7 @@
    2.31  	    end=true;
    2.32  	  } else {
    2.33  	    phase=1;
    2.34 -
    2.35 +	    time=currTime();
    2.36  	    level.set(s,0);
    2.37  	    std::queue<NodeIt> bfs_queue;
    2.38  	    bfs_queue.push(s);