Table of Contents
Fetching ...

Generation of weighted trees, block trees and block graphs

Tınaz Ekim, Mordechai Shalom, Mehmet Aziz Yirik

TL;DR

To address the need for uniform generation within structured graph classes, the paper develops a general framework to enumerate and unrank nonnegative-weight colored trees and then specializes it to weighted block trees corresponding to connected block graphs. Central to the approach is centroid-rooted canonical weighted trees to avoid isomorphisms, together with a color-weight scheme that unifies unweighted, positive-weighted, and block-tree constructions. The authors provide theoretical guarantees of linear output-delay enumeration and $O(n^3)$ unranking for rooted trees, as well as $O(N^2 \log N)$ time and space to precompute needed counts; they also establish a one-to-one correspondence with connected block graphs and publish instances up to $19$ vertices. Implementations in Python (including BlockGraphGen and Colab demos) demonstrate practical generation at scale. The framework offers a flexible tool for uniform sampling and analysis of structured graph families and can be extended to other tree-based decompositions.

Abstract

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].

Generation of weighted trees, block trees and block graphs

TL;DR

To address the need for uniform generation within structured graph classes, the paper develops a general framework to enumerate and unrank nonnegative-weight colored trees and then specializes it to weighted block trees corresponding to connected block graphs. Central to the approach is centroid-rooted canonical weighted trees to avoid isomorphisms, together with a color-weight scheme that unifies unweighted, positive-weighted, and block-tree constructions. The authors provide theoretical guarantees of linear output-delay enumeration and unranking for rooted trees, as well as time and space to precompute needed counts; they also establish a one-to-one correspondence with connected block graphs and publish instances up to vertices. Implementations in Python (including BlockGraphGen and Colab demos) demonstrate practical generation at scale. The framework offers a flexible tool for uniform sampling and analysis of structured graph families and can be extended to other tree-based decompositions.

Abstract

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].
Paper Structure (15 sections, 11 theorems, 10 equations, 5 figures, 3 tables, 8 algorithms)

This paper contains 15 sections, 11 theorems, 10 equations, 5 figures, 3 tables, 8 algorithms.

Key Result

Corollary 1

If $D_f$ is linear then the output delay time complexity of $\textsc{EnumerateMultisets}$ is linear.

Figures (5)

  • Figure 1: The partition of a tree $T$ implied by a non-trivial $a$-$b$ path $P$
  • Figure 3: A graph $G$, its block tree $T$, its weighted block tree $(T,w)$ and its centroid-rooted tree. The graph $G$ depicted at the top-left has three cut-vertices, namely $a, b$ and $c$. It has four blocks which are the three triangles $A, B, C$ and the $K_2$ induced by $\left\{a,b\right\}$. Every cut vertex of $G$ is in exactly two blocks and every such block contains at most two cut-vertices. Thus we obtain the block cut-vertex tree $T$ which is the path depicted at the top-right. The block $\left\{a, b\right\}$ contains only cut-vertices, the triangle $B$ contains two cut-vertices (namely $b$ and $c$) and each of the other two triangles contains one cut-vertex each. Therefore, the number of remaining vertices in these blocks are 0, 1, 2 and 2, respectively. These weights are shown at the bottom-right together with the weights of the cut-vertices which are all one. The sum of the weights is therefore $0+1+2+2+3\cdot 1=8$ which is equal to the number of vertices of $G$. The centroids of $(T,w)$ are $b$ and $B$. The removal of the edge between them separates $(T,w)$ into two subtrees of weight 4, each. At the bottom-right is depicted the centroid-rooted tree in which all the edges are directed towards these centroids. As our example lacks the definition a total order $\prec$, the orientation of the edge between the two centroids is chosen arbitrarily.
  • Figure 4: Amortized enumeration time in milliseconds.
  • Figure 5: Positive-weighted free trees of weight 5
  • Figure 6: Block Trees of Graphs on 6 vertices

Theorems & Definitions (16)

  • Corollary 1
  • Theorem 1
  • Lemma 1
  • Lemma 2
  • Theorem 2
  • Theorem 3
  • Definition 1
  • Definition 2
  • Lemma 3
  • Definition 3
  • ...and 6 more