给定一个随机无向图,我需要找到“瓶颈边”(编辑:最小割边)以从一个顶点到另一个顶点。
我所谓的“瓶颈边”(编辑:最小割边) - 假设我有以下无向图:
A
/ | \
B--C--D
| |
E--F--G
\ | /
H
要独立从A到H,无论选择哪条路径,都必须穿过边BE和DG,因此形成了一个“瓶颈”(编辑:最小割)。
是否有一种多项式时间算法来解决这个问题?
给定一个随机无向图,我需要找到“瓶颈边”(编辑:最小割边)以从一个顶点到另一个顶点。
我所谓的“瓶颈边”(编辑:最小割边) - 假设我有以下无向图:
A
/ | \
B--C--D
| |
E--F--G
\ | /
H
reorganize your graph into a directed graph,
with two directed edges (u->v, v->u) for each original edge (u-v)
while there is a path P from A to H:
(hint: use breadth first search to find paths - long story here)
//augment the path P:
for each edge (u->v) in P:
remove (u->v) from the graph and add (v->u) to it
(if v->u isn't there already)
Label all vertices as reacheable or not reacheable from A.
The bottleneck edges is the set of edges
that connect a reacheable and a unreacheable vertex