ºtºâªk³]­p»P¤ÀªRTerm Project

The Steiner Tree Probelm

¸ê¤u©Ò³Õ¤h¯Z¤@¦~¯Å §d§Ó®p 9034811

cfwu@mail.wtuc.edu.tw

 

²¤¶:

¡@¡@©Ò¿×ªºSteiner tree problem[1,2,3]¬O«ü¦b¤@µL¦V¹ÏG(V,E)¤¤, µ¹©w¤@²ÕVªº¤l¶°¦XS, §Ú­Ì­n¦b¨ä¤¤§ä¨ì¤@­Ó minimum cost tree, ³o­Ó tree ¥²»Ý¥]§tS¤¤©Ò¦³ªºÂI, ¥t¥~¤]¥i¥]§t¤@¨Ç«DS¤¤ªºÂI¡C³o¨Ç«DSªºÂI§Ú­ÌºÙ¤§¬° Steiner nodes, S¤¤ªºÂI§Ú­ÌºÙ¤§¬° terminals¡C

¡@¡@Steiner tree problem ¬OÄÝ©ó NP-complete ªº¶¡ÃD, ¥NªíµÛ§Ú­Ì¥Ø«e§ä¤£¨ì¤@­Ó deterministic ªººtºâªk, ¯à°÷¦bpolynomial ªº®É¶¡¤º¸Ñ¨M³o­Ó°ÝÃD, ¦ý¬OÁÙ¬O¦³ºtºâªk¥i¥H¦b exponential time O(N) or O(M) ¸Ñ¨M³o­Ó°ÝÃD, ¨ä¤¤|V|=N, |S|=M¡C¥H¤U¬O³o­Ó°ÝÃDªº¤@¨Ç¥i¯à¸Ñªk[3]

Exact solution algorithms

Topology Emumeration algorithm. §ä¥X W ¤¤©Ò¦³¥i¯àªºminimum spanning tree, W¬°Vªº¤l¶°¦X¨Ã¥B¥]§tS, ¦b³o­Ó¤èªk¤¤·|¦³ 2^(N-M) ªº W ¨Ó¸ÕÅç.

Approximate algorithms

¥O CR = T algorithm / T optimum

The Shortest Path algorithm. ±q S ¤¤§ä¥X¥ô·N¤@­ÓÂI, ±q³o­ÓÂI«Ø¥ß¤@­Ó shortest path tree ¨ì¨ä¥¦©Ò¦³ªºÂI, ¦A±N³o­Ótree ¤¤«ü¨ì«D terminal ¦h¾lªº edge §R°£¡C¦¹ºtºâªkªº time complexity ¬° O(N^2), ¦Ó CR ¬° O(M)¡C

The Greedy Algorithm. ±q S ¤¤ªº¥ô·N¤@­ÓÂI¶}©l, §ä¥XÂ÷¥Ø«e©Ò«Øºc¥Xªºªº tree ³Ìªñªº terminal, ¨Ã±N¥¦¥[¨ì tree ¤¤, ­«½Æ³o­Ó¨BÆJ¤@ª½¨ì©Ò¦³ªº terminal ¥þ³¡¥[¶i¨Ó¬°¤î¡C¦¹ºtºâªkªº time complexity ¬° O(M*N^2), ¦Ó CR <= 2¡C

The Kou Markowsky and Berman algorithm (KMB), ¥»¦¸³ø§i©Ò¨Ï¥Îªººtºâªk¬°¦¹¤@¤èªk, ®e¸Ô­z©ó«á¡C¦¹ºtºâªkªº time complexity ¬° O(M*N^2), ¦Ó CR <= 2¡C

¡@¡@¹êÅç©Ò§@¥Xªºµ²ªG¤j­P©M¨ätime complexity§k¦X¡A§Y N ¥[Ô`, ®É¶¡´N¦hªá¤W4Ô`ªº®É¶¡, ¦Ó M ¶V¤j©Ò»Ýªº®É¶¡¤]§e²{½u©Ê¼W¥[¡C

°ÝÃD¸Ô­z:


¹Ï1

¡@¡@©Ò¿×ªº Steiner Tree Problem, ¬O¤@²ÕµL¦V¹ÏG(V,E)¤¤, µ¹©w¤@²Õ terminals, ¦p¹Ï¤@ªºA©MD, µM«á§Ú­Ì¥²»Ý¦bG¤W§ä¨ì¤@­Ó minimum spanning tree, ³o­Ó tree ¥²»Ýº¡¨¬¤U­±­n¨D

¡@¡@¦b¹Ï1¤¤§Ú­Ì¥i¥Hª¾¹D, ¦pªG¤£¯à¥]§t«D terminal ªºÂI, «h§ä¥X¨Óªº spanning tree, cost¬°6, ¦Ó¥B¦³¥i¯à®Ú¥»§ä¤£¨ì³o¼Ëªº tree, ¦b¥]§t¤F¤@¨Ç steiner node ¤§«á, ©Ò§ä¥Xªº cost ¬°5¡C

ºtºâªk:

The Kou Markowsky and Berman algorithm

Input: a undirect graph G(V,E) and a subset S of V.

Output: The minimum cost Steiner tree T.

Step1: «Øºc distance graph G1(S, E').
¹ï¨C¤@­Ó E' ¤¤ªº edge (u, v), ¥¦ªº cost µ¥©ó G ¤¤ u ¨ì v ªº³Ìµu¸ô®|ªºcost

Step2: §ä¥X minimum spaning tree T1 of G1

Step3: «Øºc G2(V'', E''), ±NT1ªº¨C¤@­Ó edge (u, v), ¥Î¥¦¦bStep1¤¤©Ò§äªº¸ô®|¥N¤J.

Step4: ±NG2¤¤ªºcycle¥h±¼.


¹Ï2

¡@¡@¦p¹Ï2©Ò¥Ü, ­º¥ý§Ú­Ì¥ý«Ø¥ß¤@­Ó¥]§t©Ò¦³ terminal ªº complete distance graph G1, µM«á§ä¥X¥¦ªº minimum spanning tree T1, µM«á±N­ì¸ô®|¥N¦^, ±o¨ì G2, ³Ì«á±N G2 ªº cycle ²¾¥h, ±o¨ì total cost ¬°14 ªº Steiner Tree T. ¦]¬°¦¹¤@ºtºâªk¬°approximate algorithm, ©Ò¥H¥¦±o¨ìªºsteiner tree¨Ã¤@©w³£¬Ooptimum, ¦¹¨Ò¤lªºminimum Steiner treeªº cost ¬° 13¡C

¡@¡@¦¹ºtºâªkªº time complexity ¬° O(M*N^2), ¦Ó CR <= 2¡C

µ{¦¡³]­p:

¡@¡@¦b step1 ¤¤¥²»Ý«Øºc¤@­Ódistance graph, ¦b³oùاڤ£±Ä¥Î all shortest path algorithm, ¦]¬°¤j³¡¥÷ªº graph¤¤, terminal ªº¼Æ¥Ø§¡»·¤p©ó |V|, ©Ò¥H§ï±Ä¥Ñ¨C¤@­Ó terminal «Ø¥ß¤@­Ó single source/all destinationªºshortest path tree, ¦b³oùةҨϥΪººtºâªk¬° Dijkstra's algorithm¡C

¡@¡@¦b step2 ¤¤»Ý­n«Ø¥ßminimum spanning tree, ³oùبϥΪº¤èªk¬° Kruskal's algorithm, ¦b Kruskal's algorithm¤¤¤@­Ó¤ñ¸û³Â·Ðªº¦a¤è¦b¥[¤J¤@­Ó·sªº edge ¬O§_²£¥Í cycle, ­ì¥»¥Îªº¤èªk tree traversal ªº¤èªk, ¦ý¬O®ÄªG«Ü®t, ¦b node ¼Æ¦b500¥ª¥k®É´N¶]¤£¤Ó°Ê¤F, «á¨Ó§ï¥Î weighted union[4]ªº¤èªk, °ÝÃD¥ß¨è¸Ñ¨M¡C

¡@¡@¦b step3 ¤¤­n±N­ì¨Óªº path ¥N¤J, ¥Ñ©ó¦b step1¤¤¤w¸g¦³¬°¨C¤@­Ó terminal «Ø¥ß shortest path tree, ©Ò¥H¥i¥H«Ü§Öªº¥N¤J¡C

¡@¡@¦b step4 ¤¤­n±N cycle ²¾¥h, ¦b³oùاڥΤF¤G­Ó¨BÆJ, ²Ä¤@¨B¬O¥h§ä G2 ªº minimum spanning tree, ²Ä¤G¨B¬O¥Î tree traversal ªº¤è¦¡, ±N leaf ¬°«D terminal ªº edge ²¾¥h¡C

¹êÅçµ²ªG:

¾÷¾¹³]³Æ: AMD Duron 700 ¶WÀW¨ì 800, RAM 640 MB
§@·~¨t²Î: Window XP
½s;¹: Visual C++ Enterprise, Win32 console

¥»¦¸¹êÅç©Ò¨Ï¥Îªº¹êÅç¸ê®Æ¬° SteinLib Testdata Library ©Ò´£¨Ñªº´ú¸Õ¸ê®Æ, ¥¦³Ì¤jªº¦n³B¬O¨C¤@­Ó´ú¸Õ¸ê®Æ³£¦³´£¨ÑOptimum solutionªº­È, ¥H§@¬°¤ñ¸û.

Name

  |V| 

  |E| 

  |T| 

  Opt 

KMB

TIME(ms)

 c01

500 

625 

85 

88

320

 c02

500 

625 

10 

144 

144

430

 c03

500 

625 

83 

754 

778

2033

 c04

500 

625 

125 

1079 

1114

2974

 c05

500 

625 

250 

1579 

1599

5998

 c06

500 

1000 

55 

60

320

 c07

500 

1000 

10 

102 

114

430

 c08

500 

1000 

83 

509 

533

2023

 c09

500 

1000 

125 

707 

729

2984

 c10

500 

1000 

250 

1093 

1124

6489

 c11

500 

2500 

32 

37

330

 c12

500 

2500 

10 

46 

49

440

 c13

500 

2500 

83 

258 

275

2063

 c14

500 

2500 

125 

323 

341

3054

 c15

500 

2500 

250 

556 

570

8652

 c16

500 

12500 

11 

13

340

 c17

500 

12500 

10 

18 

20

461

 c18

500 

12500 

83 

113 

128

2233

 c19

500 

12500 

125 

146 

159

3655

 c20

500 

12500 

250 

267 

269

17355

 

Name

  |V| 

  |E| 

  |T| 

  Opt 

KMB

TIME(ms)

 d01

1000 

1250 

106 

107

1362

 d02

1000 

1250 

10 

220 

237

1773

 d03

1000 

1250 

167 

1565 

1646

15222

 d04

1000 

1250 

250 

1935 

2010

22573

 d05

1000 

1250 

500 

3250 

3310

55450

 d06

1000 

2000 

67 

75

1362

 d07

1000 

2000 

10 

103 

105

1793

 d08

1000 

2000 

167 

1072 

1150

15282

 d09

1000 

2000 

250 

1448 

1550

22973

 d10

1000 

2000 

500 

2110 

2163

72615

 d11

1000 

5000 

29 

32

1372

 d12

1000 

5000 

10 

42 

44

1793

 d13

1000 

5000 

167 

500 

536

15483

 d14

1000 

5000 

250 

667 

704

25207

 d15

1000 

5000 

500 

1116 

1158

114435

 d16

1000 

25000 

13 

16

1382

 d17

1000 

25000 

10 

23 

25

1822

 d18

1000 

25000 

167 

223 

251

17495

 d19

1000 

25000 

250 

310 

369

36482

 d20

1000 

25000 

500 

537 

543

275436


¡@¡@¦¹¹êÅçµ²ªG¡A¤j­P©M¹w´Áªº¬Û¦P¡A´N¬O·í |E| ¼W¥[®É¨Ã¤£·|¼vÅT¨ì®É¶¡¡A¦Ó·í |V| ¥[­¿®É, ©Ò»Ýªº®É¶¡·|Åܦ¨4­¿, ¦Ó·í |T| ¼W¥[®É, ©Ò»Ý®É¶¡¤]¬O½u©Ê¼W¥[¡C

¡@¡@¤£¹L¤ñ¸û©_©Çªº¦b |T| = 250 ®É, ¨ä©Ò»Ýªº®É¶¡, ÀH |E| ªº¼W¥[¦Ó¼É¼W, ¸gÀˬdªºµ²ªG, µo²{©Ò¼W¥[ªº®É¶¡¬Oµo¥Í¦b«Ø¥ß G1ªº spanning tree ªº¦a¤è, ¦Ó¥B¬Oµo¥Í¦b sort ªº¨º¤@­Ó°Ê§@, ¦ý¦¹°Ê§@®Ú¥»´N¤£À³¸Ó¨ü¨ì |E| ªº¼vÅT, ¦]¬°©Ò°e¶i¥hªº¸ê®Æ¶q³£¬O¤@­Pªº ( 250*249/2 ), ¦Ó¥B sort ªº°Ê§@¬O¥Î¨ì C ªº qsort ³o­Ó¨ç¼Æ, ®Ú¥»´N¤£À³¸Ó¦p¦¹¡C

¡@¡@¦Ü©ó©Ò±o¨ìªº Steiner tree ªº cost Â÷¯u¥¿ªº Minimum Steiner Tree ªº cost ¤]³£«Ü±µªñ, ¨S¦³¥X²{¶W¥X 2 ­¿ªº±¡§Î¡C

µ²½×»P¤ß±o:

¡@¡@ Minimum Steiner Tree ¬OÄÝ©ó NP-complete ªº°ÝÃD, ©Ò¥H¦b¬ã¨s¦¹°ÝÃDªº¤@¶}©l´N¨S·Q¹L­n§ä¥X¥¦ªº¯u¥¿ªº¸Ñµª, ¦Ó¬O·Q§ä¥X¤@­Ó Approximate solution ªº¤èªk¡C¿ï¾Ü¥ÎKMBªº¤èªk³Ì¥D­nªº¬O¦]¬°¨äª½Ä±©öÀ´, ¦Ó¥B¹B¥Î¤@¨Ç¾Ç¹Lªººtºâªk´N¥i¥H°µ¥X¨Ó¡C¤£¹Lı±oºtºâªkÀ´¬O¤@¦^¨Æ, ¯uªº­n§â¤W­±ªº¤@¥y¸ÜÂà´«¦¨µ{¦¡¤S¬O¥t¥~¤@¦^¨Æ¤F¡A¹³¬O¦b spanning tree algorithm «ç»ò¥hÀˬd¥[¤W¥hªº edge ¦³¨S¦³§Î¦¨ cycle, «ç»ò¥h°µ cycle deletionµ¥µ¥¡C¬°¤F¥[§Ö³B²zªº³t«×, ©Ò¥H±Ä¥Î¤F¤@¨Ç«Ü®ö¶OÀx¦sªÅ¶¡ªº§@ªk, ¹³¬O§Q¥ÎMatrix¨ÓÀx¦s edge µ¥, ¦Ó¥B¤@¦¸´N¶}¤F¦n´X­Ó, ³o¨Ç³£¬O¦³«Ý§ï¶iªº¦a¤è¡CÁÙ¦³³oùؤñ¸ûÃhºÃªº¬O |E| ¨ì©³·|¤£·|¼vÅT¨ìµ²ªG¡A¦]¬°³oùةҨϥΪº¬O¸ê®Æµ²ºc¬O¥Î¯x°}¦Ó¤£¬Olink list, ÁÙ¦³¦pªG¥Îprim's algorithm¨Ó°µspanning tree·|¤£·|¤ñ¸û¦n¡C

°Ñ¦Ò¤åÄm:

1. Steiner Tree, http://hissa.nist.gov/dads/HTML/steinertree.html

2. The Steiner tree problem, http://www.cs.ucr.edu/~michalis/COURSES/141-1999/steiner.html

3. The Steiner tree problem, http://www.geocities.com/CollegePark/Residence/9200/research/steiner.htm

4. Ellis Horowitz and Sartaj Sahni, "Fundamentals of Data Structures in PASCAL", pp.275-284.

5. SteinLib Testdata Library, http://elib.zib.de/steinlib/steinlib.php

ªþ¿ý:

­ì©lÀÉ

´ú¸Õ¸ê®Æ

¡@¡@