src/hugo/minlengthpaths.h
changeset 784 a48964a87141
parent 759 2d2d41010cb9
child 788 c3187cafcabf
equal deleted inserted replaced
2:bbdbcb12c543 3:066ca50c1077
    81 
    81 
    82       //We don't want to change the flow of mincost_flow, so we make a copy
    82       //We don't want to change the flow of mincost_flow, so we make a copy
    83       //The name here suggests that the flow has only 0/1 values.
    83       //The name here suggests that the flow has only 0/1 values.
    84       EdgeIntMap reversed(G); 
    84       EdgeIntMap reversed(G); 
    85 
    85 
    86       FOR_EACH_LOC(typename Graph::EdgeIt, e, G){
    86       //FOR_EACH_LOC(typename Graph::EdgeIt, e, G){
       
    87       for(typename Graph::EdgeIt e=loopFirst(typename Graph::EdgeIt(), (G)); e!=INVALID; ++e){
    87 	reversed[e] = mincost_flow.getFlow()[e];
    88 	reversed[e] = mincost_flow.getFlow()[e];
    88       }
    89       }
    89       
    90       
    90       paths.clear();
    91       paths.clear();
    91       //total_length=0;
    92       //total_length=0;
    98 
    99 
    99 
   100 
   100 	  G.first(e,n);
   101 	  G.first(e,n);
   101 	  
   102 	  
   102 	  while (!reversed[e]){
   103 	  while (!reversed[e]){
   103 	    G.next(e);
   104 	    ++e;
   104 	  }
   105 	  }
   105 	  n = G.head(e);
   106 	  n = G.head(e);
   106 	  paths[j].push_back(e);
   107 	  paths[j].push_back(e);
   107 	  //total_length += length[e];
   108 	  //total_length += length[e];
   108 	  reversed[e] = 1-reversed[e];
   109 	  reversed[e] = 1-reversed[e];