• 沒有找到結果。

an optimal minimum spanning tree algorithm

N/A
N/A
Protected

Academic year: 2021

Share "an optimal minimum spanning tree algorithm"

Copied!
26
0
0

加載中.... (立即查看全文)

全文

(1)

An Optimal Minimum

Spanning Tree Algorithm

Seth Pettie and Vijaya Ramachadran Journal of the ACM Vol. 49, No. 1

(2)

Outline

• Preliminary

– Cut and Cycle – DJP Algorithm

– MST in Dense Case

• Overview of the Algorithm

• Key Lemma and the Partition Algorithm • Decision Tree

(3)

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

(4)
(5)

C1 C2 C3 C4 C5 C6 C7

GM

(6)

C1 C2 C3 C4 C5 C6 C7

Partition(G,r,

; M,C)

•將問題分成 •Ci 裡面 & Ci 外面 以 DecisionTree 求 MSF

GM

(7)

以 DenseCase 求 MS F

GM

Partition(G,r,

; M,C)

•將問題分成 •Ci 裡面 & Ci 外面

(8)

•Boruvka2:

•將 vertex 數降為 1/4

•Gc: m 降為 1/4 •OptimalMSF(Gc)

(9)

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. GM, then MSF(G) is a subset of MSF(C)  MSF(G \ CMC)  MC DJP-contractible w.r.t GM 即:在 G 上,使用 SoftHeap , 以 Prim algorithm 長出來的子圖

Mc : corrupted edges with one endpoint in C

(10)

• 證法: – 要證明在 (1) 裡的每條 edge , 在 (2) 都會存在  證明在 (2) 中不存在的 edge , 也必不存在 (1)(2) 再拆成兩部分來看 a) In C, if an edge eMSF(C), then eMSF(G) b) In G\C, if an edge eMSF(G\CMC)MC, then eMSF(G) C C M M C G MSF C MSF G MSF( ) ( )  ( \  )  (1 ) (2 ) • 欲證明: G C

(11)

• 證明:

eMSF(C)

 e must be the heaviest edge on some cycle in C. (cycle property)

Such a cycle exists in G as well. So eMSF(G)

a) 欲證明:

In C, if an edge eMSF(C), then eMSF(G)

G

(12)

• 證明:

Let H=G\CMC, show that

no edge in HMSF(H) is in MSF(G)

Let eHMSF(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  eMSF(G) b) 欲證明: In G\C, if an edge eMSF(G\CMC)MC, then eMSF(G) G C  

(13)

• 證明 ( 續上頁 ) :

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 = (GM)-weight

T: the spanning tree of CM

 Q: the path in T connecting x and yg: the heaviest edge in Q.

w(e) > max(w(x,w), w(y,z)) (def. of e)

> (GM)-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 PQ 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 eMSF(G)

(14)

• 選定一個點為起點, 用 DJPDJP 演算法長 component Ci  長到 1. 大於 maxsize, 或 2. 連到別的 component Ci 就停下來

(15)

Partition & Key Lemma

• By applying Key Lemma repeatedly, we se e that after Ci is built, the MSF of G is a su

(16)

Decision Trees

• 一個 Decision Tree 為一 rooted tree ,在 每個 internal node 上都含有某些條件判斷 式,不同的分支代表判斷式不同的結果。 所有 leaves 各自代表了不同的決策,而自 root 到一 leaf 之間所經過的 path 即代表選 擇此決策所需要的條件。

(17)
(18)

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 。

(19)

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 。

(20)
(21)

Find Optimal Decision Trees

• 簡單的說,是用 brute force search (BFS) 去暴力搜 尋所有可能性並驗證。

• 分析當我們要找出所有具 r 個 vertices 的 graph 之 Op timal Decision Trees 的時間複雜度:

• 因此若取 則整個處理為 o(n) ti me 。

(22)

Complexity

e linear tim , )) / 1 log( (mO e linear tim

(23)

MSF 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))

(24)

•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))

參考文獻

相關文件

同一個常數 C ,只適用在 ( 0) 或者 (0, ) 上。.

 for…迴圈自初值開始判斷 <條件判斷> 是否為 true,若為 true 則執行 for 迴圈內的敘述,並依 <增量值>,每次增 加 (或減少) 指定的增量值,直至 <條件判斷>

Lecture by baluteshih Credit by zolution... Minimum

 它為小孩們提供 了一個有趣的生 活體驗,體驗了 在江戶時代作為 一個普通人生活 的感受。.. 旅客可以穿上和服,步

• 讓每個人在德、智、體、群、美各方面 都有全 面而具個性的發展,能夠一生不 斷自學、思考、探 索、創新和應變。」.

危機事件 後果 可預測性 持續性 震撼程度 估計危機 影響程度 一對小四及小. 二的兄妹,居 於學校同邨的

• 下面介紹三種使用greedy algorithm產生minimum cost spanning

Both problems are special cases of the optimum communication spanning tree problem, and are reduced to the minimum routing cost spanning tree (MRCT) prob- lem when all the