G为连通有向图,f是u-->v路径上已有的流量,Gf为残留网络
伪代码如下:
1 for each edge(u,v)属于E(G)
2 do f[u,v]=0
3 f[v,u]=0
4 while there exists a path p from s to t in the residual network Gf
5 do cf(p)=min{cf(u,v):(u,v)is in p}
6 for each edge (u,v) in p
7 do f[u,v]=f[u,v]+cf(p)
8 f[v,u]=-f[u,v]
比较疑惑第8行是什么作用?在代码中我尝试去掉这句话,结果显示也不错啊?