I'm currently having a difficult time understanding the Prufers sequence. I'm a bit confused on understanding the concept of choosing the smallest node and how to know which nodes connect to which nodes.
For example: Calculate the tree for Prufer's sequence S = [1,3] on four nodes A =[1,2,3,4]. I have been told to choose the smallest number in A, which is not in S, in this case; 2. However, should 2 be connected to 1?
It would be greatly appreciated if you could explain the purpose of using Prufer's sequence, as well as explaining the example above.
The reconstructing algorithm is this:
The purpose of Prüfer codes is twofold. First, this is an explicit bijection between sequences of $n-2$ elements of $\{1,2,\dots,n\}$ and the $n^{n-2}$ labeled trees on $n$ vertices. Second, we can recover some information about the tree from its Prüfer code (for example, if a vertex has degree $d$ in the tree, its label appears $d-1$ times in the Prüfer code) and this lets us count some more specific types of labeled trees easily.