- yee
將原先的點分為兩個,並且中間加上一條邊表示原先的,這樣新生成的就可以不含並維持原先的。
- xian
Show the execution of the Edmonds-Karp algorithm on the flow network of Figure26.1(a).
BFS第一輪 , min capacity = 12, max flow = 12
BFS第二輪 , min capacity = 4, max flow = 12 + 4
BFS第三輪 , min capacity = 7, max flow = 16 + 7
最後答案 maxflow = 23
- chung
The edge connectivity of an undirected graph is the minimum number k of edges that must be removed to disconnect the graph. For example, the edge connectivity of a tree is 1, and the edge connectivity of a cyclic chain of vertices is 2. Show how to determine the edge connectivity of an undirected graph G = (V, E) by running a maximum-flow algorithm on at most |V| flow networks, each having O(V) vertices and O(E) edges.
Edge Connectivity定義:給一個graph,至少要去掉多少條邊才能使得該圖變為非連通圖
因此在flow networks上做次的maximum-flow algorithm 即可求出Edge Connectivity
Ford – Fulkerson algorithm
求 min(max flow) At
Time Complexity = O(EV) * (V – 1) = O(EV^2)
- songchiu
Suppose that you wish to find, among all minimum cuts in a flow network G with integral capacities, one that contains the smallest number of edges. Show how to modify the capacities of G to create a new flow network G’ in which any minimum cut in G’ is a minimum cut with the smallest number of edges in G
令和為和中的兩個
令、分別為、的
給定 (其中為頂點,為很小的正值)
此時來挑,令
對任意,
令,證明
由於這個值比起原圖中的還要大
因此可以知道,要加一個很小的常數,才有辦法解決掉這件事情
讓新圖的有
- null
It's a min cut problem with all edge has 1 as max flow.
- LXS
There are two extended ways used to find the augmenting path that we have
mentioned in class (refers to slides p.14, Unit 10), please design an efficient algorithm with the argument of second method to find the augmenting path. Argue that your algorithm is correct and also analyze the time-complexity.
We can implement this by using a priority queue and slightly modifying our implementation of Dijkstra’s shortest-paths algorithm, choosing edges from the priority queue to give the maximum amount of flow that can be pushed through a forward edge or diverted from a backward edge.
Residual Networks中,每個有向邊可是視為「可以重新配置水流的方向」。
此時找使 flow 增加最大之 Augmenting Paths,相當於找到從Source到Sink的最長路徑 P 長度為 = ,並使用類似Prim的方式找到最大flow。
由於每次都從⽬前最⼤Flow的路徑繼續往下找,若該條路徑不再是最⼤的Flow,那再下⼀輪挑⽬前最⼤的點的時候,就不會是該點,因此能確保正確性。
- xian
Suppose that you are given a flow network G, and G has edges entering the source s. Let f be a flow in G in which one of the edges (v, s) entering the source has f(v, s) = 1. Prove that there must exist another flow f' with f'(v, s) = 0 such that |f|=|f'|. Give an O(E)-time algorithm to compute f', given f , and assuming that all edge capacities are integers.
【分析】
因為s是源頭,所以代表如果f(v,s)存在,則代表G有一個會經過s到v在回到s的迴圈,且因為f(v,s) = 1,所以代表此迴圈上每個edge皆為整數,所以如果把flow都減1,也不會有負數的問題。
而我們知道迴圈在flow裡面就只是原地繞圈,所以如果把迴圈移除的話,|f|也依舊不變,因為他們的差值並沒有改變,所以如果我們把迴圈上的所有邊的值減一,則f'(v,s) = f(v,s) - 1 = 0,因此我們的目的就是要找到迴圈,迴圈即為所要之解答。
【演算法】
1.邊跑 DFS 看有沒有遇到 source,走到底沒有遇到則 pop 該點
2.如果找到迴圈,則將 stack 中的點的邊減 1
3.更改完的 f 即為 f'
複雜度:
DFS最多將全部的邊走完,,所以