Add option to reuse residual networks in maxflow algorithms