How to determine lexicographically the smallest Prüfer-Code of a spanning tree?

165 Views Asked by At

First, lexicographically the smallest means e.g. 112 < 121 and 121 < 211.

EDIT: Then how to determine the minimal Prüfer-Code of a spanning tree from the given graph:

Graph

Should I first find the minimal spanning tree?

Any suggestions?

1

There are 1 best solutions below

1
On BEST ANSWER

Basically, we want as many $0$s in the beginning of our prufer code as we can. We can get at most 2. Thus, the minimum prufer will occur when there are exactly $ 2$ 0s in the beginning slots of the code. After this, there are only 3 possible ways to construct the spanning tree from this point, so it is easy to try them all and determine the minimum. Take the edges $e_1 = (0,1);e_2 = (0,2); e_3= (0,6);e_4=(6,7);e_5=(4,6);e_6=(4,5);e_7 = (3,5).$ This yields the prufer code, $s: 006546$.