Component Twin-Width: Graph Parameter Insights
- Component twin-width is defined through contraction sequences that track the maximum size of red-connected components, offering a refined measure over traditional twin-width.
- It enables improved algorithmic bounds for problems like q-COLORING and #H-Coloring by providing tighter complexity guarantees compared to clique-width approaches.
- The parameter extends to semiring generalisations and binary CSP frameworks, leading to efficient FPT and exponential-time algorithms for various graph problems.
Component twin-width, denoted , is a graph parameter defined through contraction sequences of trigraphs. In contrast to twin-width, which measures the maximum red-degree occurring in an intermediate trigraph, component twin-width measures the maximum size of any red-connected component that appears during the sequence. The parameter was developed as an algorithmically useful refinement of the contraction-based viewpoint, especially for graph homomorphism counting and for binary constraint satisfaction problems and their semiring generalisations (Baril et al., 5 Sep 2025, Baril et al., 2022, Heinrich et al., 2023).
1. Formal definition through trigraphs and contractions
A trigraph is a triple
where is a simple graph of black edges and is a looped graph of red edges, with . A red-connected component is a connected component of , and loops count only to keep a vertex in the same component (Baril et al., 5 Sep 2025).
If is a partition of , the contracted trigraph has vertex-set . Its black edges are the pairs 0 such that 1 and 2, while its red edges are the pairs 3 such that 4, 5, and 6, together with all loops 7 for blocks of size at least 8. Informally, a red edge represents partial or mixed adjacency and a black edge complete adjacency (Baril et al., 5 Sep 2025).
A contraction sequence of a graph 9 is a sequence of trigraphs
0
such that 1 has no red edges and is isomorphic to 2, and each 3 is obtained from 4 by merging two vertices 5 into one vertex 6, coloring every new adjacency black if both incident edges were black, absent if both were absent, and red otherwise. Equivalently, the sequence is induced by a sequence of partitions in which each step merges two parts (Baril et al., 5 Sep 2025).
The component twin-width 7 is the minimum, over all contraction sequences of 8, of the maximum size of any red-connected component that ever appears. In the edge-labelled generalisation, the same definition is phrased for edge-labelled graphs by introducing a distinguished red outcome whenever a block-pair is not uniformly labelled (Baril et al., 2022).
2. Relation to twin-width and the contraction formalism
Twin-width and component twin-width use the same contraction-based language but optimise different width measures. For twin-width, a contraction sequence is evaluated by the maximum red-degree of any intermediate trigraph, and 9 is the minimum such value over complete contraction sequences. Component twin-width instead tracks the size of red-connected components (Heinrich et al., 2023).
This distinction matters algorithmically. Red-degree controls local impurity around a vertex, whereas red-connected component size controls how far mixed adjacencies can propagate as a connected obstruction during contraction. The 2025 comparison with clique-width treats component twin-width as a parameter that describes desirable computational properties of graphs and shows that previously known exponential and double exponential comparisons with clique-width can be improved to linear bounds (Baril et al., 5 Sep 2025).
Several basic graph classes admit exact component twin-width values. Cographs are exactly those graphs of 0, and odd or even cycles of length at least 1 have 2 (Baril et al., 2022). For complete graphs, the same framework yields 3, which is used directly in the complexity analysis of 4-COLORING (Baril et al., 2022).
3. Tight linear comparison with clique-width
A central structural theorem of Baril et al. states that for every graph 5,
6
Equivalently,
7
The result is described as a tight linear comparison with clique-width (Baril et al., 5 Sep 2025).
For the inequality 8, the proof starts from a contraction sequence witnessing 9. In each trigraph 0, one maintains for every red-connected component 1 a 2-labelled clique-width expression 3 constructing exactly the induced subgraph 4 while respecting the current partition of 5 into parts. When two parts are merged, the stored expressions of the affected subcomponents are combined by disjoint union, black edges are added exactly where the trigraph records complete adjacency, and the labels of the merged parts are relabelled into one. Since each red-connected component has size at most 6, at most 7 labels are needed (Baril et al., 5 Sep 2025).
For the inequality 8, the proof fixes a 9-expression for 0 and recursively collapses it into a contraction sequence. Single-vertex constructions need no action; relabellings are handled by contracting the corresponding parks at the end; edge-creation does not increase red-component size when merging same-label parks because vertices with the same label have identical neighborhood profiles towards all other labels; and a disjoint union 1 is processed by collapsing each side separately and then contracting corresponding parks label by label. After the first park-contraction the trigraph has at most 2 parks, and no red-connected component ever exceeds size 3 (Baril et al., 5 Sep 2025).
Because the proof is constructive, the paper notes two direct consequences. First, the linear bounds between component twin-width and clique-width entail natural approximations of component twin-width by making use of results known for clique-width. Second, the construction naturally extends to related parameters, and as a showcase proves that total twin-width and linear clique-width can be related via a tight quadratic bound (Baril et al., 5 Sep 2025).
4. Algorithms for #H-Coloring parameterised by component twin-width
For a fixed template graph 4, the problem 5-Coloring asks for the number of homomorphisms 6 such that 7 implies 8. Component twin-width supports two distinct algorithmic parameterisations of this problem (Baril et al., 5 Sep 2025).
The first is an FPT algorithm parameterised by 9. Suppose an 0-vertex graph 1 is given together with a contraction sequence of component twin-width 2. Then for any fixed template 3 on 4 vertices there is an algorithm running in
5
time that computes 6-Coloring7. The dynamic program proceeds along the contraction sequence. At step 8, for each red-connected component 9 and each assignment 0, the table entry 1 counts the 2-colorings of the vertices represented by 3 that map each part into the allowed set 4. When two parts are merged, only the unique affected red-connected component is updated, and the cost per merge is controlled by the bound 5 (Baril et al., 5 Sep 2025).
The second is a fine-grained algorithm parameterised by 6. If 7 is a fixed template graph with 8 and an optimal contraction sequence of 9 is given, then 0-Coloring1 for an arbitrary input graph 2 on 3 vertices can be computed in time
4
Here the dynamic program is run over the contraction sequence of 5. At step 6, each red-connected component of 7 has at most 8 parts, and the state space is organised by maps that partition 9 into at most 0 parts, reflecting which part of the current contracted template each input vertex may use (Baril et al., 5 Sep 2025).
These bounds dominate the previously best clique-width-based algorithms in the comparison made in the 2025 paper. Using 1 and 2, the new algorithms are always at least as fast as the earlier clique-width approaches, and for several graph classes they are strictly faster (Baril et al., 5 Sep 2025).
5. Semiring generalisation and binary CSP
The 2022 work of Baril, Couceiro, and Lagerkvist extends component twin-width from ordinary graphs to edge-labelled graphs and uses it as the organising width measure for BINARY-CSP and several semiring-valued generalisations (Baril et al., 2022).
An edge-labelled graph is a triple
3
where 4 is a finite vertex set, 5 is a finite label set, and 6 assigns a label to each ordered pair. Given a target 7 and a relation 8, a function 9 is an 00-morphism if
01
Ordinary graph homomorphisms arise by choosing 02 and
03
Contraction of an edge-labelled graph by a partition replaces a block-pair by its common label if that label is uniform, and by 04 otherwise (Baril et al., 2022).
The semiring framework is built from a semiring 05, a set of weights 06, and a pre-morphism 07 satisfying additivity, multiplicativity, and 08. This single abstraction captures decision, counting, list-CSP, min-cost and #ArgMinCost, the weighted version of Escoffier et al., and restrictive counting (Baril et al., 2022).
Two general algorithmic theorems are then obtained. If 09 and 10 are fixed and an optimal contraction sequence of the input 11 is given, then 12 can be solved in
13
time. If instead 14 is fixed and an optimal contraction sequence of width 15 is given, then the same problem on an arbitrary 16-vertex input can be solved in
17
These are presented as, respectively, an FPT algorithm and an improved exponential-time algorithm for broad classes of binary constraints (Baril et al., 2022).
The proof architecture is based on dynamic programming across the contraction sequence. The key ingredients are a feasibility lemma for non-red-connected block pairs, a component decomposition lemma expressing a family of partial morphisms as a disjoint union of joins over a partition of the domain, and a loop invariant asserting the correctness of the table entries after each contraction step (Baril et al., 2022).
6. Canonical classes, benchmark examples, and algorithmic significance
Several graph classes serve as canonical benchmarks for component twin-width and its algorithmic consequences. Cographs satisfy 18, so cograph-19-COLORING, including counting, list-counting, and cost variants, runs in
20
improving Wahlström’s previous 21 bound for the counting version. For odd or even cycles 22 with 23, one has 24, giving
25
for all semiring variants, compared to the earlier 26 from clique-width arguments. For 27-COLORING, since 28, the resulting bound is 29; by inclusion–exclusion this can be pushed to 30, but only for unweighted plain coloring (Baril et al., 2022).
The 2025 comparison with clique-width sharpens these examples for the fine-grained 31-Coloring setting (Baril et al., 5 Sep 2025).
| Graph class | 32 | Fine-grained bound |
|---|---|---|
| Cographs with at least one edge | 33 | 34 instead of 35 |
| Cycles of length 36 | 37 | 38 instead of 39 |
| Distance-hereditary (non-cograph) | 40 | 41 instead of 42 |
In these cases, the base of the exponent drops from 43 to 44 for cographs, from 45 to 46 for long cycles, and from 47 to 48 for distance-hereditary graphs (Baril et al., 5 Sep 2025).
Taken together, these results identify component twin-width as a width measure that supports both fixed-parameter tractability under 49 and improved exponential-time algorithms controlled by 50. The linear comparison
51
explains why clique-width-based methods can often be transferred to the component twin-width setting with no asymptotic loss and, in benchmark classes, with strict gains in the exponent. The semiring formulation further shows that these gains are not restricted to ordinary graph coloring, but extend uniformly to counting, list, weighted, and cost variants of binary constraint problems (Baril et al., 5 Sep 2025, Baril et al., 2022).