equal
deleted
inserted
replaced
342 |
342 |
343 status=AFTER_PRE_FLOW_PHASE_2; |
343 status=AFTER_PRE_FLOW_PHASE_2; |
344 } |
344 } |
345 |
345 |
346 |
346 |
347 /// Returns the maximum value of a flow. |
347 /// Returns the value of the maximum flow. |
348 |
348 |
349 /// Returns the maximum value of a flow, by counting the |
349 /// Returns the excess of the target node \ref t. |
350 /// over-flow of the target node \ref t. |
350 /// After running \ref preflowPhase1, this is the value of |
|
351 /// the maximum flow. |
351 /// It can be called already after running \ref preflowPhase1. |
352 /// It can be called already after running \ref preflowPhase1. |
352 Num flowValue() const { |
353 Num flowValue() const { |
353 Num a=0; |
354 // Num a=0; |
354 for(InEdgeIt e(*g,t);g->valid(e);g->next(e)) a+=(*flow)[e]; |
355 // for(InEdgeIt e(*g,t);g->valid(e);g->next(e)) a+=(*flow)[e]; |
355 for(OutEdgeIt e(*g,t);g->valid(e);g->next(e)) a-=(*flow)[e]; |
356 // for(OutEdgeIt e(*g,t);g->valid(e);g->next(e)) a-=(*flow)[e]; |
356 return a; |
357 // return a; |
|
358 return excess[t]; |
357 //marci figyu: excess[t] epp ezt adja preflow 1. fazisa utan |
359 //marci figyu: excess[t] epp ezt adja preflow 1. fazisa utan |
358 } |
360 } |
359 |
361 |
360 |
362 |
361 ///Returns a minimum value cut after calling \ref preflowPhase1. |
363 ///Returns a minimum value cut after calling \ref preflowPhase1. |