• Aucun résultat trouvé

Trees & Routing (II) MST

N/A
N/A
Protected

Academic year: 2022

Partager "Trees & Routing (II) MST"

Copied!
43
0
0

Texte intégral

(1)

Trees & Routing (II) MST

mardi 24 février 2015

(2)

Why (minimum spanning) trees ?

mardi 24 février 2015

(3)

Minimum Spanning Tree

Given a weighted graph G=(V,E,ω), a MST of G is a spanning tree of G of minimum weight.

If weights in G are distinct then MST is unique ! (PROVE IT !)

8 5

2 1 8

3 1

2

mardi 24 février 2015

(4)

Minimum Spanning Tree

Given a weighted graph G=(V,E,ω), a MST of G is a spanning tree of G of minimum weight.

If weights in G are distinct then MST is unique ! (PROVE IT !)

8 5

2 1 8

3 1

2

mardi 24 février 2015

(5)

BFS or MST ?

8 5

2 1 8

3 1

20

8 5

2 1 8

3 1

2 3

2

mardi 24 février 2015

(6)

BFS or MST ?

8 5

2 1 8

3 1

2

8 5

2 1 8

3 1

2 3

mardi 24 février 2015

(7)

MST definitions

Given a weighted graph G=(V,E,ω), a T in G is called MST fragment of G if exists an MST of G having T as subtree.

Theorem : Given a weighted graph G=(V,E,ω) and a fragment T of G, the union between T and the minimum weight outgoing edge of T (mwoe(T)) is also a fragment.

mardi 24 février 2015

(8)

MST Construction

mardi 24 février 2015

(9)

MST Strategies

blue rule : Pick a fragment,T, and add to it the mwoe(T).

red rule : Pick a cycle in the remaining graph and erase the heaviest edge in that cycle.

mardi 24 février 2015

(10)

Blue Rule Strategies

mardi 24 février 2015

(11)

Prim Algorithm

the unique root is the initial fragment

apply the «blue» rule until reaching the MST

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(12)

Prim Algorithm

the unique root is the initial fragment

apply the «blue» rule until reaching the MST

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(13)

Prim Algorithm

the unique root is the initial fragment

apply the «blue» rule until reaching the MST

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(14)

Prim Algorithm

the unique root is the initial fragment

apply the «blue» rule until reaching the MST

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(15)

Prim Algorithm

the unique root is the initial fragment

apply the «blue» rule until reaching the MST

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(16)

Prim Algorithm

the unique root is the initial fragment

apply the «blue» rule until reaching the MST

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(17)

Prim Algorithm

the unique root is the initial fragment

apply the «blue» rule until reaching the MST

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(18)

Prim Algorithm

the unique root is the initial fragment

apply the «blue» rule until reaching the MST

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(19)

Prim Algorithm

the unique root is the initial fragment

apply the «blue» rule until reaching the MST

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(20)

Prim Algorithm

the unique root is the initial fragment

apply the «blue» rule until reaching the MST

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(21)

Prim Algorithm

the unique root is the initial fragment

apply the «blue» rule until reaching the MST

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(22)

Prim Algorithm

the unique root is the initial fragment

apply the «blue» rule until reaching the MST

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(23)

Prim Algorithm

the unique root is the initial fragment

apply the «blue» rule until reaching the MST

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(24)

Prim Algorithm

the unique root is the initial fragment

apply the «blue» rule until reaching the MST

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(25)

Distributed Prim

• root broadcasts «pulse» in the current tree

• upon reception of «pulse» each node of the current tree upcasts its lightest outgoing

edge (not part of the current tree) to the root

• root chooses the lightest edge, e, and starts the next pulse (also broadcasting e)

mardi 24 février 2015

(26)

Distributed Prim

r

n1 n2

n3

n3 n4

7

8 3

2

1

9

6 5

mardi 24 février 2015

(27)

Distributed Prim

r

n1 n2

n3

n3 n4

7

8 3

2

1

9

6 5

mardi 24 février 2015

(28)

Distributed Prim

r

n1 n2

n3

n3 n4

7

8 3

2

1

9

6 5

mardi 24 février 2015

(29)

Distributed Prim

r

n1 n2

n3

n3 n4

7

8 3

2

1

9

6 5

mardi 24 février 2015

(30)

Distributed Prim

r

n1 n2

n3

n3 n4

7

8 3

2

1

9

6 5

mardi 24 février 2015

(31)

Distributed Prim

r

n1 n2

n3

n3 n4

7

8 3

2

1

9

6 5

mardi 24 février 2015

(32)

Distributed Prim

r

n1 n2

n3

n3 n4

7

8 3

2

1

9

6 5

mardi 24 février 2015

(33)

Distributed Prim - Complexity

• Message Complexity O(n

2

)

• Time Complexity O(n

2

)

mardi 24 février 2015

(34)

Kruskal Algorithm

• each node is an initial fragment

• at each step apply

the «blue» rule over all the fragments

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(35)

Kruskal Algorithm

• each node is an initial fragment

• at each step apply

the «blue» rule over all the fragments

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(36)

Kruskal Algorithm

• each node is an initial fragment

• at each step apply

the «blue» rule over all the fragments

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(37)

Kruskal Algorithm

• each node is an initial fragment

• at each step apply

the «blue» rule over all the fragments

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(38)

Kruskal Algorithm

• each node is an initial fragment

• at each step apply

the «blue» rule over all the fragments

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(39)

Kruskal Algorithm

• each node is an initial fragment

• at each step apply

the «blue» rule over all the fragments

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(40)

Kruskal Algorithm

• each node is an initial fragment

• at each step apply

the «blue» rule over all the fragments

8 5

2 1 6

4 3

7 9

mardi 24 février 2015

(41)

Distributed Kruskal

(Gallager-Hamblet-Spira)

• Initially each node is the root of its fragment

• repeat until a unique fragment:

1. each root applies blue rule in its fragment

2. if (u, v)=mwoe(Tr) and (u,v)=mwoe(Ts) then u or v become the new root of the merged trees Tr and Ts (depending on the higher id)

3. new root informs the new fragment about its identifier

mardi 24 février 2015

(42)

GHS Exemple

mardi 24 février 2015

(43)

GHS - Complexity

• Message Complexity O(⎮E⎮log(n))

• Time Complexity O(nlog(n))

mardi 24 février 2015

Références

Documents relatifs

On the class of tree games, we show that the AT solution is characterized by Invariance to irrelevant coalitions, Weighted addition invariance on bi-partitions and the Inessential

& Aims This study investigated the impact of surface fires on the radial growth of Pinus radiata, where only the stem of trees was charred, while no needle damage was

The stem length, the probability of the branch and the leaf, the average of the radius of the stem and the branches, etc…we model a virtual apple tree using the

et al., Secular trend and seasonal variability of the column abundance of N 2 0 above the Jungfraujoch station determined from IR solar

In undirected graphs with a fixed number K of terminals and uniform capacity, CAP-STEINER-TREE is solvable in polynomial time, and ML-CAP-STEINER-TREE is polynomially equivalent

In the last 10 years or so, several weak limit theorems for the number of cuts have been obtained for Cayley trees (Panholzer [20,21]), complete binary trees (Janson [13]),

suffices to study the ordinary generating series of the species F Ω ◦. A rooted tree with vertex outdegrees in the set Ω ∗ consists of a root-vertex together with an unordered list

The current issue of the Bulletin is a double issue that originated from the panel “Representing local history in the Himalayas”, which was convened by Gisèle Krauskopff and