scispace - formally typeset
Open AccessJournal ArticleDOI

On exact algorithms for treewidth

Reads0
Chats0
TLDR
In this article, the authors present a dynamic programming algorithm for computing the treewidth of a graph with running time Oa(2n) using only polynomial space.
Abstract
We give experimental and theoretical results on the problem of computing the treewidth of a graph by exact exponential-time algorithms using exponential space or using only polynomial space. We first report on an implementation of a dynamic programming algorithm for computing the treewidth of a graph with running time Oa(2n). This algorithm is based on the old dynamic programming method introduced by Held and Karp for the Traveling Salesman problem. We use some optimizations that do not affect the worst case running time but improve on the running time on actual instances and can be seen to be practical for small instances. We also consider the problem of computing Treewidth under the restriction that the space used is only polynomial and give a simple Oa(4n) algorithm that requires polynomial space. We also show that with a more complicated algorithm using balanced separators, Treewidth can be computed in Oa(2.9512n) time and polynomial space.

read more

Content maybe subject to copyright    Report

On exact algorithms for treewidth
Hans L. Bodlaender
Fedor V. Fomin
Arie M. C. A. Koster
Dieter Kratsch
Dimitrios M. Thilikos
Department of Information and Computing Sciences,
Utrecht University
Technical Report UU-CS-2006-032
www.cs.uu.nl
ISSN: 0924-3275

On exact algorithms for treewidth
Hans L. Bodlaender
Fedor V. Fomin
Arie M.C.A. Koster
§
Dieter Kratsch
Dimitrios M. Thilikos
k
Abstract
We give experimental and theoretical results on the problem of computing the
treewidth of a graph by exact exponential time algorithms using exponential space
or using only polynomial space. We first report on an implementation of a dynamic
programming algorithm for computing the treewidth of a graph with running time
O
(2
n
). This algorithm is based on the old dynamic programming method introduced
by Held and Karp for the Traveling Salesman problem. We use some optimiza-
tions that do not affect the worst case running time but improve on the running time
on actual instances and can be seen to be practical for small instances. However,
our experiments show that the space used by the algorithm is an important factor to
what input sizes the algorithm is effective. For this purpose, we settle the problem
of computing treewidth under the restriction that the space used is only polynomial.
In this direction we give a simple O
(4
n
) algorithm that requires polynomial space.
We also show that with a more complicated algorithm, using balanced separators,
Treewidth can be computed in O
(2.9512
n
) time and polynomial space.
1 Introduction
The use of treewidth in several application areas requires efficient algorithms for computing
the treewidth and optimal width tree decompositions of given graphs. In the past years,
This research was partially supported by the project Treewidth and Combinatorial Optimization with
a grant from the Netherlands Organization for Scientific Research NWO and by the Research Council
of Norway and by the DFG research group ”Algorithms, Structure, Randomness” (Grant number GR
883/9-3, GR 883/9-4). The research of the last author was supported by the Spanish CICYT project
TIN-2004-07925 (GRAMMARS).
Institute of Information and Computing Sciences, Utrecht University, P.O. Box 80.089, 3508 TB
Utrecht, the Netherlands. hansb@cs.uu.nl
Department of Informatics, University of Bergen, N-5020 Bergen, Norway. fomin@ii.uib.no
§
Konrad-Zuse-Zentrum f¨ur Informationstechnik Berlin, Takustraße 7, D-14195 Berlin, Germany.
koster@zib.de
LITA, Universit´e de Metz, F-507045 Metz Cedex 01, France. kratsch@sciences.univ-metz.fr
k
Department of Mathematics, National and Capodistrian University of Athens, Panepistimioupolis,
GR-15784, Athens, Greece. sedthilk@math.uoa.gr
1

a large number of papers appeared studying the problem to determine the treewidth of a
graph, including both theoretical and experimental results, see e.g., [4] for an overview.
Since the problem is NP complete [1], there is a little hope in finding an algorithm which
can determine the treewidth of a graph in polynomial time. There are several exponential
time (exact) algorithms known in the literature for the treewidth problem. (See the surveys
[11, 26] for an introduction to the area of exponential algorithms.) Arnborg et al. [1] gave
an algorithm that tests in O(n
k+2
) time if a given graph has treewidth at most k.Itis
not hard to observe that the algorithm runs for variable k in O
(2
n
)time
1
. See also [22].
In 2004, Fomin et al. [12] presented an O(1.9601
n
) algorithm to compute the treewidth
based on minimal separators and potential maximal cliques of graphs, using the paradigms
introduced by Bouchitt´e and Todinca [7, 6]. The analysis of the algorithm of Fomin et
al. from [12] was improved by Villanger [25], who showed that the treewidth of a graph
can be computed in O(1.8899
n
) time. While the algorithms from [12, 25] provide the best
known running time, they are based on computations of potential maximal cliques and are
difficult to implement.
In this paper we try another approach to compute the treewidth, which seems to be
much more suitable for implementations. While Treewidth is usually formulated as the
problem to find a tree decomposition of minimum width, it is possible to formulate it as
a problem to find a linear ordering of (the vertices of) the graph such that a specific cost
measure of the ordering is as small as possible. Several existing algorithms and heuristics for
treewidth are based on this linear ordering characterization of treewidth, see e.g., [2, 8, 15].
In this paper, we exploit this characterization again, and a lesser known property of the
characterization. Thus, we can show that an old dynamic programming method, introduced
by Held and Karp for the Traveling Salesman problem [18] in 1962 can be adapted
and used to compute the treewidth of given graphs. Suppressing polynomial factors, time
and space bounds of the algorithm for treewidth is the same as that of the algorithm of
Held and Karp for TSP: O
(2
n
) running time and O
(2
n
) space. The Held-Karp algorithm
tabulates some information for pairs (S, v), where S is a subset of the vertices, and v is
a vertex (from S); a small variation of the scheme allows us to save a factor O(n)onthe
space for the problems considered in this paper: we tabulate information for all subsets
S V of vertices.
We have carried out experiments that show that the method works well to compute
the treewidth of graphs of size up to around forty to fifty. For larger graphs, the space
requirements of the algorithm appear to be the bottleneck. Thus, this raises the question:
are there polynomially space algorithms to compute the treewidth having running time
of the form O
(c
n
)forsomeconstantc? In this paper we answer this question in the
affirmative. We show that there is an algorithm to compute the treewidth that uses O
(4
n
)
time and only polynomial space. This algorithm uses a simple recursive divide-and-conquer
technique and is similar to the polynomial space algorithm of Gurevich and Shelah [17] for
Hamiltonian Path.
1
We sometimes use O
-notation which is a modified O-notation introduced by Woeginger [26] suppress-
ing all polynomially bounded factors.
2

Finally, we further provide theoretical results improving upon the running time for
the polynomial space algorithm for treewidth. Using balanced separators, we obtain an
algorithm for Treewidth that uses O
(2.9512
n
) time and polynomial space. It should be
noted that this result is only theoretical: the algorithm must consider many subsets of a
specific size of the set of vertices. Thus, we did not carry out an experimental evaluation
of the polynomial space algorithms.
2 Preliminaries
2.1 Definitions
We assume the reader to be familiar with standard notions from graph theory. Throughout
this paper, n = |V | denotes the number of vertices of graph G =(V,E). A graph G =
(V,E)ischordal, if every cycle in G of length at least four has a chord, i.e., there is an edge
connecting two non-consecutive vertices in the cycle. A triangulation of a graph G =(V,E)
is a graph H =(V, F)thatcontainsG as subgraph (F E) and is chordal. H =(V, F)
is a minimal triangulation of G =(V, E)ifH is a triangulation of G and there does not
exist a triangulation H
0
=(V, F
0
)ofG with H
0
a proper subgraph of H.Foragraph
G =(V, E) and a set of vertices W V , the subgraph of G induced by W is the graph
G[W ]=(W, {{v,w}∈E | v, w W }).
Definition 1 A tree decomposition of a graph G =(V,E) is a pair ({X
i
| i I},T =
(I,F)) with {X
i
| i I} a collection of subsets of V ,calledbags,andT =(I,F) atree,
such that
For al l v V , there exists an i I with v X
i
.
For al l {v, w}∈E, there exists an i I with v, w X
i
.
For al l v V ,thesetI
v
= {i I | v X
i
} forms a connected subgraph (subtree) of
T .
The width of tree decomposition ({X
i
| i I},T =(I,F)) equals max
iI
|X
i
|−1.The
treewidth of a graph G, tw(G), is the minimum width of a tree decomposition of G.
The following alternative characterization of treewidth is well known, see e.g., [3].
Proposition 2 Let G =(V,E) be a graph, k an integer. The following are equivalent.
1. G has treewidth at most k.
2. G has a triangulation H =(V,F) with the maximum size of a clique in H at most
k +1.
3. G has a minimal triangulation H =(V,F) with the maximum size of a clique in H
at most k +1.
3

2.2 Treewidth as a Linear Ordering Problem
It is well known that treewidth can be formulated as a linear ordering problem, and this
is exploited in several algorithms for determining the treewidth, see e.g., [2, 8, 9, 15].
A linear ordering of a graph G =(V,E) is a bijection π : V →{1, 2,...,|V |}.Fora
linear ordering π and v V ,wedenotebyπ
<,v
the set of vertices that appear before
v in the ordering: π
<,v
= {w V | π(w) (v)}. Likewise, we define π
,v
, π
>,v
,
and π
,v
. A linear ordering π of G is a perfect elimination scheme, if for each vertex,
its higher numbered neighbors form a clique, i.e., for each i ∈{1, 2,...,|V |},theset
{π
1
(j) |{π
1
(i)
1
(j)}∈E j>i} is a clique. It is well-known that a graph has a
perfect elimination scheme, if and only if it is chordal, see [16, Chapter 4].
For arbitrary graphs G, a linear ordering π defines a triangulation H of G that has π
as perfect elimination scheme. The triangulation with respect to π of G is built as follows:
first, set G
0
= G,andthenfori =1ton, G
i
is obtained from G
i1
by adding an edge
between each pair of non adjacent higher numbered neighbors of π
1
(i). One can observe
that the resulting graph H = G
n
is chordal, has π as perfect elimination scheme, and
contains G as subgraph.
For our algorithms, we want to avoid working with the triangulation explicitly. The
following predicate allows us to ‘hide’ the triangulation. For a linear ordering π,andtwo
vertices v, w V ,wesayP
π
(v, w) holds, if and only if there is a path v, x
1
,x
2
,...,x
r
,w
from v to w in G, such that for each i,1 i r, π(x
i
) (v), and π(x
i
) (w). In other
words, P
π
(v, w) is true, if and only if there is a path from v to w such that all internal
vertices are before v and w in the ordering π. Note that the definition implies that P
π
(v, w)
is always true when v = w or when {v, w}∈E.
With R
π
(v), we denote the number of higher numbered vertices w V for which
P
π
(v, w) holds, i.e., R
π
(v)=|{w V | π(w) (v) P
π
(v, w)}|. The proof of the
following proposition is an immediate consequence of a lemma of Rose et al. [21]. (See
also [3, 8, 9].)
Proposition 3 Let G =(V,E) be a graph, and k a non-negative integer. The treewidth of
G is at most k iff there is a linear ordering π of G, such that for each v V , R
π
(v) k.
Proof: We use the following result from [21]. For a given graph G =(V,E), and a linear
ordering π, we have for each pair of disjoint vertices v, w E: { v, w} is an edge in the
triangulation H =(V, E
H
) with respect to π, if and only if P
π
(v, w) is true. Also, we use
the result of Fulkerson and Gross [13] that if π is a perfect elimination scheme of chordal
graph H =(V,E
H
), then the maximum clique size of H is one larger than the maximum
over all v V of the number of higher numbered neighbors |{v, w}∈E
H
| π(w) (v)}|.
Now, the treewidth of G is at most k, if and only if there is a triangulation H =(V,E
H
)
of G with maximum clique size at most k (Proposition 3), if and only if for a perfect
elimination scheme π of triangulation H,wehavethatforeachv V :
k +1 ≤|{v, w}∈E
H
| π(w) (v)}|
= |{w V | P
π
(v, w) π(w) (v)}|
= R
π
(v)
4

Citations
More filters
Proceedings ArticleDOI

Hypertree Decompositions: Questions and Answers

TL;DR: The present paper reviews' in form of questions and answers' the main relevant concepts and algorithms and surveys selected related work including applications and test results.
Posted Content

Preprocessing for Treewidth: A Combinatorial Analysis through Kernelization

TL;DR: This paper shows that Treewidth has a kernel with O(l3) vertices, where l denotes the size of a vertex cover, and a kernel of polynomial size, which implies that given an instance (G, k) ofTreewidth the authors can efficiently reduce its size to O((l*)4) Vertices.
Journal ArticleDOI

Positive-instance driven dynamic programming for treewidth

TL;DR: This work takes the dynamic programming scheme due to Bouchitté and Todinca for treewidth computation, which is based on minimal separators and potential maximal cliques, and design a variant (for the decision version of the problem) with a natural PID implementation, and gives a running time bound in terms of the number of positive subproblem instances.
Proceedings ArticleDOI

SAT-Based Approaches to Treewidth Computation: An Evaluation

TL;DR: The applicability of Boolean satisfiability (SAT) based approaches to determining the tree widths of graphs, and at the same time obtaining an associated optimal tree-decomposition, is studied.
Journal ArticleDOI

Tractability of most probable explanations in multidimensional Bayesian network classifiers

TL;DR: This paper provides upper bounds for the complexity of the most probable explanations and marginals of class variables conditioned to an instantiation of all feature variables and proposes efficient strategies for bounding the complexityof multidimensional Bayesian network classifiers during the learning process.
References
More filters
Book

Algorithmic graph theory and perfect graphs

TL;DR: This new Annals edition continues to convey the message that intersection graph models are a necessary and important tool for solving real-world problems and remains a stepping stone from which the reader may embark on one of many fascinating research trails.
Journal ArticleDOI

Complexity of finding embeddings in a k -tree

TL;DR: This work determines the complexity status of two problems related to finding the smallest number k such that a given graph is a partial k-tree and presents an algorithm with polynomially bounded (but exponential in k) worst case time complexity.
Journal ArticleDOI

Incidence matrices and interval graphs

TL;DR: In this article, the problem of determining when a graph is an interval graph is a special case of the following problem concerning (0, 1)-matrices: when can the rows of such a matrix be permuted so as to make the 1's in each colum appear consecutively.
Journal ArticleDOI

Algorithmic Aspects of Vertex Elimination on Graphs

TL;DR: A graph-theoretic elimination process which is related to performing Gaussian elimination on sparse symmetric positive definite systems of linear equations is considered, and it is conjecture that the problem of finding a minimum ordering is NP-complete.
Journal ArticleDOI

A partial k -arboretum of graphs with bounded treewidth

TL;DR: This survey paper wants to give an overview of many classes of graphs that can be seen to have a uniform upper bound on the treewidth of graphs in the class.
Related Papers (5)
Frequently Asked Questions (15)
Q1. What are the contributions mentioned in the paper "On exact algorithms for treewidth" ?

The authors first report on an implementation of a dynamic programming algorithm for computing the treewidth of a graph with running time O∗ ( 2n ). This algorithm is based on the old dynamic programming method introduced by Held and Karp for the Traveling Salesman problem. The authors use some optimizations that do not affect the worst case running time but improve on the running time on actual instances and can be seen to be practical for small instances. The authors also show that with a more complicated algorithm, using balanced separators, Treewidth can be computed in O∗ ( 2. 9512n ) time and polynomial space. 

There are here several angles for interesting further work. 

A graph G = (V, E) is chordal, if every cycle in G of length at least four has a chord, i.e., there is an edge connecting two non-consecutive vertices in the cycle. 

it can be used to obtain better lower bounds (by running the algorithm on a minor of the input graph), or upper bounds (by dropping table entries when space or time does not permit us to compute the full tables). 

Let π′ ∈ Π(V ) be a permutation, obtained by first taking the vertex in S−{v} in the order as they appear in π, then taking v, and then taking the vertices in V − S in an arbitrary order. 

For a given graph G = (V, E), and a linear ordering π, the authors have for each pair of disjoint vertices v, w ∈ E: {v, w} is an edge in the triangulation H = (V, EH) with respect to π, if and only if Pπ(v, w) is true. 

To estimate the running time, suppose that Recursive-Treewidth(G,L,S) costs T (n, r) time with n the number of vertices of G and r = |S|. 

As f(0.25) < 2.9512,and f(γ) < 2.9512, the authors have for all α with 0 < α ≤ 0.25 or γ ≤ α < 1, that f(α) < 2.9512, and hence that the algorithm uses O∗(2.9512n) time. 

The algorithm can also be used as a lower bound heuristic: give the algorithm as ‘upper bound’ a conjectured lower bound `: when it terminates, it either has found the exact treewidth, or the authors know that ` is indeed a lower bound for the treewidth of the input graph. 

In [5, 15, 20], a lower bound on tw(G′) is computed to obtain a lower bound for G. With Algorithm 3, the authors can compute tw(G′) exactly to obtain a lower bound for tw(G). 

In several instances reported in [24], the best bound obtained from a few upper bound heuristics, and thelower bound obtained by the LBP+(MMD+) heuristic match, and then the authors have obtained in a relatively fast way an exact bound on the treewidth of the instance graph. 

While Treewidth is usually formulated as the problem to find a tree decomposition of minimum width, it is possible to formulate it as a problem to find a linear ordering of (the vertices of) the graph such that a specific cost measure of the ordering is as small as possible. 

This procedure keeps as invariants that π ∈ Π(V, W ), i.e., π ends with W , that tw(G) = maxv∈V Rπ(v), and that each connected component of G[V − W ] contains at most (|V | − |W |+1)/2 vertices. 

Algorithm 2 Recursive-Treewidth(Graph G, Vertex Set L, Vertex Set S)if |S|=1 then Suppose S = {v}. return Q(L, v) end if Set Opt = ∞. for all sets S ′ ⊆ S, |S ′| = b|S|/2c doCompute v1 = Recursive-Treewidth(G, L, S ′); Compute v2 = Recursive-Treewidth(G, L ∪ S ′, S − S ′); Set Opt = min {Opt, max {v1, v2}};end for return OptIn this section, the authors comment on the experiments the authors have carried out for the dynamic programming algorithm for computing the treewidth of a given graph. 

In a similar way as pathwidth can be reformulated as vertex separation number, this problem can be formulated as linear ordering problem too.