An Optimal Minimum
Spanning Tree Algorithm
Seth Pettie and Vijaya Ramachadran Journal of the ACM Vol. 49, No. 1
Outline
• Preliminary– Cut and Cycle – DJP Algorithm
– MST in Dense Case
• Overview of the Algorithm
• Key Lemma and the Partition Algorithm • Decision Tree
Overview of the Algorithm
• Precompute the optimal decision treesdecision trees for all graphs with ≤ log(3) n vertices
• PartitionPartition the original graph into small subgraphs
– soft heap
• Find the MST of each subgraph
– decision tree
• Use the small MSTs to construct the MST of the original graph
C1 C2 C3 C4 C5 C6 C7
GM
C1 C2 C3 C4 C5 C6 C7
Partition(G,r,
; M,C)
•將問題分成 •Ci 裡面 & Ci 外面 以 DecisionTree 求 MSFGM
以 DenseCase 求 MS F
GM
Partition(G,r,
; M,C)
•將問題分成 •Ci 裡面 & Ci 外面•Boruvka2:
•將 vertex 數降為 1/4
•Gc: m 降為 1/4 •OptimalMSF(Gc)
Key Lemma
• Lemma 3.2 Let M be a set of edges in a graph G. If C is a subgraph of G that is
DJP-contractible w.r.t. GM, then MSF(G) is a subset of MSF(C) MSF(G \ C MC) MC DJP-contractible w.r.t GM 即:在 G 上,使用 SoftHeap , 以 Prim algorithm 長出來的子圖
Mc : corrupted edges with one endpoint in C
• 證法: – 要證明在 (1) 裡的每條 edge , 在 (2) 都會存在 證明在 (2) 中不存在的 edge , 也必不存在 (1) 把 (2) 再拆成兩部分來看 a) In C, if an edge eMSF(C), then eMSF(G) b) In G\C, if an edge eMSF(G\CMC)MC, then eMSF(G) C C M M C G MSF C MSF G MSF( ) ( ) ( \ ) (1 ) (2 ) • 欲證明: G C
• 證明:
– eMSF(C)
e must be the heaviest edge on some cycle in C. (cycle property)
Such a cycle exists in G as well. So eMSF(G)
a) 欲證明:
In C, if an edge eMSF(C), then eMSF(G)
G
• 證明:
– Let H=G\CMC, show that
• no edge in HMSF(H) is in MSF(G)
– Let eHMSF(H)
e is the heaviest edge on some cycle in
H.
1. 若 不包含 C contract 形成的那個點 2. 若 包含 C contract 形成的那個點
( 見下頁 )
目標:證明 e is also the heaviest edge on
a cycle in G eMSF(G) b) 欲證明: In G\C, if an edge eMSF(G\CMC)MC, then eMSF(G) G C
• 證明 ( 續上頁 ) :
2. 若 包含 C contract 形成的那個點
x, y, w, z: nodes
(x,w) and (y,z): end edges of path P
Since H includes no corrupted edges with on point in C, so:
G-weight of these edges = (GM)-weight
T: the spanning tree of CM
Q: the path in T connecting x and y g: the heaviest edge in Q.
w(e) > max(w(x,w), w(y,z)) (def. of e)
> (GM)-weight of g (Lemma 2.1)
G-weights of all edges in Q.
So, w.r.t. G-weights, e is the heaviest edge on a cycle PQ and cann ot be in MSF(G). C x y w z P Q e
目標:證明 e is also the heaviest edge on a cycle in G eMSF(G)
• 選定一個點為起點, 用 DJPDJP 演算法長 component Ci 長到 1. 大於 maxsize, 或 2. 連到別的 component Ci 就停下來
Partition & Key Lemma
• By applying Key Lemma repeatedly, we se e that after Ci is built, the MSF of G is a su
Decision Trees
• 一個 Decision Tree 為一 rooted tree ,在 每個 internal node 上都含有某些條件判斷 式,不同的分支代表判斷式不同的結果。 所有 leaves 各自代表了不同的決策,而自 root 到一 leaf 之間所經過的 path 即代表選 擇此決策所需要的條件。
MSF Decision Trees
• 每個 internal node of MSF Decision Trees 上的判斷式是一個 edge-weight compariso n (對於給定的 graph G )。
• 每個 internal node of MSF Decision Trees 必恰好有兩個 children ,分別代表該 edge-weight comparison 為 true 或 false 。
• MSF Decision Trees 的 leaves 列出所有符 合 root 到每一 leaf 之路徑上判斷式及其結 果的一些 spanning tree 。
MSF Decision Trees (cont.)
• Correct MSF Decision Trees 的條件為每 一條從 root 到一個 leaf 的 path 可決定唯一 的一個 spanning tree 為 G 的 MSF 。
• Optimal MSF Decision Tree 的條件為沒有 比之深度更小的 Correct MSF Decision Tre e of G 存在。
• 當我們有 graph G 的 Optimal MSF Decisio n Trees ,我們就可以將 G 的 edge weight 值代入其判斷式找出其 MSF 。
Find Optimal Decision Trees
• 簡單的說,是用 brute force search (BFS) 去暴力搜 尋所有可能性並驗證。
• 分析當我們要找出所有具 r 個 vertices 的 graph 之 Op timal Decision Trees 的時間複雜度:
• 因此若取 則整個處理為 o(n) ti me 。
Complexity
e linear tim , )) / 1 log( (m O e linear timMSF of the : edges and vertices graph with any on MSF the determine to needed s comparison of number optimal the : ) , ( OptimalMSF of time running the : ) , ( * xity ree comple decision-t T m n n m T n m T * m c ) n , m T( ) (C T T(m,n) i i * 2 4 2 •Observations:
•If T*(m,n) = O(m), then T(m,n)=O(m) •T(m,n)=O(T*(m,n)) for many natural functions for T* (including m(m,n)) •Prove that: T(m,n)=O(T*(m,n)) holds, no matter what describing O(T*(m,n))
•Observations:
•If T*(m,n) = O(m), then T(m,n)=O(m) •T(m,n)=O(T*(m,n)) for many natural functions for T* (including m(m,n)) •Prove that: T(m,n)=O(T*(m,n)) holds, no matter what describing O(T*(m,n))