maxflow path

http://unbelievable.ycool.com/post.1058899.html

网络流 输出路径
虽然可以在 change 段 保存 不过要注意处理反向边...所以还是很麻烦的... 所以还是求完流之后... 再递归求

为此 偶 Sgu 185 wa 了n*n 遍啊... 估计这一辈子都忘不掉了....

procedure out(k : smallint);
var i : smallint;
begin
  write(k,' ');
  for i:=1 to n do
    if f[k,i]>0 then begin
      out(i);
      dec(f[k,i]);  //这里减的是这条.. 路径上的流量(所有边中的最小流量)
      break;
    end;
end;



 

posted @ 2008-12-05 15:36  jesonpeng  阅读(168)  评论(0)    收藏  举报