Treewidth


In graph theory, the treewidth of an undirected graph is an integer number which specifies, informally, how far the graph is from being a tree. The smallest treewidth is 1; the graphs with treewidth 1 are exactly the trees and the forests. An example of graphs with treewidth at most 2 are the series–parallel graphs. The maximal graphs with treewidth exactly are called -trees, and the graphs with treewidth at most are called partial -trees. Many other well-studied graph families also have bounded treewidth.
Treewidth may be formally defined in several equivalent ways: in terms of the size of the largest vertex set in a tree decomposition of the graph, in terms of the size of the largest clique in a chordal completion of the graph, in terms of the maximum order of a haven describing a strategy for a pursuit–evasion game on the graph, or in terms of the maximum order of a bramble, a collection of connected subgraphs that all touch each other.
Treewidth is commonly used as a parameter in the parameterized complexity analysis of graph algorithms. Many algorithms that are NP-hard for general graphs, become easier when the treewidth is bounded by a constant.
The concept of treewidth was originally introduced by under the name of dimension. It was later rediscovered by, based on properties that it shares with a different graph parameter, the Hadwiger number. Later it was again rediscovered by and has since been studied by many other authors.

Definition

A tree decomposition of a graph is a tree in which each node is associated with a subset of vertices called a "bag".. The bags must satisfy the following properties:
  1. Each graph vertex is contained in at least one bag:
  2. If bags and both contain a vertex, then all bags associated with nodes in the path of between and also contain as well. Equivalently, the bags containing vertex are associated with a connected subtree of.
  3. For every edge in the graph, there is at least one bag that contains both and. That is, vertices are adjacent in the graph only when their corresponding subtrees have a node in common.
The width of a tree decomposition is the size of its largest bag minus one. The treewidth of a graph is the minimum width among all possible tree decompositions of. In this definition, the size of the largest set is diminished by one in order to make the treewidth of a tree equal to one.
Equivalently, the treewidth of is one less than the size of the largest clique in the chordal graph containing with the smallest clique number. A chordal graph with this clique size may be obtained by adding to an edge between every two vertices for which at least one bag contains both vertices.
Treewidth may also be characterized in terms of havens, functions describing an evasion strategy for a certain pursuit–evasion game defined on a graph. A graph has treewidth if and only if it has a haven of order but of no higher order, where a haven of order is a function that maps each set of at most vertices in into one of the connected components of and that obeys the monotonicity property that whenever.
A similar characterization can also be made using brambles, families of connected subgraphs that all touch each other. The order of a bramble is the smallest hitting set for the family of subgraphs, and the treewidth of a graph is one less than the maximum order of a bramble.

Examples

Every complete graph has treewidth. This is most easily seen using the definition of treewidth in terms of chordal graphs: the complete graph is already chordal, and adding more edges cannot reduce the size of its largest clique.
A connected graph with at least two vertices has treewidth 1 if and only if it is a tree. A tree has treewidth one by the same reasoning as for complete graphs. Conversely, if a graph has a cycle, then every chordal completion of the graph includes at least one triangle consisting of three consecutive vertices of the cycle, from which it follows that its treewidth is at least two.

Bounded treewidth

Graph families with bounded treewidth

For any fixed constant, the graphs of treewidth at most are called the partial -trees. Other families of graphs with bounded treewidth include the cactus graphs, pseudoforests, series–parallel graphs, outerplanar graphs, Halin graphs, and Apollonian networks. The control-flow graphs arising in the compilation of structured programs also have bounded treewidth, which allows certain tasks such as register allocation to be performed efficiently on them.
The planar graphs do not have bounded treewidth, because the grid graph is a planar graph with treewidth exactly. Therefore, if is a minor-closed graph family with bounded treewidth, it cannot include all planar graphs. Conversely, if some planar graph cannot occur as a minor for graphs in family, then there is a constant such that all graphs in have treewidth at most. That is, the following three conditions are equivalent to each other:
  1. is a minor-closed family of bounded-treewidth graphs;
  2. One of the finitely many forbidden minors characterizing is planar;
  3. is a minor-closed graph family that does not include all planar graphs.

    Forbidden minors

For every finite value of, the graphs of treewidth at most may be characterized by a finite set of forbidden minors. Each of these sets of forbidden minors includes at least one planar graph.
For larger values of, the number of forbidden minors grows at least as quickly as an exponential function of. However, known upper bounds on the size and number of forbidden minors are much higher than this lower bound.

Algorithms

Computing the treewidth

It is -complete to determine whether a given graph has treewidth at most a given variable.
However, when is any fixed constant, the graphs with treewidth can be recognized, and a width tree decomposition constructed for them, in linear time. The time dependence of this algorithm on is exponential.
Due to the roles the treewidth plays in an enormous number of fields, different practical and theoretical algorithms computing the treewidth of a graph were developed. Depending on the application on hand, one can prefer better approximation ratio, or better dependence in the running time from the size of the input or the treewidth.
The table below provides an overview of some of the treewidth algorithms. Here is the treewidth and is the number of vertices of an input graph.
Each of the algorithms outputs in time a decomposition of width given in the Approximation column. For example, the algorithm of in time either constructs a tree decomposition of the input graph of width at most or reports that the treewidth of is more than. Similarly, the algorithm of in time either constructs a tree decomposition of the input graph of width at most or reports that the treewidth of is more than. improved the width of the decomposition to in the same running time.
Approximationreference
exact
exact
exact
exact

It is not known whether determining the treewidth of planar graphs is NP-complete, or whether their treewidth can be computed in polynomial time.
In practice, an algorithm of can determine the treewidth of graphs with up to 100 vertices and treewidth up to 11, finding a chordal completion of these graphs with the optimal treewidth.
For larger graphs, one can use search-based techniques such as branch and bound search to compute the treewidth. These algorithms are anytime in that when stopped early, they will output an upper bound on the treewidth. An algorithm of this type was proposed in 2004 by Vibhav Gogate and Rina Dechter. To provide a lower bound on treewidth for the branches of this search, they construct a graph minor by repeatedly contracting an edge between a minimum degree vertex and one of its neighbors, until just one vertex remains. The maximum of the minimum degree over these constructed minors is guaranteed to be a lower bound on the treewidth of the graph. Alex Dow and Rich Korf further improved this algorithm using best-first search.

Solving other problems on graphs of small treewidth

At the beginning of the 1970s, it was observed that a large class of combinatorial optimization problems defined on graphs could be efficiently solved by non serial dynamic programming as long as the graph had a bounded dimension, a parameter shown to be equivalent to treewidth by. Later, several authors independently observed at the end of the 1980s that many algorithmic problems that are NP-complete for arbitrary graphs may be solved efficiently by dynamic programming for graphs of bounded treewidth, using the tree-decompositions of these graphs.
As an example, the problem of coloring a graph of treewidth may be solved by using a dynamic programming algorithm on a tree decomposition of the graph. For each bag of the tree decomposition, and each partition of the vertices of into color classes, the algorithm determines whether that coloring is valid and can be extended to all descendant nodes in the tree decomposition, by combining information of a similar type computed and stored at those nodes. The resulting algorithm finds an optimal coloring of an -vertex graph in time, a time bound that makes this problem fixed-parameter tractable.