We present a general framework to generate trees every vertex of which has a non-negative weight and a color. The colors are used to impose certain restrictions on the weight and colors of other vertices. We first extend the enumeration algorithms of unweighted trees given in [19, 20] to generate weighted trees that allow zero weight. We avoid isomorphisms by generalizing the concept of centroids to weighted trees and then using the so-called centroid-rooted canonical weighted trees. We provide a time complexity analysis of unranking algorithms and also show that the output delay complexity of enumeration is linear. The framework can be used to generate graph classes taking advantage of their tree-based decompositions/representations. We demonstrate our framework by generating weighted block trees which are in one-to-one correspondence with connected block graphs. All connected block graphs up to 19 vertices are publicly available at [1].
翻译:我们提出了一个通用框架,用于生成每个顶点具有非负权重和颜色的树。颜色用于对顶点的权重及其他顶点的颜色施加特定约束。我们首先扩展了文献[19,20]中无权重树的枚举算法,以生成允许零权重的加权树。通过将质心的概念推广到加权树,并利用所谓基于质心根的标准加权树,我们避免了同构问题。我们对无秩算法进行了时间复杂度分析,并证明了枚举的输出延迟复杂度是线性的。该框架可应用于利用基于树的分解或表示来生成图类。我们通过生成与连通块图一一对应的加权块树来演示该框架。所有顶点数不超过19的连通块图已公开于文献[1]中。