src/work/jacint/preflow.cc
changeset 986 e997802b855c
parent 921 818510fa3d99
     1.1 --- a/src/work/jacint/preflow.cc	Sat Nov 13 12:24:01 2004 +0000
     1.2 +++ b/src/work/jacint/preflow.cc	Sat Nov 13 12:53:28 2004 +0000
     1.3 @@ -46,9 +46,9 @@
     1.4    EdgeIt e;
     1.5    for(G.first(e); G.valid(e); G.next(e)) {
     1.6      int c=cap[e];
     1.7 -    if (mincut[G.tail(e)] && !mincut[G.head(e)]) min_min_cut_value+=c;
     1.8 -    if (cut[G.tail(e)] && !cut[G.head(e)]) min_cut_value+=c; 
     1.9 -    if (maxcut[G.tail(e)] && !maxcut[G.head(e)]) max_min_cut_value+=c;
    1.10 +    if (mincut[G.source(e)] && !mincut[G.target(e)]) min_min_cut_value+=c;
    1.11 +    if (cut[G.source(e)] && !cut[G.target(e)]) min_cut_value+=c; 
    1.12 +    if (maxcut[G.source(e)] && !maxcut[G.target(e)]) max_min_cut_value+=c;
    1.13    }
    1.14  
    1.15    std::cout << "\nChecking the result: " <<std::endl;  
    1.16 @@ -86,9 +86,9 @@
    1.17    int max_min_cut2_value=0;
    1.18    for(G.first(e); G.valid(e); G.next(e)) {
    1.19      int c=cap[e];
    1.20 -    if (mincut2[G.tail(e)] && !mincut2[G.head(e)]) min_min_cut2_value+=c;
    1.21 -    if (cut2[G.tail(e)] && !cut2[G.head(e)]) min_cut2_value+=c; 
    1.22 -    if (maxcut2[G.tail(e)] && !maxcut2[G.head(e)]) max_min_cut2_value+=c;
    1.23 +    if (mincut2[G.source(e)] && !mincut2[G.target(e)]) min_min_cut2_value+=c;
    1.24 +    if (cut2[G.source(e)] && !cut2[G.target(e)]) min_cut2_value+=c; 
    1.25 +    if (maxcut2[G.source(e)] && !maxcut2[G.target(e)]) max_min_cut2_value+=c;
    1.26    }
    1.27  
    1.28    std::cout << "\nThe given flow value is "
    1.29 @@ -138,10 +138,10 @@
    1.30    
    1.31    for(G.first(e); G.valid(e); G.next(e)) {
    1.32      int c=cap[e];
    1.33 -    if (mincut3[G.tail(e)] && !mincut3[G.head(e)]) min_min_cut3_value+=c;
    1.34 -    if (cut3[G.tail(e)] && !cut3[G.head(e)]) min_cut3_value+=c; 
    1.35 -    if (maxcut3[G.tail(e)] && !maxcut3[G.head(e)]) max_min_cut3_value+=c;
    1.36 -    if (actcut3[G.tail(e)] && !actcut3[G.head(e)]) act_min_cut3_value+=c;
    1.37 +    if (mincut3[G.source(e)] && !mincut3[G.target(e)]) min_min_cut3_value+=c;
    1.38 +    if (cut3[G.source(e)] && !cut3[G.target(e)]) min_cut3_value+=c; 
    1.39 +    if (maxcut3[G.source(e)] && !maxcut3[G.target(e)]) max_min_cut3_value+=c;
    1.40 +    if (actcut3[G.source(e)] && !actcut3[G.target(e)]) act_min_cut3_value+=c;
    1.41    }
    1.42  
    1.43   std::cout << "\nThe min cut value given by actMinCut() after phase 0 is "<<
    1.44 @@ -195,9 +195,9 @@
    1.45    int max_min_cut4_value=0;
    1.46    for(G.first(e); G.valid(e); G.next(e)) {
    1.47      int c=cap[e];
    1.48 -    if (mincut4[G.tail(e)] && !mincut4[G.head(e)]) min_min_cut4_value+=c;
    1.49 -    if (cut4[G.tail(e)] && !cut4[G.head(e)]) min_cut4_value+=c; 
    1.50 -    if (maxcut4[G.tail(e)] && !maxcut4[G.head(e)]) max_min_cut4_value+=c;
    1.51 +    if (mincut4[G.source(e)] && !mincut4[G.target(e)]) min_min_cut4_value+=c;
    1.52 +    if (cut4[G.source(e)] && !cut4[G.target(e)]) min_cut4_value+=c; 
    1.53 +    if (maxcut4[G.source(e)] && !maxcut4[G.target(e)]) max_min_cut4_value+=c;
    1.54    }
    1.55  
    1.56    std::cout << "\nThe given flow value is "
    1.57 @@ -238,9 +238,9 @@
    1.58    int max_min_cut5_value=0;
    1.59    for(G.first(e); G.valid(e); G.next(e)) {
    1.60      int c=cap[e];
    1.61 -    if (mincut5[G.tail(e)] && !mincut5[G.head(e)]) min_min_cut5_value+=c;
    1.62 -    if (cut5[G.tail(e)] && !cut5[G.head(e)]) min_cut5_value+=c; 
    1.63 -    if (maxcut5[G.tail(e)] && !maxcut5[G.head(e)]) max_min_cut5_value+=c;
    1.64 +    if (mincut5[G.source(e)] && !mincut5[G.target(e)]) min_min_cut5_value+=c;
    1.65 +    if (cut5[G.source(e)] && !cut5[G.target(e)]) min_cut5_value+=c; 
    1.66 +    if (maxcut5[G.source(e)] && !maxcut5[G.target(e)]) max_min_cut5_value+=c;
    1.67    }
    1.68  
    1.69    std::cout << "\nThe given flow value is "