| Algorithm 1. Tree growing. | |||
| Input:, traveling distance constraint ; | |||
| Output: spanning tree | |||
| 1: | |||
| 2: | while and do | ||
| 3: | |||
| 4: | for each and do | ||
| 5: | |||
| 6: | |||
| 7: | |||
| 8: | |||
| 9: | end for | ||
| 10: | find the biggest in | ||
| 11: | |||
| 12: | |||
| 13: | if then | ||
| 14: | |||
| 15: | |||
| 16: | else | ||
| 17: | break | ||
| 18: | end if | ||
| 19: | end while | ||
| 20: | return | ||