Commit 11ef2b1d authored by sshwy's avatar sshwy
Browse files

flow

parent 539d6d81
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -454,9 +454,7 @@ $$

#### BFS 优化

HLPP 的上界为 $O(n^2\sqrt m)$ ,但在使用时卡得比较紧;我们可以在初始化高度的时候进行优化:

具体来说,我们初始化 $h(u)$ 为 $u$ 到 $t$ 的最短距离;特别地, $h(s)=n$ 。
HLPP 的上界为 $O(n^2\sqrt m)$ ,但在使用时卡得比较紧;我们可以在初始化高度的时候进行优化。具体来说,我们初始化 $h(u)$ 为 $u$ 到 $t$ 的最短距离;特别地, $h(s)=n$ 。

在 BFS 的同时我们顺便检查图的连通性,排除无解的情况。