src/work/athos/mincostflows.h
changeset 593 b83b36ee7f10
parent 551 d167149bde95
child 607 327f7cf13843
equal deleted inserted replaced
4:e46d3aaf4003 5:67749ccf66d7
   185       return total_length;
   185       return total_length;
   186     }
   186     }
   187 
   187 
   188     //This function checks, whether the given solution is optimal
   188     //This function checks, whether the given solution is optimal
   189     //Running after a \c run() should return with true
   189     //Running after a \c run() should return with true
       
   190     //In this "state of the art" this only check optimality, doesn't bother with feasibility
   190     bool checkSolution(){
   191     bool checkSolution(){
   191       Length mod_pot;
   192       Length mod_pot;
   192       Length fl_e;
   193       Length fl_e;
   193       FOR_EACH_LOC(typename Graph::EdgeIt, e, G){
   194       FOR_EACH_LOC(typename Graph::EdgeIt, e, G){
   194 	//C^{\Pi}_{i,j}
   195 	//C^{\Pi}_{i,j}
   195 	mod_pot = length[e]-potential[G.head(e)]+potential[G.head(e)];
   196 	mod_pot = length[e]-potential[G.head(e)]+potential[G.tail(e)];
   196 	fl_e = flow[e];
   197 	fl_e = flow[e];
       
   198 	//	std::cout << fl_e << std::endl;
   197 	if (0<fl_e && fl_e<capacity[e]){
   199 	if (0<fl_e && fl_e<capacity[e]){
   198 	  if (mod_pot != 0)
   200 	  if (mod_pot != 0)
   199 	    return false;
   201 	    return false;
   200 	}
   202 	}
   201 	else{
   203 	else{