## Quick Decoding and Encoding of Prüfer Strings: Exercises in Data Structures

Citations: | 1 - 0 self |

### BibTeX

@MISC{Julstrom_quickdecoding,

author = {Bryant A. Julstrom},

title = {Quick Decoding and Encoding of Prüfer Strings: Exercises in Data Structures},

year = {}

}

### OpenURL

### Abstract

Cayley's Formula tells us that a complete undirected graph on n vertices has n n-2 distinct spanning trees. Prfer's proof of this result establishes a one-to-one correspondence between the spanning trees on n vertices and the strings of length (n - 2) over an alphabet of n symbols. The proof describes two algorithms. One identifies the edges in the spanning tree corresponding to a string, and the other builds the string corresponding to a list of edges in a spanning tree. Naive implementations of these algorithms have times that are quadratic in the number n of vertices. Elaborating the data structures they use reduces both times to O(n log n). This paper describes these faster implementations. The data structures they use are familiar to any student who has completed CS2. They include priority queues implemented with heaps and adjacency lists implemented with trees. 1. Introduction A spanning tree of a connected, undirected graph G is a subgraph of G that connects all of G 's ve...

### Citations

767 | Data Structures and Algorithms - Aho, Hopcroft, et al. - 1983 |

738 |
The Art of Computer Programming, Volume 3, Sorting and Searching
- Knuth
- 1998
(Show Context)
Citation Context ...ents an adjacency list can contain more than (n - 1) vertices. If the trees are binary search trees, the average-case times for insertions and deletions on them are O( log (n-1)); that is, O( log n) [=-=Knuth, 1973-=-, pp.426-431; Aho, Hopcroft, and Ullman, 1983, pp.160-162; Manber, 1989, pp.73-74]. In the worst case, all a tree's interior nodes have just one child, so that the tree is in fact a simple linked list... |

463 |
Algorithms in C
- Sedgewick
- 1992
(Show Context)
Citation Context ...62; Knuth, 1973, pp.451-468; Horowitz and Sahni, 1977, pp.442-456], 2-3 trees [Horowitz and Sahni, 1977, pp.496-517; Aho, Hopcroft, and Ullman, 1983, pp.169-180; Wood, 1993, pp.378-391], 2-3-4 trees [=-=Sedgewick, 1998-=-, pp.560-564], and red-black trees [Guibas and Sedgewick, 1978; Wood, 1993, pp.353366; Sedgewick, 1998, pp.565-573]. Thus the algorithm uses three data structures: an array of the vertices' degrees, a... |

240 | A dichromatic framework for balanced trees - Guibas, Sedgewick - 1978 |

184 | An algorithm for the organization of information - Adel’son-Vel’skii, Landis - 1962 |

155 |
Introduction to algorithms, a creative approach
- Manber
- 1989
(Show Context)
Citation Context ...oring the heap and of enqueueing a new item can each be carried out in time that is O(log n), where n is the number of items in the queue [Williams, 1964; Aho, Hopcroft, and Ullman, 1983, pp.139-145; =-=Manber, 1989-=-, pp.68-70]. We elaborate the algorithm to include a priority queue of the vertices with current degree 1. Each vertex is enqueued when its degree falls to 1, and the next vertex dequeued always has t... |

154 |
Algorithm 232: Heapsort
- Williams
- 1964
(Show Context)
Citation Context ...e operations of dequeueing the highest-priority item and restoring the heap and of enqueueing a new item can each be carried out in time that is O(log n), where n is the number of items in the queue [=-=Williams, 1964-=-; Aho, Hopcroft, and Ullman, 1983, pp.139-145; Manber, 1989, pp.68-70]. We elaborate the algorithm to include a priority queue of the vertices with current degree 1. Each vertex is enqueued when its d... |

106 |
A Theorem on Trees
- Cayley
- 1889
(Show Context)
Citation Context ...than the number of vertices it connects. A complete graph on n vertices has all n(n-1)/2 possible edges. When a graph is complete, Cayley's Formula tells us that it has n n-2 distinct spanning trees [=-=Cayley, 1889-=-; Even, 1973, pp.98106]. Figure 1: A graph on a collection of vertices (a) and a spanning tree for that graph (b). Computer Science students generally encounter graphs, and write programs that represe... |

94 | Fundamentals of Data Structures - Horowitz, Sahni - 1982 |

36 |
Data Structures, Algorithms, and Performance
- Wood
- 1993
(Show Context)
Citation Context ...e than n items, the time for each enqueue and dequeue operation is O( log n), and the time of the entire algorithm is O(n log n). Indeed, the initial priority queue can be built in time that is O(n) [=-=Wood, 1993-=-, pp.407408], but this does not change the time of the loop. The Appendix gives C++ code for the algorithm. This algorithm can be used to generate random spanning trees efficiently. It is difficult to... |

33 |
Algorithmic Combinatorics
- EVEN
- 1973
(Show Context)
Citation Context ...r of vertices it connects. A complete graph on n vertices has all n(n-1)/2 possible edges. When a graph is complete, Cayley's Formula tells us that it has n n-2 distinct spanning trees [Cayley, 1889; =-=Even, 1973-=-, pp.98106]. Figure 1: A graph on a collection of vertices (a) and a spanning tree for that graph (b). Computer Science students generally encounter graphs, and write programs that represent and opera... |

15 | Designing Telecommunications Networks Using Genetic Algorithms and Probabilistic Minimum Spanning Trees - Abuali, Schoenefeld, et al. - 1994 |

12 | Genetic Algorithm for solving Bi-Criteria Network Topology Design - Kim, Gen - 1999 |

11 |
A genetic algorithm for the rectilinear Steiner problem
- Julstrom
- 1993
(Show Context)
Citation Context ... used to represent spanning trees, for example, in genetic algorithms for computationally difficult problems that search spaces of spanning trees. These have included the rectilinear Steiner problem [=-=Julstrom, 1993-=-], the probabilistic minimum spanning tree problem [Abuali, Schoenefeld, and Wainwright, 1994], the degree-bounded minimum spanning tree problems[Zhou and Gen, 1997], the time-dependent minimum spanni... |

7 | A genetic algorithm with feasible search space for minimal spanning trees with time-dependent edge costs - Gargano, Edelson, et al. - 1998 |

5 | Neuer Beweis eines Satzes ueber Permutationen. Archiv fur Mathematik und Physik - Prufer - 1918 |