introduction to treewidth

75
Treewidth 1A: Introduction Saket Saurabh The Institute of Mathematical Sciences, India ASPAK 2014, March 3-8

Upload: aspak2014

Post on 29-Jun-2015

60 views

Category:

Education


2 download

TRANSCRIPT

Page 1: Introduction to Treewidth

Treewidth 1A: Introduction

Saket Saurabh

The Institute of Mathematical Sciences, India

ASPAK 2014, March 3-8

Page 2: Introduction to Treewidth

Motivation

I Most interesting graph problems are NP-complete.

I Many algorithms developed for special classes of graphs.

I Important classes of graphs: decomposable in some way; liketrees.

Page 3: Introduction to Treewidth

I Introduction and definition

I Part I: Algorithms for bounded treewidth graphs.

I Part II: Graph-theoretic properties of treewidth.

I Part III: Applications for general graphs.

I Part IV: Irrelevant Vertices – Planar Vertex Deletion.

Page 4: Introduction to Treewidth

The Party Problem

The Party ProblemProblem: Invite some colleagues for a party.Maximize: The total fun factor of the invited people.Constraint: Everyone should be having fun.Do not invite a colleague and his direct boss at the sametime!

Page 5: Introduction to Treewidth

The Party Problem

The Party ProblemProblem: Invite some colleagues for a party.Maximize: The total fun factor of the invited people.Constraint: Everyone should be having fun.Do not invite a colleague and his direct boss at the sametime!

Page 6: Introduction to Treewidth

The Party Problem

The Party ProblemProblem: Invite some colleagues for a party. Maximize:The total fun factor of the invited people.Constraint: Everyone should be having fun.Do not invite a colleague and his direct boss at the sametime!

6

644

5

2I Input: A tree with

weights on thevertices.

I Task: Find anindependent set ofmaximum weight.

Page 7: Introduction to Treewidth

The Party Problem

The Party ProblemProblem: Invite some colleagues for a party. Maximize:The total fun factor of the invited people.Constraint: Everyone should be having fun.Do not invite a colleague and his direct boss at the sametime!

2

5

4 4 6

6

I Input: A tree withweights on thevertices.

I Task: Find anindependent set ofmaximum weight.

Page 8: Introduction to Treewidth

Solving the Party Problem

Dynamic programming paradigm: We solve a large number ofsubproblems that depend on each other. The answer is a singlesubproblem.

Tv : the subtree rooted at v .A[v ]: max. weight of an independent set in Tv

B[v ]: max. weight of an independent set in Tv that does notcontain v

Goal: determine A[r ] for the root r .

Method:Assume v1, . . . , vk are the children of v . Use the recurrence relations

B[v ] =∑k

i=1 A[vi ]

A[v ] = max{B[v ] , w(v) +∑k

i=1 B[vi ]}

The values A[v ] and B[v ] can be calculated in a bottom-up order(the leaves are trivial).

Page 9: Introduction to Treewidth

Solving the Party Problem

Dynamic programming paradigm: We solve a large number ofsubproblems that depend on each other. The answer is a singlesubproblem.

Tv : the subtree rooted at v .A[v ]: max. weight of an independent set in Tv

B[v ]: max. weight of an independent set in Tv that does notcontain v

Goal: determine A[r ] for the root r .

Method:Assume v1, . . . , vk are the children of v . Use the recurrence relations

B[v ] =∑k

i=1 A[vi ]

A[v ] = max{B[v ] , w(v) +∑k

i=1 B[vi ]}

The values A[v ] and B[v ] can be calculated in a bottom-up order(the leaves are trivial).

Page 10: Introduction to Treewidth

We continue with Maximum Independent Set, now we try tosolve the problem for an arbitrary graph G . The idea is again toperform dynamic programming, but this time instead of going fromleaves to the root, we go via separating set of vertices.

Page 11: Introduction to Treewidth

We continue with Maximum Independent Set, now we try tosolve the problem for an arbitrary graph G . The idea is again toperform dynamic programming, but this time instead of going fromleaves to the root, we go via separating set of vertices.

Let us fix an ordering σ = (v1, v2, . . . , vn) of the vertices of G . Forj ∈ {1, 2, . . . , n}, we use Vj to denote the set of the first j verticesof σ.

Page 12: Introduction to Treewidth

We continue with Maximum Independent Set, now we try tosolve the problem for an arbitrary graph G . The idea is again toperform dynamic programming, but this time instead of going fromleaves to the root, we go via separating set of vertices.

Let us fix an ordering σ = (v1, v2, . . . , vn) of the vertices of G . Forj ∈ {1, 2, . . . , n}, we use Vj to denote the set of the first j verticesof σ.

G [Vn] = G . The boundary of Vj is the subset of vertices of Vj

adjacent to vertices outside Vj .

Page 13: Introduction to Treewidth

a

b c

d e

f g h

a b

c

d

h

b

cd

e e

f

e

i

g

d

h

ei

a

ab

abc

bc

bcd

bcde

cde

de

deg

degf

deg

de

dehehehihii

Figure : A graph.

For example, for σ = (a, b, c , d , e, f , g , h, i) and j = 5, we haveVj = {a, b, c , d , e} and ∂(Vj) = {d , e}. Every path from v ∈ Vj tou 6∈ Vj contains an edge with one endpoint in Vj and the other inV (G ) \ Vj , and hence every uv -path contains a vertex from ∂(Vj).In other words ∂(Vj) separates Vj from the other vertices of G .

Page 14: Introduction to Treewidth

a

b c

d e

f g h

a b

c

d

h

b

cd

e e

f

e

i

g

d

h

ei

a

ab

abc

bc

bcd

bcde

cde

de

deg

degf

deg

de

dehehehihii

Figure : A graph.

For example, for σ = (a, b, c , d , e, f , g , h, i) and j = 5, we haveVj = {a, b, c , d , e} and ∂(Vj) = {d , e}. Every path from v ∈ Vj tou 6∈ Vj contains an edge with one endpoint in Vj and the other inV (G ) \ Vj , and hence every uv -path contains a vertex from ∂(Vj).In other words ∂(Vj) separates Vj from the other vertices of G .

Page 15: Introduction to Treewidth

a

b c

d e

f g h

a b

c

d

h

b

cd

e e

f

e

i

g

d

h

ei

a

ab

abc

bc

bcd

bcde

cde

de

deg

degf

deg

de

dehehehihii

Figure : A graph.

For example, for σ = (a, b, c , d , e, f , g , h, i) and j = 5, we haveVj = {a, b, c , d , e} and ∂(Vj) = {d , e}. Every path from v ∈ Vj tou 6∈ Vj contains an edge with one endpoint in Vj and the other inV (G ) \ Vj , and hence every uv -path contains a vertex from ∂(Vj).In other words ∂(Vj) separates Vj from the other vertices of G .

Page 16: Introduction to Treewidth

What do we want?

For an ordering σ, let tσ = max1≤j≤n |∂(Vj)|.

Page 17: Introduction to Treewidth

What do we want?

For an ordering σ, let tσ = max1≤j≤n |∂(Vj)|.We want an algorithm for Maximum Independent Set runningin time 2O(tσ)nO(1).

Page 18: Introduction to Treewidth

What do we want?

For an ordering σ, let tσ = max1≤j≤n |∂(Vj)|.We want an algorithm for Maximum Independent Set runningin time 2O(tσ)nO(1).Let us change track and do something else :D

Page 19: Introduction to Treewidth

t-boundaried graphsA t-boundaried graph is a graph with n vertices and at most tspecial vertices X ⊆ {x1, . . . , xt}. X is called the boundary of G .Special vertices are ∂(Vj).

X

x1

x2

x3

Page 20: Introduction to Treewidth

t-boundaried graphsA t-boundaried graph is a graph with n vertices and at most tspecial vertices X ⊆ {x1, . . . , xt}. X is called the boundary of G .Special vertices are ∂(Vj).

X

x1

x2

x3

Page 21: Introduction to Treewidth

Dynamic Table: Generalization of Party ArgumentFor every subset S of the boundary X , T [S ] is the size of thelargest independent set I such that I ∩ X = S , or −∞ if no such

set exists.

X

x1

x2

x3

Page 22: Introduction to Treewidth

Dynamic TableThe size of the largest independent set I such that I ∩ X = S , or−∞ if no such set exists.

X

x1

x2

x3T [∅] 4T [x1] 4T [x2] 3T [x3] 3T [x1, x2] −∞T [x1, x3] 3T [x2, x3] 3T [x1, x2, x3] −∞

Page 23: Introduction to Treewidth

Dynamic TableThe size of the largest independent set I such that I ∩ X = S , or−∞ if no such set exists.

X

x1

x2

x3T [∅] 4T [x1] 4T [x2] 3T [x3] 3T [x1, x2] −∞T [x1, x3] 3T [x2, x3] 3T [x1, x2, x3] −∞

Page 24: Introduction to Treewidth

Dynamic TableThe size of the largest independent set I such that I ∩ X = S , or−∞ if no such set exists.

X

x1

x2

x3T [∅] 4T [x1] 4T [x2] 3T [x3] 3T [x1, x2] −∞T [x1, x3] 3T [x2, x3] 3T [x1, x2, x3] −∞

Page 25: Introduction to Treewidth

Dynamic TableThe size of the largest independent set I such that I ∩ X = S , or−∞ if no such set exists.

X

x1

x2

x3T [∅] 4T [x1] 4T [x2] 3T [x3] 3T [x1, x2] −∞T [x1, x3] 3T [x2, x3] 3T [x1, x2, x3] −∞

Page 26: Introduction to Treewidth

Dynamic TableThe size of the largest independent set I such that I ∩ X = S , or−∞ if no such set exists.

X

x1

x2

x3T [∅] 4T [x1] 4T [x2] 3T [x3] 3T [x1, x2] −∞T [x1, x3] 3T [x2, x3] 3T [x1, x2, x3] −∞

Page 27: Introduction to Treewidth

IntroduceAdd a vertex xi /∈ X to X . The vertex xi can have arbitraryneighbours in X but no other neighbours.

X

x1

x2

x3

x4

Page 28: Introduction to Treewidth

IntroduceAdd a vertex xi /∈ X to X . The vertex xi can have arbitraryneighbours in X but no other neighbours.

X

x1

x2

x3

x4

Page 29: Introduction to Treewidth

Introduce: Updating the Table T

Suppose xi (here x4) was introduced into X , with closed

neighbourhood N[xi ]. We update the table T .

T [S ] =

T [S ] if xi /∈ S ,

−∞ if xi ∈ S and S ∩ N(xi) 6= ∅,1 + T [S \ xi ] if xi ∈ S and S ∩ N(xi) = ∅.

Update time: O(2t)

Page 30: Introduction to Treewidth

Introduce: Updating the Table T

Suppose xi (here x4) was introduced into X , with closed

neighbourhood N[xi ]. We update the table T .

T [S ] =

T [S ] if xi /∈ S ,

−∞ if xi ∈ S and S ∩ N(xi) 6= ∅,1 + T [S \ xi ] if xi ∈ S and S ∩ N(xi) = ∅.

Update time: O(2t)

Page 31: Introduction to Treewidth

Forget OperationPick a vertex xi ∈ X and forget that it is special (it loses the namexi and becomes nameless).

X

x1

x2

x3

x4

Page 32: Introduction to Treewidth

Forget OperationPick a vertex xi ∈ X and forget that it is special (it loses the namexi and becomes nameless).

X

x1

x2

x3

x4

Page 33: Introduction to Treewidth

Forget OperationPick a vertex xi ∈ X and forget that it is special (it loses the namexi and becomes nameless).

X

x1

x2

x3

Page 34: Introduction to Treewidth

Forget: Updating the Table T

Forgetting xi (here x4).

T [S ] = max{T [S ],T [S ∪ xi ]

}Update time: O(2t)

Page 35: Introduction to Treewidth

Our algorithm?

For an ordering σ, let tσ = max1≤j≤n |∂(Vj)|. We wanted analgorithm for Maximum Independent Set running in time2O(tσ)nO(1).

Page 36: Introduction to Treewidth

Our algorithm?

For an ordering σ, let tσ = max1≤j≤n |∂(Vj)|. We wanted analgorithm for Maximum Independent Set running in time2O(tσ)nO(1). Did we get this? Let us go to the drawing board allover again.

Page 37: Introduction to Treewidth

Defining a graph Parameter

For an ordering σ, let tσ = max1≤j≤n |∂(Vj)|.vertex separation number of a graph G

vsn(G ) = min{tσ | σ is a permutation of V (G )}

Page 38: Introduction to Treewidth

Defining a graph Parameter

For an ordering σ, let tσ = max1≤j≤n |∂(Vj)|.vertex separation number of a graph G

vsn(G ) = min{tσ | σ is a permutation of V (G )}

What we have shown is that we can find a maximum independentset in a graph in time 2vsn(G) · n if the corresponding permutationis given.

Page 39: Introduction to Treewidth

Some Questions:

Two important questions are not answered so far

I How to find a good permutation?

I While the vertex separation number of a tree can be arbitrarilylarge, the dynamic programs we used on trees and on graphswith small separation numbers, are quite similar. Is it possibleto combine both approaches?

Page 40: Introduction to Treewidth

Some Questions:

Two important questions are not answered so far

I How to find a good permutation?

I While the vertex separation number of a tree can be arbitrarilylarge, the dynamic programs we used on trees and on graphswith small separation numbers, are quite similar. Is it possibleto combine both approaches?

Page 41: Introduction to Treewidth

Some Questions:

Two important questions are not answered so far

I How to find a good permutation?

I While the vertex separation number of a tree can be arbitrarilylarge, the dynamic programs we used on trees and on graphswith small separation numbers, are quite similar. Is it possibleto combine both approaches?

In what follow we provide answers to both questions. The answerto the questions will be given by making use of treedecompositions and treewidth.

Page 42: Introduction to Treewidth

Pathwidth

A path decomposition of graph G is a sequence of bagsXi ⊆ V (G ), i ∈ {1, . . . , , r},

(X1,X2, . . . ,Xr )

such that

(P1)⋃

1≤i≤r Xi = V (G ). In other words, every vertex ofG is in some (maybe several) bags.

(P2) For every vw ∈ E (G ), there exists i ∈ {1, . . . , , r}such that bag Xi contains both v and w .

(P3) For every v ∈ V (G ), let i be the minimum and j bethe maximum indices of the bags containing v . Thenfor every k, i ≤ k ≤ j , we have v ∈ Xk . In otherwords, the indices of the bags containing v form aninterval.

Page 43: Introduction to Treewidth

Pathwidth

A path decomposition of graph G is a sequence of bagsXi ⊆ V (G ), i ∈ {1, . . . , , r},

(X1,X2, . . . ,Xr )

such that

(P1)⋃

1≤i≤r Xi = V (G ). In other words, every vertex ofG is in some (maybe several) bags.

(P2) For every vw ∈ E (G ), there exists i ∈ {1, . . . , , r}such that bag Xi contains both v and w .

(P3) For every v ∈ V (G ), let i be the minimum and j bethe maximum indices of the bags containing v . Thenfor every k, i ≤ k ≤ j , we have v ∈ Xk . In otherwords, the indices of the bags containing v form aninterval.

Page 44: Introduction to Treewidth

Pathwidth

A path decomposition of graph G is a sequence of bagsXi ⊆ V (G ), i ∈ {1, . . . , , r},

(X1,X2, . . . ,Xr )

such that

(P1)⋃

1≤i≤r Xi = V (G ). In other words, every vertex ofG is in some (maybe several) bags.

(P2) For every vw ∈ E (G ), there exists i ∈ {1, . . . , , r}such that bag Xi contains both v and w .

(P3) For every v ∈ V (G ), let i be the minimum and j bethe maximum indices of the bags containing v . Thenfor every k, i ≤ k ≤ j , we have v ∈ Xk . In otherwords, the indices of the bags containing v form aninterval.

Page 45: Introduction to Treewidth

Pathwidth

A path decomposition of graph G is a sequence of bagsXi ⊆ V (G ), i ∈ {1, . . . , , r},

(X1,X2, . . . ,Xr )

such that

(P1)⋃

1≤i≤r Xi = V (G ). In other words, every vertex ofG is in some (maybe several) bags.

(P2) For every vw ∈ E (G ), there exists i ∈ {1, . . . , , r}such that bag Xi contains both v and w .

(P3) For every v ∈ V (G ), let i be the minimum and j bethe maximum indices of the bags containing v . Thenfor every k, i ≤ k ≤ j , we have v ∈ Xk . In otherwords, the indices of the bags containing v form aninterval.

Page 46: Introduction to Treewidth

PathwidthA path decomposition of graph G is a sequence of bagsXi ⊆ V (G ), i ∈ {1, . . . , , r},

(X1,X2, . . . ,Xr )

such that

(P1)⋃

1≤i≤r Xi = V (G ). In other words, every vertex ofG is in some (maybe several) bags.

(P2) For every vw ∈ E (G ), there exists i ∈ {1, . . . , , r}such that bag Xi contains both v and w .

(P3) For every v ∈ V (G ), let i be the minimum and j bethe maximum indices of the bags containing v . Thenfor every k, i ≤ k ≤ j , we have v ∈ Xk . In otherwords, the indices of the bags containing v form aninterval.

The width of a path decomposition (X1,X2, . . . ,Xr ) ismax1≤i≤r |Xi | − 1. The pathwidth of a graph G , denoted bypw(G ), is the minimum width of a path decomposition of G .

Page 47: Introduction to Treewidth

An Example

a

b c

d e

f g h

a b

c

d

h

b

cd

e e

f

e

i

g

d

h

ei

a

ab

abc

bc

bcd

bcde

cde

de

deg

degf

deg

de

dehehehihii

Figure : A graph and its path-decompositions.

Page 48: Introduction to Treewidth

Separation Property

LemmaLet (X1,X2, . . . ,Xr ) be a path decomposition. Then for everyj ∈ {1, . . . , r − 1}, ∂(X1 ∪X2 · · · ∪Xj) ⊆ Xj ∩Xj+1. In other words,Xj ∩ Xj+1 separates X1 ∪ X2 · · · ∪ Xj from the other vertices of G .

Proof.On board.

Page 49: Introduction to Treewidth

Separation Property

LemmaLet (X1,X2, . . . ,Xr ) be a path decomposition. Then for everyj ∈ {1, . . . , r − 1}, ∂(X1 ∪X2 · · · ∪Xj) ⊆ Xj ∩Xj+1. In other words,Xj ∩ Xj+1 separates X1 ∪ X2 · · · ∪ Xj from the other vertices of G .

Proof.On board.

By above Lemma, an intersection of two consecutive bagsseparates the vertices to the “left” from the vertices to the “right”.This makes the pathwidth to look very similar to the vertexseparation number. Let us formalize these similarities.

Page 50: Introduction to Treewidth

Nice Decompositions

It is more convenient to work with nice decompositions.A path decomposition (X1,X2, . . . ,Xr ) of a graph G is nice if

I |X1| = |Xr | = 1, and

I for every i ∈ {1, 2, . . . , r − 1} there is a vertex v of G suchthat either Xi+1 = Xi ∪ {v}, or Xi+1 = Xi \ {v}.

Page 51: Introduction to Treewidth

Nice Decompositions

It is more convenient to work with nice decompositions.A path decomposition (X1,X2, . . . ,Xr ) of a graph G is nice if

I |X1| = |Xr | = 1, and

I for every i ∈ {1, 2, . . . , r − 1} there is a vertex v of G suchthat either Xi+1 = Xi ∪ {v}, or Xi+1 = Xi \ {v}.

Thus bags of a nice path decomposition are of the two types. Bagsof the first type are of the form Xi+1 = Xi ∪ {v} and are introducenodes. Bags of the form Xi+1 = Xi \ {v} are forget nodes.

Page 52: Introduction to Treewidth

An Example

a

b c

d e

f g h

a b

c

d

h

b

cd

e e

f

e

i

g

d

h

ei

a

ab

abc

bc

bcd

bcde

cde

de

deg

degf

deg

de

dehehehihii

Figure : A graph, its path and nice path decompositions.

Page 53: Introduction to Treewidth

An Example

a

b c

d e

f g h

a b

c

d

h

b

cd

e e

f

e

i

g

d

h

ei

a

ab

abc

bc

bcd

bcde

cde

de

deg

degf

deg

de

dehehehihii

Figure : A graph, its path and nice path decompositions.

Exercise: Construct an algorithm that for a given pathdecomposition of width p constructs a nice path decomposition ofwidth p in time O(p2n).

Page 54: Introduction to Treewidth

VSN vs PW

It appears that vertex separation number of a graph is exactly thepathwidth of a graph.

Page 55: Introduction to Treewidth

VSN vs PW

It appears that vertex separation number of a graph is exactly thepathwidth of a graph.

LemmaFor any graph G, vsn(G ) = pw(G ).

Proof.On the board.

Page 56: Introduction to Treewidth

Another Definition of Pathwidth

I The pathwidth(pw(G )) of G is the minimumboundary size needed to construct G from theempty graph using introduce and forgetoperations... -1

I Have seen: Maximum Independent Setcan be solved in O(2pn) time if a constructionof G with p labels is given as input.

Page 57: Introduction to Treewidth

Tractable Problems on Graphs of Bounded Pathwidth

Independent Set O(2pn) timeDominating Set O(3pn) timeq Coloring O(qpn) timeMax Cut O(2pn) timeOdd Cycle Transversal O(3pn) timeHamiltonian Cycle O(ppn) timePartition into Triangles O(2pn) time

Page 58: Introduction to Treewidth

Pathwidth

I Introduced in the 80’s as a part of Robertsonand Seymours Graph Minors project.

I (Bodlaender and Kloks 96) Graphs of pathwidthk can be recognized in f (k)n time — FPTalgorithm.

Page 59: Introduction to Treewidth

Another Operation: Join Operation

Given two t-boundaried graphs G1 and G2, the join operation gluesthem together at the boundaries.

Page 60: Introduction to Treewidth

Another Operation: Join Operation

Given two t-boundaried graphs G1 and G2, the join operation gluesthem together at the boundaries.

X

x1

x2

x3

Xx3

x2

x1

Page 61: Introduction to Treewidth

Another Operation: Join Operation

Given two t-boundaried graphs G1 and G2, the join operation gluesthem together at the boundaries.

X

x1

x2

x3

Xx3

x2

x1

Page 62: Introduction to Treewidth

Another Operation: Join Operation

Given two t-boundaried graphs G1 and G2, the join operation gluesthem together at the boundaries.

X

x1

x2

x3

Xx3

x2

x1

Page 63: Introduction to Treewidth

Joining G1 and G2: Updating the Table T for MaximumIndependent Set

Have a table T1 for G1 and T2 for G2, want to compute the tableT for their join.

T [S ] = T1[S ] + T2[S ]− |S |Update time: O(2t)

Page 64: Introduction to Treewidth

Tree Decomposition

A tree decomposition of a graph G is a pair T = (T , χ), where Tis a tree and mapping χ assigns to every node t of T a vertexsubset Xt (called a bag) such that

(T1)⋃

t∈V (T ) Xt = V (G ).

(T2) For every vw ∈ E (G ), there exists a node t of Tsuch that bag χ(t) = Xt contains both v and w .

(T3) For every v ∈ V (G ), the set χ−1(v), i.e. the set ofnodes Tv = {t ∈ V (T ) | v ∈ Xt} forms a connectedsubgraph (subtree) of T .

Page 65: Introduction to Treewidth

Tree Decomposition

A tree decomposition of a graph G is a pair T = (T , χ), where Tis a tree and mapping χ assigns to every node t of T a vertexsubset Xt (called a bag) such that

(T1)⋃

t∈V (T ) Xt = V (G ).

(T2) For every vw ∈ E (G ), there exists a node t of Tsuch that bag χ(t) = Xt contains both v and w .

(T3) For every v ∈ V (G ), the set χ−1(v), i.e. the set ofnodes Tv = {t ∈ V (T ) | v ∈ Xt} forms a connectedsubgraph (subtree) of T .

Page 66: Introduction to Treewidth

Tree Decomposition

A tree decomposition of a graph G is a pair T = (T , χ), where Tis a tree and mapping χ assigns to every node t of T a vertexsubset Xt (called a bag) such that

(T1)⋃

t∈V (T ) Xt = V (G ).

(T2) For every vw ∈ E (G ), there exists a node t of Tsuch that bag χ(t) = Xt contains both v and w .

(T3) For every v ∈ V (G ), the set χ−1(v), i.e. the set ofnodes Tv = {t ∈ V (T ) | v ∈ Xt} forms a connectedsubgraph (subtree) of T .

Page 67: Introduction to Treewidth

Tree Decomposition

A tree decomposition of a graph G is a pair T = (T , χ), where Tis a tree and mapping χ assigns to every node t of T a vertexsubset Xt (called a bag) such that

(T1)⋃

t∈V (T ) Xt = V (G ).

(T2) For every vw ∈ E (G ), there exists a node t of Tsuch that bag χ(t) = Xt contains both v and w .

(T3) For every v ∈ V (G ), the set χ−1(v), i.e. the set ofnodes Tv = {t ∈ V (T ) | v ∈ Xt} forms a connectedsubgraph (subtree) of T .

Page 68: Introduction to Treewidth

Tree Decomposition

A tree decomposition of a graph G is a pair T = (T , χ), where Tis a tree and mapping χ assigns to every node t of T a vertexsubset Xt (called a bag) such that

(T1)⋃

t∈V (T ) Xt = V (G ).

(T2) For every vw ∈ E (G ), there exists a node t of Tsuch that bag χ(t) = Xt contains both v and w .

(T3) For every v ∈ V (G ), the set χ−1(v), i.e. the set ofnodes Tv = {t ∈ V (T ) | v ∈ Xt} forms a connectedsubgraph (subtree) of T .

The width of tree decomposition T = (T , χ) equalsmaxt∈V (T ) |Xt | − 1, i.e the maximum size of it s bag minus one.The treewidth of a graph G , tw(G ), is the minimum width of atree decomposition of G .

Page 69: Introduction to Treewidth

Separation Property

For every pair of adjacent nodes of the path of a pathdecomposition, the intersection of the corresponding bags is aseparator.Treewidth also has similar properties,

Page 70: Introduction to Treewidth

Separation Property

For every pair of adjacent nodes of the path of a pathdecomposition, the intersection of the corresponding bags is aseparator.Treewidth also has similar properties,

Page 71: Introduction to Treewidth

Separation Property

For every pair of adjacent nodes of the path of a pathdecomposition, the intersection of the corresponding bags is aseparator.Treewidth also has similar properties,

LemmaLet (T , χ) be a tree decomposition and st be an edge of T . Theforest T − st obtained from T by deleting st contains twoconnected components Ts and Tt . Let Vs and Vt be the verticesof G contained in bags of Ts and Tt , correspondingly. Then∂(Vs) ⊆ Xs ∩ Xt . Thus Xs ∩ Xt separates Vs and Vt . In otherwords, every path in G with one endpoint in Vs and one in Vt

contains a vertex from Xs ∩ Xt .

Proof.On board.

Page 72: Introduction to Treewidth

A rooted tree decomposition T = (T , χ) of a graph G is nice ifeach of its nodes is one of the following four types.

Leaf node: a node i with |Xi | = 1 and no children.

Introduce node: a node i with exactly one child j such thatXi = Xj ∪ {v} for some vertex v 6∈ Xj ; we say that vis introduced in i .

Forget node: a node i with exactly one child j such thatXi = Xj \ {v} for some vertex v ∈ Xi ; we say that vis forgotten in i .

Join node: a node i with two children j1, j2 such thatXi = Xj1 = Xj2 .

Page 73: Introduction to Treewidth

A rooted tree decomposition T = (T , χ) of a graph G is nice ifeach of its nodes is one of the following four types.

Leaf node: a node i with |Xi | = 1 and no children.

Introduce node: a node i with exactly one child j such thatXi = Xj ∪ {v} for some vertex v 6∈ Xj ; we say that vis introduced in i .

Forget node: a node i with exactly one child j such thatXi = Xj \ {v} for some vertex v ∈ Xi ; we say that vis forgotten in i .

Join node: a node i with two children j1, j2 such thatXi = Xj1 = Xj2 .

Every tree decomposition of width t can be turned into a nice treedecomposition of width t in time O(t2 · n).

Page 74: Introduction to Treewidth

Treewidth

I The treewidth(tw(G )) of G is the minimumboundary size needed to construct G from theempty graph using introduce, forget and joinoperations... -1

I Have seen: Independent Set can be solvedin O(2tn) time if a construction of G with tlabels is given as input.

Page 75: Introduction to Treewidth

In what follows we will see several examples

of dynamic programming on graphs of

bounded treewidth. Any Questions until

now?