Calculation of the smallest possible tree

Given a set of nodes, how can I build a tree that connects all nodes in such a way as to minimize max (max (degree), max (depth))?

For example, given a set of five nodes, I could connect them like this:

max (degree) = 4, max (depth) = 1

However, this is not minimal, since max (degree) == 4 and max (depth) == 1, the best tree would be the following:

max (degree) = 2, max (depth) = 2

which has max (degree) == 2 and max (depth) == 2

Edit :: The algorithm does not have to be fast, but it is important to accurately determine the optimal tree.

+3
source share
2 answers

. = 1 + + ^ 2 +... + ^ . A031973. . , node, D = =

D, - , .

+4

== - n = ^ k k = 0 -1. . , ( -1)/(-1), , , . ( ;-)) n = ( ^ -1)/(-1) , , , / n.

+2

Source: https://habr.com/ru/post/1770911/


All Articles