/**
* Helper method to continually execute iterations of the algorithm
* until it is finished. */
protected final void runUntil() {
while (shouldContinue()) {
doOneIteration();
}
}
/**
* Execute the algorithm, which will compute the maximum flow
* between source and dest in the Graph g.
*
* @param g a Graph
* @param source of the flow
* @param dest for the flow */
public final void execute(InspectableGraph g, Vertex source, Vertex dest)
throws InvalidVertexException {
init(g, source, dest);
runUntil();
}
/**
* Execute the algorithm, which will execute until the target flow
* is reached, or no more flow is possible.
*
* @param g a Graph
* @param source of the flow
* @param dest for the flow */
public final void execute(InspectableGraph g, Vertex source, Vertex dest,
int target)
throws InvalidVertexException {
targetFlow_ = target;
execute(g, source, dest);
}