Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chen, Lu Mentor: Zhou, Jian Shanghai University, School of Management Email: Chen213.shu.edu.cn.

Similar presentations


Presentation on theme: "Chen, Lu Mentor: Zhou, Jian Shanghai University, School of Management Email: Chen213.shu.edu.cn."— Presentation transcript:

1 Chen, Lu Mentor: Zhou, Jian Shanghai University, School of Management Chen213.shu.edu.cn

2 The object is to minimize the total length of the links inserted into the network. Conditions:  Every pair of vertices is connected by exactly one path.  n-1 links need to be chosen.  No cycle. 2

3 Ⅰ Kruskal Algorithm (1956)Kruskal Algorithm (1956) Ⅱ Prim Algorithm (1957)Prim Algorithm (1957) Ⅲ Dijkstra Algorithm (1959)Dijkstra Algorithm (1959) Ⅳ Reverse Delete AlgorithmReverse Delete Algorithm Ⅴ Sollin Algorithm (1961)Sollin Algorithm (1961) 3

4  G=( V, E )  w v means vertex. e means edges. w means weight. 4

5 1. Sort the edges by weight. 2. Examine each edge in the order of increasing weight. 3. If the edge examined does not create a cycle with the edges in the current forest, it is added to the forest; otherwise, it is discard. 5

6  w 12 w 45 w 14 w 25 w 35 w 23 w 13 w 43  √ √ √ × √ × × ×

7

8 1. Select any node arbitrarily, and then connect it to the nearest distinct node. 2. Identify the unconnected node that is closest to a connected node, and then connect these two nodes. 3. Repeat step 2 until all nodes have been connected. 8

9

10  Ties for the nearest distinct node or the closest unconnected node may be broken arbitrarily, and the algorithm must still yield an optimal solution. 10

11

12

13

14  Special Prim algorithm  Definitions: S : Set of the nodes which have been connected by branch. S’ : The remaining nodes. d(v) : Distance from note v to S. 14

15 Step1: Set N={1, 2,…,n}, and d j =w 1 j. Step2: d j* =min{d j | j∈S’}=w i j* (i∈S, j*∈S’), j* add into S. Step3: d j = min{ d j , w j*j }, j∈S, return to step 2, until S=N. 15

16

17  1. Select vertex1 as the starting point, S={1}.  2. d 2 =w 12 = 1, d 3 =7, d 4 =3 d j *=min{d 2, d 3, d 4 | j∈S’} =w 12 =w ij* = 1 j*=2,vertex 2 add into S, and S={1,2}.  3. d 4 =min{d 4, w 24 }=min{3, 4}=3 d 3 =min{d 3, w 23 }=min{7, 6}=6 d 5 =min{d 5, w 25 }=min{5, 4}=4 d j *=min{d 4, d 3, d 5 | j∈S’} =w 14 =w ij* =3 j*=4, vertex 4 add into S, and S={1,2,4} 17

18 ( d 4 =w 14 ) 1 (d 2 =w 12 )

19  4. d 3 =min{d 3, w 43 }=min{7, 8}=7 d 5 =min{d 5, w 45 }=min{5, 2}=2 d j *=min{d 4, d 3, d 5 | j∈S’} =w 45 =w ij* =32 j*=5, vertex 5 add into S, and S={1,2,4,5} 5. d 3 =min{d 3, w 53 }=min{7, 5}=5 j*=3, vertex 3 add into S. 6. S={1,2,4,5,3}=N. 19

20 (w 53 ) 2(w 45 ) 20 3 ( d 4 =w 14 ) 1 (d 2 =w 12 )

21  It is the reverse of Kruskal’s algorithm  Also called “Tear Cycle Method” 21

22 1. Select a spanning tree arbitrarily 2. Add a branch in this tree, then there will be a loop in the graph. Removal the longest one. 3. Repeat step 2 until all the edges have been tested 22

23

24

25

26

27

28

29  Original: Borůvka‘s algorithm ( 1926 )  Reason: Because Sollin was the only computer scientist in this list living in an English speaking country, this algorithm is frequently called Sollin's algorithm. 29

30 1. Every vertex signify a tree , and the original graph signify a forest. 2. Chose every vertex’s closet edge. If some vertexes’ closet edge are the same edge, these vertexes merge into a new vertex. 3. Repeat step 2 , until there is only one tree in the forest. 30

31 e 12 2e 12 3e 35 4e 45 5 e 45 31

32 ,2 e 14 4,5 e 14 3 e 35 32

33 ,2,4,5 e35 3 e35 33

34

35 35


Download ppt "Chen, Lu Mentor: Zhou, Jian Shanghai University, School of Management Email: Chen213.shu.edu.cn."

Similar presentations


Ads by Google