[] Prufer sequence prufer

1. \ (Prufer \) defined sequence

\ (prufer \) sequence is a sequence corresponding to a tree without roots, focusing on an unrooted tree corresponds to a unique prufer sequence (do not ask me how license)

The unrooted tree into \ (Prufer \) sequence of steps:

  1. The minimum number of leaf nodes deleted
  2. The node connected to this node in the added sequence
  3. Repeat \ (2 \) , the tree until only two nodes

2. \ (Prufer \) to achieve sequence

Let's ask what \ (prefer \) sequence

Here Insert Picture Description

We look at the picture above

Here Insert Picture Description

First, we remove the lowest numbered leaf node \ (4 \) , and node \ (2 \) added to the sequence

\ (prufer \) sequence: \ (2 \)

Here Insert Picture Description

We removed the minimum number of leaf nodes \ (5 \) , the node \ (2 \) to join sequence

\ (prufer \) sequence: \ (2,2 \)

Here Insert Picture Description

We removed the minimum number of leaf nodes \ (2 \) , the node \ (1 \) to join sequence

\ (prufer \) sequence: \ (2,2,1 \)

Here Insert Picture Description
We removed the minimum number of leaf nodes \ (1 \) (no root), the node \ (3 \) adding sequence

\ (prufer \) sequence: \ (2,2,1,3 \)

Here Insert Picture Description

We removed the minimum number of leaf nodes \ (6 \) , the node \ (3 \) adding sequence

\ (prufer \) sequence: \ (2,2,1,3,3 \)

Finally, only node \ (3,7 \) , thus completing \ (prufer \) to achieve sequence


3. \ (Prufer \) Nature sequence

  1. \ (prufer \) sequence number appears in a number of its degrees \ (--1 \)
  2. A number of nodes \ (n-\) unrooted tree \ (Prufer \) sequence length must be \ (n-2 \)

4. (Prufer \) \ serial use

[XSY2519] neurons (neuron)

Guess you like

Origin www.cnblogs.com/ShuraEye/p/11401383.html