The document discusses graph minors and fixed parameter algorithms. It introduces several important concepts in fixed parameter algorithm design like treewidth, kernelization, color coding, and iterative compression. It also discusses applications of the Graph Minors Theorem to showing that certain problems are fixed-parameter tractable.
1. IN
OM
.F
O RV
D
FE
Parameterized Algorithms II
PART I
St. Petersburg, 2011
2. Powerful toolbox for designing FPT algorithms:
Graph Minors
Bounded Search Tree
Kernelization
Color coding
Graph Minors Theorem
Treewidth Iterative compression
Fixed Parameter Algorithms – p.8/98
3. Graph Minors
FPT algorithmic techniques
Significant advances in the past 20 years or so (especially in recent years).
Powerful toolbox for designing FPT algorithms:
Bounded Search Tree
Kernelization
Color coding
Graph Minors Theorem
Treewidth Iterative compression
Fixed Parameter Algorithms – p.8/98
Neil Robertson Paul Seymour
4. Graph Minors
Some consequences of the Graph Minors Theorem give a
quick way of showing that certain problems are FPT.
However, the function f (k) in the resulting FPT algorithms
can be HUGE, completely impractical.
History: motivation for FPT.
Parts and ingredients of the theory are useful for algorithm
design.
New algorithmic results are still being developed.
5. Graph Minors
Graph Minors
Definition: Graph H is a minor G (H ≤ G ) if H can be obtained
fromDefinition: Graph Hedges, deleting G ) if H can be obtained from G byedges.
G by deleting is a minor G (H vertices, and contracting
deleting edges, deleting vertices, and contracting edges.
u v
deleting uv contracting uv
u v w
Example: A triangle is a minor of a graph G if and only if G has a cycle (i.e., it is
not a forest).
Example: A triangle is a minor of a graph G if and only if G has a
cycle (i.e., it is not a forest).
Fixed Parameter Algorithms – p.58/98
6. Graph minors
Graph minors
Equivalent definition: Graph H is a minor of G if there is a
mapping φ that maps each vertex of H to a connected subset of G
such that
Equivalent definition: Graph H is a minor of G if there is a mapping φ that maps
each vertex of H to a connected subset of G such that
φ(u) and φ(v ) are disjoint if u = v , and
if uv ∈ and φ(v ) then there = van edge between φ(u) and φ(v ).
φ(u)
E (G ), are disjoint if u is , and
if uv ∈ E (G ), then there is an edge between φ(u) and φ(v ).
1 2 3 4 5 1 2 3 4 5
6 7 6 6 6 4 5
7 7 7 7 5
Fixed Parameter Algorithms – p.59/98
7. Minor closed properties
Definition: A set G of graphs is minor closed if whenever G ∈ G
and H ≤ G , then H ∈ G as well.
Examples of minor closed properties:
planar graphs
acyclic graphs (forests)
graphs having no cycle longer than k
empty graphs
Examples of not minor closed properties:
complete graphs
regular graphs
bipartite graphs
8. Forbidden minors
Let G be a minor closed set and let F be the set of “minimal bad
graphs”: H ∈ F if H ∈ G, but every proper minor of H is in G.
Characterization by forbidden minors:
G ∈ G ⇐⇒ ∀H ∈ F, H ≤ G
The set F is the obstruction set of property G.
9. Forbidden minors
Let G be a minor closed set and let F be the set of “minimal bad
graphs”: H ∈ F if H ∈ G, but every proper minor of H is in G.
Characterization by forbidden minors:
G ∈ G ⇐⇒ ∀H ∈ F, H ≤ G
The set F is the obstruction set of property G.
Theorem: [Wagner] A graph is planar if and only if it does not
have a K5 or K3,3 minor.
In other words: the obstruction set of planarity is F = {K5 , K3,3 }.
Does every minor closed property have such a finite
characterization?
10. Graph Minors Theorem
Theorem: [Robertson and Seymour] Every minor closed property
G has a finite obstruction set.
Note: The proof is contained in the paper series “Graph Minors
I–XX”.
Note: The size of the obstruction set can be astronomical even for
simple properties.
11. Graph Minors Theorem
Theorem: [Robertson and Seymour] Every minor closed property
G has a finite obstruction set.
Note: The proof is contained in the paper series “Graph Minors
I–XX”.
Note: The size of the obstruction set can be astronomical even for
simple properties.
Theorem: [Robertson and Seymour] For every fixed graph H,
there is an O(n3 ) time algorithm for testing whether H is a minor
of the given graph G .
Corollary: For every minor closed property G, there is an
O(n3 ) time
algorithm for testing whether a given graph G is in G.
12. Applications
Planar Face Cover: Given a graph G and Applications find an integer k,
an embedding of planar graph G such that there are k faces that
cover all the vertices. : Given a graph G and an integer k , find an embedding of
P LANAR FACE C OVER
planar graph G such that there are k faces that cover all the vertices.
One line argument:
One line For every fixed k , the class Gk of graphs of yes-instances is minor closed.
argument:
⇓
fixed fixed k , there is a G of graphs P LANAR FACE COVER .
For every For every k, the classO(n3k) time algorithm forof yes-instances is minor
closed. Note: non-uniform FPT.
⇓ Fixed Parameter Algorithms – p.63/98
For every fixed k, there is a O(n3 ) time algorithm for Planar
Face Cover.
Note: non-uniform FPT.
13. Applications Applications
k-Leaf Spanning Tree: Given a graph G and an integer k, find
a spanning tree with at least k leaves.
k -L EAF S PANNING T REE : Given a graph G and an integer k , find a spanning tree
with at least k leaves.
Technical modification: Is there such a spanning tree for at least one component of
G?
Technical modification: Is there such a spanning tree for at least
one component of G ?
One line argument:
One For every fixed k , the class Gk of no-instances is minor closed.
line argument:
⇓
For every fixed k, kthe class Gk ofREE can be solved in time O(n3 ).closed.
For every fixed k , -L EAF S PANNING T no-instances is minor
⇓ Fixed Parameter Algorithms – p.64/98
For every fixed k, k-Leaf Spanning Tree can be solved in time
O(n3 ).
14. G + k vertices
G + k vertices
Let G be a graph property, and let G + kv contain graph G if there
⊆ be a graph property, and let + kv that G ∈ G.
is a set SLet GV (G ) of k vertices Gsuchcontain graph GSif there is a set
S ⊆ V (G ) of k vertices such that G S ∈ G.
S
Lemma: If G is minor closed, then G + kv is minor closed for every fixed k .
Lemma: ⇒ ItG (nonuniform) FPT to decide if G can + transformed into a closedoffor
If is is minor closed, then G be kv is minor member G by
deleting k vertices.
every fixed k.
⇒ It is (nonuniform) FPT to decide if G can be transformed into a
member of G by deleting k vertices.
Fixed Parameter Algorithms – p.65/98
15. G + k vertices
G + k vertices
Let G be a graph property, and let G + kv contain graph G if there
⊆ be a graph property, and let + kv that G ∈ G.
is a set SLet GV (G ) of k vertices Gsuchcontain graph GSif there is a set
S ⊆ V (G ) of k vertices such that G S ∈ G.
S
Lemma: If G is minor closed, then G + kv is minor closed for every fixed k .
Lemma: ⇒ ItG (nonuniform) FPT to decide if G can + transformed into a closedoffor
If is is minor closed, then G be kv is minor member G by
deleting k vertices.
every fixed k.
⇒ It is (nonuniform) FPT to decide if G can be transformed into a
member of G by deleting k vertices.
If G = forests ⇒ G + kv = graphs that can be made acyclic
by the deletion of k vertices ⇒ Feedback Vertex Set is
FPT. Fixed Parameter Algorithms – p.65/98
If G = planar graphs ⇒ G + kv = graphs that can be made
planar by the deletion of k vertices (k-apex graphs) ⇒
k-Apex Graph is FPT.
If G = empty graphs ⇒ G + kv = graphs with vertex cover
number at most k ⇒ Vertex Cover is FPT.
16. Treewidth
FPT algorithmic techniques
Significant advances in the past 20 years or so (especially in recent years).
Powerful toolbox for designing FPT algorithms:
Bounded Search Tree
Kernelization
Color coding
Graph Minors Theorem
Treewidth Iterative compression
Fixed Parameter Algorithms – p.8/98
17. DTH
E WI
E
TR
Introduction and definition
Part I: Algorithms for bounded treewidth graphs.
Part II: Graph-theoretic properties of treewidth.
Part III: Applications for general graphs.
18. The Party Problem
Party Problem
Problem: Invite some colleagues for a party.
Maximize: The total fun factor of the invited people.
Constraint: Everyone should be having fun.
19. The Party Problem
Party Problem
Problem: Invite some colleagues for a party.
Maximize: The total fun factor of the invited people.
Constraint: Everyone should be having fun.
No fun with your direct boss!
20. The Party Problem
PARTY P ROBLEM
Party Problem some colleagues for a party.
Problem: Invite
Problem: The total fun factor of the invitedapeople.
Maximize: Invite some colleagues for party.
Maximize: The total fun factor of the invited people.
Constraint: Everyone should be having fun.
Constraint: Everyone should be having fun.
Do not invite a colleague and his direct boss at the same time!
No fun with your direct boss!
2
Input: A tree with weights on the
Input: A tree with weights
5 6 on the vertices.
vertices.
Task: Find an independent set of maxi-
Task: Find an independent
set of maximum weight.
mum weight.
4 4 6
Fixed Parameter Algorithms – p.5/48
21. The Party Problem
PARTY P ROBLEM
Party Problem some colleagues for a party.
Problem: Invite
Problem: The total fun factor of the inviteda party.
Maximize:
Invite some colleagues for people.
Maximize: The total fun factor of the invited people.
Constraint: Everyone should be having fun.
Constraint: Everyone should be having fun.
Do not invite a colleague and his direct boss at the same time!
No fun with your direct boss!
2
Input: A tree with weights on the
Input: A tree with weights
5 6 vertices.
on the vertices.
Task: Findan independent set of maxi-
Task: Find an independent
mum weight.
set of maximum weight.
4 4 6
Fixed Parameter Algorithms – p.5/48
22. Solving the Party Problem
Dynamic programming paradigm: We solve a large number of
subproblems that depend on each other. The answer is a single
subproblem.
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
not contain v
Goal: determine A[r ] for the root r .
23. Solving the Party Problem
Dynamic programming paradigm: We solve a large number of
subproblems that depend on each other. The answer is a single
subproblem.
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
not contain 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 A[vi ]
i=1
k
A[v ] = max{B[v ] , w (v ) + i=1 B[vi ]}
The values A[v ] and B[v ] can be calculated in a bottom-up order
(the leaves are trivial).
24. Treewidth
Treewidth: A measure of how “tree-like” the “tree-like”
Treewidth: A measure of how “tree-like” the graph is.
Treewidth: A measure of how graph is.
a
a
(Introduced by Robertson and Seymour.)
(Introducedgraph is.
the by Robertson and Seymour.)
(Introduced by Robertson and Seymour.) b
b c
c d
d
Tree decomposition: Vertices are arranged in a tree
Tree decomposition: Vertices are arranged in a tree
structure satisfying the following properties:
structure satisfying the following properties:
Tree decomposition: Vertices are ar-
1. If u and v areaneighbors, then there is a bag con-
1. If u and v in neighbors, then there is a bag con-
ranged are tree structure satisfying the fol-
lowing properties:
taining both of them.
taining both of them. e
e ff g
g h
h
2. For every u and v , are bags containing v there a
2. For every vertex v , the neighbors, then form a
1. If vertex v the bags containing v form is
connectedbag containing both of them.
a subtree.
connected subtree. c, d, ff
c, d,
2. For every vertex v , the bags
containing v form a connected b, c, ff
b, c, d, ff,,g
d, g
subtree.
a, b, c
a, b, c b, e, ff
b, e, g ,,h
g h
Fixed Parameter Algorithms – p.8/48
Fixed Parameter Algorithms – p.8/48
25. Treewidth
Treewidth: A measure of how “tree-like” the “tree-like”
Treewidth: A measure of how “tree-like” the graph is.
Treewidth: A measure of how graph is.
(Introducedgraph is. a
a
(Introduced by Robertson and Seymour.)
the by Robertson and Seymour.)
b cc d
(Introduced by Robertson and Seymour.)
Tree decomposition: Vertices are arranged in a tree
Tree decomposition: Vertices are arranged in a tree
b d
structure satisfying the following properties:
structure satisfying the following properties:
Tree decomposition: Vertices are ar-
1. If u and v areaneighbors, then there is a bag con-
1. If u and v in neighbors, then there is a bag con-
ranged are tree structure satisfying the fol-
lowing properties:
taining both of them.
taining both of them. e
e ff gg hh
2. For every vertex v ,, are bags containing v there a
2. For every u and v the neighbors, then form a
1. If vertex v the bags containing v form is
connectedbag containing both of them.
a subtree.
connected subtree. c, d, ff
c, d,
2. For every vertex v , the bags
containing v form a connected b, c, ff d, ff,,g
b, c, d, g
subtree.
a, b, c
a, b, c b, e, ff
b, e, g ,,h
g h
Fixed Parameter Algorithms – p.8/48
Fixed Parameter Algorithms – p.8/48
26. Treewidth
Treewidth: AA measureof how “tree-like” the graph is.
Treewidth: measure of how “tree-like” the “tree-like”
Treewidth: A measure of how graph is.
(Introducedgraph is.
(Introduced byRobertson and Seymour.)
the by Robertson and Seymour.) aa
(Introduced by Robertson arranged in tree b b
and Seymour.) cc d d
Tree decomposition: Vertices are arranged in aatree
Tree decomposition: Vertices
structure satisfying the following properties:
Tree decomposition: Vertices are ar-
structure satisfying the following properties:
1.1. Ifrangedvin aneighbors, then there is a bag con-
are tree structure there is a bag con-
If u u andv are neighbors,
and satisfying the fol-
lowing properties:
taining both of them.
taining both of them. ee f f g g h h
2.2. Forevery uvertex v ,, are neighbors, then thereaa
For 1. If vertex v the bags containing v form is
every and v the bags containing v form
connectedbag containing
a subtree.
connected subtree. both of them. c,c, d, f
d, f
2. For every vertex v , the bags
containing v form a connected b, c, f
b, c, f
d, f , g
d, f , g
subtree.
a, b, c b, e, f g, h
a, b, c b, e, f g, h
Fixed Parameter Algorithms – p.8/48
Fixed Parameter Algorithms – p.8/48
27. Treewidth
Treewidth: AA measureof how “tree-like” the graph is.
Treewidth: measure of how “tree-like” the “tree-like”
Treewidth: A measure of how graph is.
(Introducedgraph is.
(Introduced byRobertson and Seymour.)
the by Robertson and Seymour.) aa
(Introduced by Robertson arranged in tree b b
and Seymour.) cc d d
Tree decomposition: Vertices are arranged in aatree
Tree decomposition: Vertices
structure satisfying the following properties:
Tree decomposition: Vertices are ar-
structure satisfying the following properties:
1.1. Ifrangedvin aneighbors, then there is a bag con-
are tree structure there is a bag con-
If u u andv are neighbors,
and satisfying the fol-
lowing properties:
taining both of them.
taining both of them. ee f f g g h h
2.2. Forevery uvertex v ,, are neighbors, then thereaa
For 1. If vertex v the bags containing v form is
every and v the bags containing v form
connectedbag containing
a subtree.
connected subtree. both of them. c,c, d, f
d, f
2. For every vertex v , the bags
containing v form a connected b, c, f
b, c, f
d, f , g
d, f , g
subtree.
a, b, c b, e, f g, h
Width of the decomposition: largest bag a, b, c b, e, f g, h
size −1.
treewidth: width of the best decomposi- Fixed Parameter Algorithms – p.8/48
Fixed Parameter Algorithms – p.8/48
tion.
Fact: treewidth = 1 iff graph is a forest
28. Treewidth
Treewidth: AA measuremeasure of how “tree-like”
Treewidth: A of how “tree-like” the graph is.
Treewidth: measure of how “tree-like” the graph is.
the graph is.
(Introduced by Robertson and Seymour.)
(Introduced by Robertson and Seymour.) a
a
(Introduced by Robertson and Seymour.) b
b c
c d
d
Tree decomposition: Vertices are arranged in a tree
Tree decomposition: Vertices are arranged in a tree
structure satisfying the following properties: are ar-
Tree decomposition: Vertices
structure satisfying the following properties:
ranged inaretree structure satisfying bag con-
a neighbors, then there is a the fol-
1.1.If If u and vare neighbors, then there is a bag con-
u and v
lowing properties:
taining both of them.
taining both of them. e g
e ff g h
h
For every vertexv , are neighbors, then there is
1. If u and
2.2.For every vertex vv ,the bags containing vv form a
the bags containing form a
a bag containing both of them.
connected subtree.
connected subtree. c, d, ff
c, d,
Width 2. the decomposition: largestbagssize −1
of For every vertex v , the bag
Width of the decomposition: largest bag size −1..
containing v form a connected b, c, ff
b, c, d, ff ,, g
d, g
treewidth: subtree. the best decomposition.
treewidth: width of best decomposition.
width of the
Fact: treewidth the⇐⇒ graph is forest a, b, c b, e, ff
b, e, g, h
Fact: Width of = 1 ⇐⇒ graph is aaforest largest
treewidth = 1 decomposition: bag a, b, c g, h
size −1.
treewidth: width of the best decomposi- Fixed Parameter Algorithms – p.8/48
Fixed Parameter Algorithms – p.8/48
tion.
Fact: treewidth = 1 iff graph is a forest
29. Treewidth
Treewidth: A measure of how “tree-like” the graph is.
Treewidth: A measure of how “tree-like” the graph is.
Treewidth: A measure of how “tree-like” a
(Introduced by Robertson and Seymour.) a
(Introduced byis.
the graph Robertson and Seymour.)
b c d
Tree(Introduced by Robertson and Seymour.) b c d
Tree decomposition: Vertices are arrangedin aa tree
decomposition: Vertices are arranged in tree
structure satisfying the following properties:
structure satisfying the following properties:
Tree decomposition: Vertices are ar-
1. If uIfand v are neighbors, then there isisaabag con-
ranged in va are neighbors, then there
1. u and bag con-
tree structure satisfying the fol-
taining both of them.
taining both of them. e
e f g
g
lowing properties: f hh
2. ForFor every vertex, vthe bags containing vv form a
2. every vertex v , the bags containing form a
1. If u and v are neighbors, then there is
connected subtree.
connected subtree. c, d, ff
c, d,
a bag containing both of them.
Width of decomposition: largest bag size −1
Width of thethe decomposition: largest bag size−1. .
2. For every vertex v , the bags
b, c, f
b, c, f d, ff,,g
d, g
treewidth: width of the best decomposition.
treewidth: width of the v form a connected
containing best decomposition.
subtree.
Fact: treewidth = 1 1 ⇐⇒ graph is a forest
Fact: treewidth = ⇐⇒ graph is a forest a, b, c
a, b, c b, e, ff
b, e, gg , h
,h
Width of the decomposition: largest bag
size −1.
Fixed Parameter Algorithms – p.8/48
Fixed Parameter Algorithms – p.8/48
treewidth: width of the best decomposi-
tion.
Fact: treewidth = 1 iff graph is a forest
30. Finding tree decompositions
Fact: It is NP-hard to determine the treewidth of a graph (given a
graph G and an integer w , decide if the treewidth of G is at most
w ), but there is a polynomial-time algorithm for every fixed w .
31. Finding tree decompositions
Fact: [Bodlaender’s Theorem] For every fixed w , there is a
linear-time algorithm that finds a tree decomposition of width w
(if exists).
⇒ Deciding if treewidth is at most w is fixed-parameter tractable.
⇒ If we want an FPT algorithm parameterized by treewidth w of
the input graph, then we can assume that a tree decomposition of
width w is available.
32. Finding tree decompositions
Fact: [Bodlaender’s Theorem] For every fixed w , there is a
linear-time algorithm that finds a tree decomposition of width w
(if exists).
⇒ Deciding if treewidth is at most w is fixed-parameter tractable.
⇒ If we want an FPT algorithm parameterized by treewidth w of
the input graph, then we can assume that a tree decomposition of
width w is available.
3
Running time is 2O(w ) · n. Sometimes it is better to use the
following results instead:
Fact: There is a O(33w · w · n2 ) time algorithm that finds a tree
decomposition of width 4w + 1, if the treewidth of the graph is at
most w .
Fact: There is a polynomial-time algorithm that finds a tree
√
decomposition of width O(w log w ), if the treewidth of the graph
is at most w .
33. Part I:
Algoritmhs for
bounded-treewidth graphs
34. and tree decompositions
Weighted Max Independent Set
and tree decompositions
Fact: Given a tree decomposition of width w of width wM AX I NDEPENDENT S ET can
Fact: Given a tree decomposition , W EIGHTED , Weighted Max
be solved in time O(2Set .can be solved in time O(2w · n).
Independent w · n)
c, d, f
BBxvertices appearing in nodein . node x.
x : : vertices appearing x
VV vertices appearing in the subtree rooted at x .
x : : vertices appearing in the subtree
x
b, c, f d, f , g
rooted at x.
Generalizing our solution for trees:
Generalizing our solution for trees: a, b, c b, e, f g, h
Instead of computing 2 values A[v ], B[v ] for each
Instead of computing 2 values A[v ],
vertex of the graph, we compute 2|Bx | ≤ 2w +1 ∅ =? bc =?
B[v ] for each bagvertex of the graph, we
values
for each B . b =? cf =?
x
compute 2|Bx | ≤ 2w +1 values for each c =? bf =?
M[x, S]: the maximum weight of an independent
bag Bx . f =? bcf =?
set I ⊆ Vx with I ∩ Bx = S .
M[x, S]: the maximum weight of an
How to determine M[x, S] if all the values are known for
independent set I ⊆ Vx with I ∩ Bx =
the children of x ?
S. Fixed Parameter Algorithms – p.11/48
How to determine M[x, S] if all the values are known for
the children of x?
35. Nice tree decompositions
Definition: A rooted tree decomposition decompositions x is
Nice tree is nice if every node
one of the following 4 types:
Definition: A children, |Bx | = is
Leaf: no rooted tree decomposition 1 nice if every node x is one of the following
4 types:
Introduce: 1 child y , Bx = By ∪ {v } for some vertex v
Leaf: no children, |Bx | = 1
Forget: 1 child y , Bx = By {v } for some vertex v
Introduce: 1 child y , Bx = By ∪ {v } for some vertex v
Join: 2 1 child y , B = 1 , {v }with Bx = By1 = By2
Forget:
children y B y2 for some vertex v
x y
Join: 2 children y1 , y2 with Bx = By1 = By2
Leaf Introduce Forget Join
v u, v , w u, w u, v , w
u, w u, v , w u, v , w u, v , w
Fact: A tree decomposition of width w and n nodes can be turned into a nice tree
decomposition of width w and O(wn) nodes in time O(w 2 n).
Fact: A tree decomposition of width w and n nodes can be turned Fixed Parameter Algorithms – p.12/48
into a nice tree decomposition of width w and O(wn) nodes in
time O(w 2 n).
36. Weighted Max Independent Set
and nice tree decompositions
Leaf: no children, |Bx | = 1
Trivial! Nice tree decompositions
Introduce: 1 child y , Bx = By ∪ {v } for some vertex v
Definition: A rooted tree decomposition is nice if every node x is one of the following
4 types:
m[y , S]
if v ∈ S,
m[x, S]no children, |B S = 1{v }] + w (v ) if v ∈ S but v has no neighbor in S,
Leaf:
= m[y , |
x
−∞ if S contains v and its neighbor.
Introduce: 1 child y , B = B ∪ {v } for some vertex v
x y
Forget: 1 child y , Bx = By {v } for some vertex v
Join: 2 children y1 , y2 with Bx = By1 = By2
Leaf Introduce Forget Join
v u, v , w u, w u, v , w
u, w u, v , w u, v , w u, v , w
Fact: A tree decomposition of width w and n nodes can be turned into a nice tree
decomposition of width w and O(wn) nodes in time O(w 2 n).
Fixed Parameter Algorithms – p.12/48
37. Weighted Max Independent Set
and nice tree decompositions
Forget: 1 child y , Bx = By {v } for some vertex v
Nice tree decompositions
m[x, S] = max{m[y , S], m[y , S ∪ {v }]}
Join: 2 Achildren decomposition is nice if = By1 = is one of the following
Definition: rooted tree y , y with B every node x B
1 2 x y2
4 types:
m[x, S] = m[y1 , S] + m[y2 , S] − w (S)
Leaf: no children, |Bx | = 1
Introduce: 1 child y , Bx = By ∪ {v } for some vertex v
Forget: 1 child y , Bx = By {v } for some vertex v
Join: 2 children y1 , y2 with Bx = By1 = By2
Leaf Introduce Forget Join
v u, v , w u, w u, v , w
u, w u, v , w u, v , w u, v , w
Fact: A tree decomposition of width w and n nodes can be turned into a nice tree
decomposition of width w and O(wn) nodes in time O(w 2 n).
Fixed Parameter Algorithms – p.12/48
38. Weighted Max Independent Set
and nice tree decompositions
Forget: 1 child y , Bx = By {v } for some vertex v
m[x, S] = max{m[y , S], m[y , S ∪ {v }]}
Join: 2 children y1 , y2 with Bx = By1 = By2
m[x, S] = m[y1 , S] + m[y2 , S] − w (S)
There are at most 2w +1 · n subproblems m[x, S] and each
subproblem can be solved in constant time (assuming the children
are already solved) ⇒ Running time is O(2w · n).
⇒ Weighted Max Independent Set is FPT parameterized
by treewidth ⇒ Weighted Min Vertex Cover is FPT
parameterized by treewidth.
39. 3-C OLORING and
tree decompositions
3-Coloring and tree decompositions
Fact: Given a tree decomposition of width w , 3-Coloring can
Fact: Given a tree O(3w · n). of width w , 3-C OLORING can be solved in O(3w · n).
be solved in decomposition
Bx :Bx : vertices appearing in node x.
vertices appearing in node x .
Vx :Vx : vertices appearing in the subtree
vertices appearing in the subtree rooted at x . c, d, f
rooted at x.
ForFor every node x and coloring c {1, 2, 3},
every node x and coloring c : Bx → : B → b, c, f d, f , g
x
we {1, 2, 3}, we compute Ethec],Boolean
compute the Boolean value [x, which is
true if and only if c can be extended to a proper a, b, c b, e, f g, h
value E [x, c], which is true if and only
3-coloring of Vx .
if c can be extended to a proper 3-
coloring of Vx . bcf=T bcf=F
bcf=T bcf=F
... ...
How to to determine [x,[x, c] all all the values are known for
How determine E E c] if if the values are known for
the children x
the children of of?x?
Fixed Parameter Algorithms – p.14/48
40. 3-Coloring and nice tree decompositions
Leaf: no children, |Bx | = 1
Trivial!
Introduce: 1 child y , Bx = By ∪ {v } for some vertex v
If c(v ) = c(u) for every neighbor u of v , then
Nice tree decompositions
E [x, c] = E [y , c ], where c is c restricted to By .
Forget: 1 rooted tree decomposition is nice{vevery nodesome vertex v
Definition: A
child y , Bx = By if } for x is one of the following
E [x, c] is true if E [y , c ] is true for one of the 3 extensions of
4 types:
c to Leaf:.no children, |B | = 1
By x
Introduce: 1 child y , Bx = By ∪ {v } for some vertex v
Join: 2 children y , y with B = B = By2
1 2 x y1
E [x, c] = E [y1 , c] ∧ E [y2 , c]
Forget: 1 child y , Bx = By {v } for some vertex v
Join: 2 children y1 , y2 with Bx = By1 = By2
Leaf Introduce Forget Join
v u, v , w u, w u, v , w
u, w u, v , w u, v , w u, v , w
Fact: A tree decomposition of width w and n nodes can be turned into a nice tree
decomposition of width w and O(wn) nodes in time O(w 2 n).
Fixed Parameter Algorithms – p.12/48
41. 3-Coloring and nice tree decompositions
Leaf: no children, |Bx | = 1
Trivial!
Introduce: 1 child y , Bx = By ∪ {v } for some vertex v
If c(v ) = c(u) for every neighbor u of v , then
E [x, c] = E [y , c ], where c is c restricted to By .
Forget: 1 child y , Bx = By {v } for some vertex v
E [x, c] is true if E [y , c ] is true for one of the 3 extensions of
c to By .
Join: 2 children y1 , y2 with Bx = By1 = By2
E [x, c] = E [y1 , c] ∧ E [y2 , c]
There are at most 3w +1 · n subproblems E [x, c] and each
subproblem can be solved in constant time (assuming the children
are already solved).
⇒ Running time is O(3w · n).
⇒ 3-Coloring is FPT parameterized by treewidth.
42. Vertex coloring
More generally:
Fact: Given a tree decomposition of width w , c-Coloring can
be solved in O ∗ (c w ).
Exercise: Every graph of treewidth at most w can be colored with
w + 1 colors.
Fact: Given a tree decomposition of width w , Vertex
Coloring can be solved in time O ∗ (w w ).
⇒ Vertex Coloring is FPT parameterized by treewidth.
43. Hamiltonian cycle and
tree decompositions
Hamiltonian cycle and
tree decompositions
Fact: Given a tree decomposition of width w , Hamiltonian
cycle canO(w ) a tree decomposition w width )w·, H AMILTONIAN CYCLE can be solved in
be solved in time of O(w n.
Fact: Given
time w · n.
Bx : vertices appearinginin node x.
Bx : vertices appearing node x .
0
Bx 1
Bx 2
Bx
x
Vx : vertices appearing the subtreesubtreex .
Vx : vertices appearing in in the rooted at
rootedIf at is a Hamiltonian cycle, then the subgraph
H x.
H[V ] is a set of paths with endpoints in B .
If H is ax Hamiltonian cycle, then xthe
subgraph H[Vx ]important properties of H[Vx ] “seen
What are the
is a set of paths with
from the outside world”?
endpoints in Bx . 0 1 2 Vx
The subsets Bx , Bx , Bx of Bx having degree
0, 1, and 2.
1
The matching M of Bx .
Number of subproblems (Bx , Bx , Bx , M) for each node x : at most 3w · w w .
0 1 2
Fixed Parameter Algorithms – p.17/48
44. tree decompositions
Hamiltonian cycle and
tree decompositions
Fact: Given a tree decomposition of width w , H AMILTONIAN CYCLE can be solved in
time w O(w ) · n.
Bx : vertices appearinginin node x.
Bx : vertices appearing node x .
0
Bx 1
Bx 2
Bx
x
Vx : vertices appearing the subtreesubtreex .
Vx : vertices appearing in in the rooted at
rootedIf at is a Hamiltonian cycle, then the subgraph
H x.
H[V ] is a set of paths with endpoints in B .
If H is ax Hamiltonian cycle, then xthe
subgraph H[Vx ]important properties of H[Vx ] “seen
What are the
is a set of paths with
from the outside world”?
endpoints in Bx . 0 1 2 Vx
The subsets Bx , Bx , Bx of Bx having degree
What are 1, and important properties of
0, the 2.
H[Vx ] “seenmatching the outside world”?
The from M of Bx .
1
0 1 2 w
Number of subproblems 1 Bx
0 2 of B · ww.
The subsets Bx , B(B,x ,Bx, Bx , M)xfor each node x : at most 3
x
having degree 0, 1, and 2. Fixed Parameter Algorithms – p.17/48
1
The matching M of Bx .
0 1 2
Number of subproblems (Bx , Bx , Bx , M) for each node x: at most
3 w · ww.
45. Hamiltonian cycle and
nice tree decompositions
0 1 2
For each subproblem (Bx , Bx , Bx , M), we have to determine if
there is a set of paths with this pattern.
How to do this for the different types of nodes?
(Assuming that all the subproblems are solved for the children.)
Leaf: no children, |Bx | = 1
Trivial!
46. Hamiltonian cycle and Hamiltonian cycle an
nice tree decompositions nice tree decomposition
0 1 2
Solving subproblem (Bx , Bx , Bx , M) of node x.
0 1 2
olving subproblem (Bx , Bx , Bx , M) of node x .
Forget: 1 child y , Bx = By {v } for some vertex v
orget: 1 child y , Bx = By {v } 1 some vertex v
0 for 2
In a solution H of (Bx , Bx , Bx , M), vertex v has degree 2. Thus
0 01 12 2
a solution H of (Bx , Bx BBx BM), vertex v has degree to subproblem
subproblem (Bx , , x , , x , M) of x is equivalent 2. Thus subproblem
0 , B 1 , B 2 ∪ {v }, M) of y .
Bx , Bx , (B2x, M) of x is equivalent to subproblem (Bx , Bx , Bx ∪ {v }, M) of y .
0 1
Bx x x 0 1 2
0 1 2
Bx Bx Bx
47. Hamiltonian cycle and
nice tree decompositions Hamiltonian cycle and
nice tree decompositions
0 1 2
Solving subproblem (Bx , Bx , Bx , M) of node x.
Forget: 1 child0 y , 1 , x 2 , B {v } x .
Solving subproblem (Bx , BxBBx=M)yof node for some vertex v
0 1 2
Forget: 1 child y , BxH ofy (B{v } for Bx , M), vertex
In a solution = B x , Bx , some vertex v v has degree 2. Thus
subproblem 0 1 2
(Bx ,1Bx ,2 Bx , M) of x is equivalent to subproblem
0
In a solution H of 2 x , Bx , Bx , M), vertex v has degree 2. Thus subproblem
0 1 (B
0
(Bx ,2Bx , Bx ∪ {v }, M) of y .
1 0 1 2
(Bx , Bx , Bx , M) of x is equivalent to subproblem (Bx , Bx , Bx ∪ {v }, M) of y .
0 1 2
Bx Bx Bx
v
48. Hamiltonian cycle and
nice tree decompositions
Hamiltonian cycle and
0 1 2 M) of node x.
Solving subproblem (Bx , Bx , Bx , nice tree decompositions
Forget: 1 child y , Bx = By {v } for some vertex v
Solving subproblem (Bx ,0 , , B1 , B 2 , node .
In a solution H of (BxBx1Bxx2, M)xof M),x vertex v has degree 2. Thus
0
0 , B 1 , B 2 , M) of x is equivalent to subproblem
subproblem childxy , Bxx = Byx {v } for some vertex v
Forget: 1 (B
0 , B 1 , B 2 ∪ {v }, 0 1 of y .
(Bx Inx solution H of (BxM), Bx2 , M), vertex v has degree 2. Thus subproblem
a x , Bx
0 1 2 0 1 2
(Bx , Bx , Bx , M) of x is equivalent to subproblem (Bx , Bx , Bx ∪ {v }, M) of y .
0 1 2
Bx Bx Bx
v
Fixed Parameter Algorithms – p.19/48
49. Solving subproblem (B 0 , B 1 , B 2 , M) of node x .
Hamiltonian cycle and x x x
nice tree decompositions y ∪ {v } for some vertex v
Introduce: 1 child y , Bx = B
0 0 1 2
Case 1: v ∈ Bx . Subproblem is equivalent with (Bx {v }, Bx , Bx , M) for no
0 1 2
Solving subproblem (Bx , Bx , Bx , M) of node x.
Introduce: 1 child y , Bx = By ∪ {v } for some vertex v
0
Case 1: v ∈ Bx .
0 1 2
Subproblem is equivalent with (Bx {v }, Bx , Bx , M) for node y .
0 1 2 0 1 2
Bx Bx Bx By By By
v x ⇐ y
Fixed Parameter
50. nice tree decomposit
Hamiltonian cycle and
nice tree decompositions
Solving subproblem (Bx0, Bx , B22 , M) of node x.
0 1
1 x
Solving subproblem (Bx , Bx , Bx , M) of node x .
Introduce: 1 child y , Bx = By ∪ {v } for some vertex v
Introduce: 1 child y , Bx = By ∪ {v } for some vertex v
Case 2:
v Case12: Every x . Every neighbor Vxv is in xBx .inThusThus v hasbe be adjacent
∈ Bx . v ∈ B neighbor of v in of in V is Bx . v has to to
1
adjacent withof Bx .other vertex of Bx .
other vertex one
0 1 2
Is there a subproblem (By , By , By , M2 ) of node y such that making a
0 1
Is there a subproblem (By , By , By , M ) of node y such that making a vert
vertex of By adjacent to v makes it a solution for subproblem2
0 1
adjacent2to v makes it a solution for subproblem (Bx , Bx , Bx , M) of node x ?
0 1
(Bx , Bx , Bx , M) of node x?
0 1 2 0 1 2
Bx Bx Bx By By By
x y
v
51. Hamiltonian cycle and Bx1 , Bx2 , M) of node x .
Solving subproblem (Bx ,0
nice tree decompositionsBy ∪ {v } for some vertex v
Introduce: 1 child y , Bx =
1
Case 3: v ∈ Bx . Similar to Case 2, but 2 vertices of By are adjacent with v .
0 1 2
Solving subproblem (Bx , Bx , Bx , M) of node x.
Introduce: 1 child y , Bx = By ∪ {v } for some vertex v
1
Case 3: v ∈ Bx . Similar to Case 2, but 2 vertices of By are
adjacent with v .
0 1 2 0 1
Bx Bx Bx By By
v
x ⇐ y
Fixed Parameter
52. Hamiltonian cycle and
nice tree decompositions
0 1 2
Solving subproblem (Bx , Bx , Bx , M) of node x.
Join: 2 children y1 , y2 with Bx = By1 = By2
A solution H is the union of a subgraph H1 ⊆ G [Vy1 ] and a
subgraph H2 ⊆ G [Vy2 ].
0 1 2
If H1 is a solution for (By1 , By1 , By1 , M1 ) of node y1 and H2 is a
0 , B 1 , B 2 , M ) of node y , then we can check if
solution for (By2 y2 y2 2 2
0 1 2
H1 ∪ H2 is a solution for (Bx , Bx , Bx , M) of node x.
For any two subproblems of y1 and y2 , we check if they have
0 1 2
solutions and if their union is a solution for (Bx , Bx , Bx , M) of
node x.
53. Monadic Second Order Logic
Extended Monadic Second Order Logic (EMSO)
A logical language on graphs consisting of the following:
Logical connectives ∧, ∨, →, ¬, =, =
quantifiers ∀, ∃ over vertex/edge variables
predicate adj(u, v ): vertices u and v are adjacent
predicate inc(e, v ): edge e is incident to vertex v
quantifiers ∀, ∃ over vertex/edge set variables
∈, ⊆ for vertex/edge sets
Example: The formula
∃C ⊆ V ∀v ∈ C ∃u1 , u2 ∈ C (u1 = u2 ∧ adj(u1 , v ) ∧ adj(u2 , v )) is
true . . .
54. Monadic Second Order Logic
Extended Monadic Second Order Logic (EMSO)
A logical language on graphs consisting of the following:
Logical connectives ∧, ∨, →, ¬, =, =
quantifiers ∀, ∃ over vertex/edge variables
predicate adj(u, v ): vertices u and v are adjacent
predicate inc(e, v ): edge e is incident to vertex v
quantifiers ∀, ∃ over vertex/edge set variables
∈, ⊆ for vertex/edge sets
Example: The formula
∃C ⊆ V ∀v ∈ C ∃u1 , u2 ∈ C (u1 = u2 ∧ adj(u1 , v ) ∧ adj(u2 , v )) is
true if graph G (V , E ) has a cycle.
55. Courcelle’s Theorem
Courcelle’s Theorem: If a graph property can be expressed in
EMSO, then for every fixed w ≥ 1, there is a linear-time algorithm
for testing this property on graphs having treewidth at most w .
Note: The constant depending on w can be very large (double,
triple exponential etc.), therefore a direct dynamic programming
algorithm can be more efficient.
56. Courcelle’s Theorem
Courcelle’s Theorem: If a graph property can be expressed in
EMSO, then for every fixed w ≥ 1, there is a linear-time algorithm
for testing this property on graphs having treewidth at most w .
Note: The constant depending on w can be very large (double,
triple exponential etc.), therefore a direct dynamic programming
algorithm can be more efficient.
If we can express a property in EMSO, then we immediately get
that testing this property is FPT parameterized by the treewidth w
of the input graph.
Can we express 3-Coloring and Hamiltonian Cycle in
EMSO?
57. Using Courcelle’s Theorem
3-Coloring
∃C1 , C2 , C3 ⊆ V ∀v ∈ V (v ∈ C1 ∨ v ∈ C2 ∨ v ∈ C3 ) ∧ ∀u, v ∈
V adj(u, v ) → (¬(u ∈ C1 ∧ v ∈ C1 ) ∧ ¬(u ∈ C2 ∧ v ∈ C2 ) ∧ ¬(u ∈
C3 ∧ v ∈ C3 ))
58. Using Courcelle’s Theorem
3-Coloring Hamiltonian Cycle
∃H ⊆ E spanning(H) ∧ (∀v ∈ V degree2(H, v ))
degree0(H, v ) := ¬∃e ∈ H inc(e, v )
degree1(H, v ) := ¬degree0(H, v ) ∧ ¬∃e1 , e2 ∈ H (e1 =
e2 ∧ inc(e1 , v ) ∧ inc(e2 , v ))
degree2(H, v ) := ¬degree0(H, v ) ∧ ¬degree1(H, v ) ∧ ¬∃e1 , e2 , e3 ∈
H (e1 = e2 ∧ e2 = e3 ∧ e1 = e3 ∧ inc(e1 , v ) ∧ inc(e2 , v ) ∧ inc(e3 , v )))
spanning(H) := ∀u, v ∈ V ∃P ⊆ H ∀x ∈ V ((x = u ∨ x =
v ) ∧ degree1(P, x)) ∨ (x = u ∧ x = v ∧ (degree0(P, x) ∨ degree2(P, x)))
59. Using Courcelle’s Theorem
Two ways of using Courcelle’s Theorem:
1. The problem can be described by a single formula (e.g,
3-Coloring, Hamiltonian Cycle).
⇒ Problem can be solved in time f (w ) · n for graphs of treewidth
at most w .
⇒ Problem is FPT parameterized by the treewidth w of the input
graph.
60. Using Courcelle’s Theorem
Two ways of using Courcelle’s Theorem:
1. The problem can be described by a single formula (e.g,
3-Coloring, Hamiltonian Cycle).
⇒ Problem can be solved in time f (w ) · n for graphs of treewidth
at most w .
⇒ Problem is FPT parameterized by the treewidth w of the input
graph.
2. The problem can be described by a formula for each value of
the parameter k.
Example: For each k, having a cycle of length exactly k can be
expressed as
∃v1 , . . . , vk ∈ V (adj(v1 , v2 )∧adj(v2 , v3 )∧· · ·∧adj(vk−1 , vk )∧adj(vk , v1 )).
⇒ Problem can be solved in time f (k, w ) · n for graphs of
treewidth w .
⇒ Problem is FPT parameterized with combined parameter k and
61. Subgraph Isomorphism
Subgraph Isomorphism: given graphs H and G , find a copy of
H in G as subgraph. Parameter k := |V (H)| (size of the small
graph).
For each H, we can construct a formula φH that expresses “G has
a subgraph isomorphic to H” (similarly to the k-cycle on the
previous slide).
62. Subgraph Isomorphism
Subgraph Isomorphism: given graphs H and G , find a copy of
H in G as subgraph. Parameter k := |V (H)| (size of the small
graph).
For each H, we can construct a formula φH that expresses “G has
a subgraph isomorphic to H” (similarly to the k-cycle on the
previous slide).
⇒ By Courcelle’s Theorem, Subgraph Isomorphism can be
solved in time f (H, w ) · n if G has treewidth at most w .
63. Subgraph Isomorphism
Subgraph Isomorphism: given graphs H and G , find a copy of
H in G as subgraph. Parameter k := |V (H)| (size of the small
graph).
For each H, we can construct a formula φH that expresses “G has
a subgraph isomorphic to H” (similarly to the k-cycle on the
previous slide).
⇒ By Courcelle’s Theorem, Subgraph Isomorphism can be
solved in time f (H, w ) · n if G has treewidth at most w .
⇒ Since there is only a finite number of simple graphs on k
vertices, Subgraph Isomorphism can be solved in time
f (k, w ) · n if H has k vertices and G has treewidth at most w .
⇒ Subgraph Isomorphism is FPT parameterized by combined
parameter k := |V (H)| and the treewidth w of G .
65. The Robber and Cops game
Game: k cops try to capture a robber in the graph.
In each step, the cops can move from vertex to vertex
arbitrarily with helicopters.
The robber moves infinitely fast on the edges, and sees where
the cops will land.
66. The Robber and Cops game (cont.)
Example: 2 cops have a winning strategy in a tree.
67. The Robber and Cops game (cont.)
Example: 2 cops have a winning strategy in a tree.
68. The Robber and Cops game (cont.)
Example: 2 cops have a winning strategy in a tree.
69. The Robber and Cops game (cont.)
Example: 2 cops have a winning strategy in a tree.
70. The Robber and Cops game (cont.)
Example: 2 cops have a winning strategy in a tree.
71. The Robber and Cops game (cont.)
Example: 2 cops have a winning strategy in a tree.
72. The Robber and Cops game (cont.)
Example: 2 cops have a winning strategy in a tree.
73. The Robber and Cops game (cont.)
Example: 2 cops have a winning strategy in a tree.
74. The Robber and Cops game
Fact:
k + 1 cops can win the game iff the treewidth of the graph is at
most k.
75. The Robber and Cops game
Fact:
k + 1 cops can win the game iff the treewidth of the graph is at
most k.
The winner of the game can be determined in time nO(k) using
standard techniques (there are at most nk positions for the cops)
⇓
For every fixed k, it can be checked in polynomial-time if treewidth
is at most k.
76. The Robber and Cops game
Fact:
k + 1 cops can win the game iff the treewidth of the graph is at
most k.
The winner of the game can be determined in time nO(k) using
standard techniques (there are at most nk positions for the cops)
⇓
For every fixed k, it can be checked in polynomial-time if treewidth
is at most k.
Exercise 1: Show that the treewidth of the k × k grid is at least
k − 1.
Exercise 2: Show that the treewidth of the k × k grid is at least k.
77. Properties of treewidth
Fact: For every k ≥ 2, the treewidth of the k × k grid is exactly k.
78. Properties of treewidth
Fact: For every k ≥ 2, the treewidth of the k × k grid is exactly k.
Fact: Treewidth does not increase if we delete edges, delete
vertices, or contract edges.
⇒ If F is a minor of G , then the treewidth of F is at most the
treewidth of G .
79. Excluded Grid Theorem
Fact: [Excluded Grid Theorem] If the treewidth of G is at least
2
k 4k (k+2) , then G has a k × k grid minor.
A large grid minor is a “witness” that treewidth is large.
Fact: Every planar graph with treewidth at least 4k has k × k
grid minor.
80. Outerplanar graphs
Definition: A planar graph is outerplanar if it has a planar
embedding where every vertex is on the infinite face.
Fact: Every outerplanar graph has treewidth at most 2.
81. k-outerplanar graphs
k -outerplanar graphs
Given a planar embedding, we can define layers by iteratively
removing the vertices on the infinite face.
Given a planar embedding, we can define layers by iteratively removing the vertices
Definition: A planar graph is k-outerplanar if it has a planar
on the infinite face.
embedding having at most -outerplanar if it has a planar embedding having at
Definition: A planar graph is k k layers.
most k layers.
1 1 1
2 2
1
2
3
2 3 2 3 3 3
3 3 2
2
2 2
2
1 1
Fact: Every k -outerplanar graph has treewidth at most 3k + 1.
Fixed Parameter Algorithms – p.33/48
Fact: Every k-outerplanar graph has treewidth at most 3k + 1.
83. Baker’s shifting strategy
Subgraph Isomorphism for planar graphs: given planar graphs H and G , find a
copy of H in G as subgraph. Parameter k := |V (H)|.
Layers of the planar
graph: (as in the defini-
tion of k-outerplanar):
84. Baker’s shifting strategy
Subgraph Isomorphism for planar graphs: given planar graphs H and G , find a
copy of H in G as subgraph. Parameter k := |V (H)|.
Layers of the planar
graph: (as in the defini-
tion of k-outerplanar):
For a fixed 0 ≤ s < k + 1, delete every layer Li with i = s
(mod k + 1)
85. Baker’s shifting strategy
Subgraph Isomorphism for planar graphs: given planar graphs H and G , find a
copy of H in G as subgraph. Parameter k := |V (H)|.
Layers of the planar
graph: (as in the defini-
tion of k-outerplanar):
For a fixed 0 ≤ s < k + 1, delete every layer Li with i = s
(mod k + 1)
The resulting graph is k-outerplanar, hence it has treewidth at most
3k + 1.
Using the f (k, w ) · n time algorithm for Subgraph Isomorphism,
the problem can be solved in time f (k, 3k + 1) · n.
86. Baker’s shifting strategy
Subgraph Isomorphism for planar graphs: given planar graphs H and G , find a
copy of H in G as subgraph. Parameter k := |V (H)|.
Layers of the planar
graph: (as in the defini-
tion of k-outerplanar):
For a fixed 0 ≤ s < k + 1, delete every layer Li with i = s
(mod k + 1)
The resulting graph is k-outerplanar, hence it has treewidth at most
3k + 1.
Using the f (k, w ) · n time algorithm for Subgraph Isomorphism,
the problem can be solved in time f (k, 3k + 1) · n.
We do this for every 0 ≤ s < k + 1: for at least one value of s, we
do not delete any of the k vertices of the solution ⇒ we find a copy
of H in G if there is one.
Subgraph Isomorphism for planar graphs is FPT parameterized
by k := |V (H)|.
87. Baker’s shifting strategy
Subgraph Isomorphism for planar graphs: given planar graphs H and G , find a
copy of H in G as subgraph. Parameter k := |V (H)|.
Layers of the planar
graph: (as in the defini-
tion of k-outerplanar):
For a fixed 0 ≤ s < k + 1, delete every layer Li with i = s
(mod k + 1)
The resulting graph is k-outerplanar, hence it has treewidth at most
3k + 1.
Using the f (k, w ) · n time algorithm for Subgraph Isomorphism,
the problem can be solved in time f (k, 3k + 1) · n.
We do this for every 0 ≤ s < k + 1: for at least one value of s, we
do not delete any of the k vertices of the solution ⇒ we find a copy
of H in G if there is one.
Subgraph Isomorphism for planar graphs is FPT parameterized
by k := |V (H)|.
88. Baker’s shifting strategy
Subgraph Isomorphism for planar graphs: given planar graphs H and G , find a
copy of H in G as subgraph. Parameter k := |V (H)|.
Layers of the planar
graph: (as in the defini-
tion of k-outerplanar):
For a fixed 0 ≤ s < k + 1, delete every layer Li with i = s
(mod k + 1)
The resulting graph is k-outerplanar, hence it has treewidth at most
3k + 1.
Using the f (k, w ) · n time algorithm for Subgraph Isomorphism,
the problem can be solved in time f (k, 3k + 1) · n.
We do this for every 0 ≤ s < k + 1: for at least one value of s, we
do not delete any of the k vertices of the solution ⇒ we find a copy
of H in G if there is one.
Subgraph Isomorphism for planar graphs is FPT parameterized
by k := |V (H)|.
89. Baker’s shifting strategy
Subgraph Isomorphism for planar graphs: given planar graphs H and G , find a
copy of H in G as subgraph. Parameter k := |V (H)|.
Layers of the planar
graph: (as in the defini-
tion of k-outerplanar):
For a fixed 0 ≤ s < k + 1, delete every layer Li with i = s
(mod k + 1)
The resulting graph is k-outerplanar, hence it has treewidth at most
3k + 1.
Using the f (k, w ) · n time algorithm for Subgraph Isomorphism,
the problem can be solved in time f (k, 3k + 1) · n.
We do this for every 0 ≤ s < k + 1: for at least one value of s, we
do not delete any of the k vertices of the solution ⇒ we find a copy
of H in G if there is one.
Subgraph Isomorphism for planar graphs is FPT parameterized
by k := |V (H)|.
91. Detour to
approximation algorithms
Definition: A c-approximation algorithm for a maximization
problem is a polynomial-time algorithm that finds a solution of
cost at least OPT/c.
Definition: A c-approximation algorithm for a minimization
problem is a polynomial-time algorithm that finds a solution of
cost at most OPT · c.
There are well-known approximation algorithms for NP-hard
3
problems: 2 -approximation for Metric TSP, 2-approximation for
8
Vertex Cover, 7 -approximation for Max 3SAT, etc.
For some problems, we have lower bounds: there is no
(2 − )-approximation for Vertex Cover or
( 8 − )-approximation for Max 3SAT (under suitable
7
complexity assumptions).
For some other problems, arbitrarily good approximation is
possible in polynomial time: for any c > 1 (say,
c = 1.000001), there is a polynomial-time c-approximation
92. Approximation schemes
Definition: A polynomial-time approximation scheme (PTAS)
for a problem P is an algorithm that takes an instance of P and a
rational number > 0,
always finds a (1 + )-approximate solution,
the running time is polynomial in n for every fixed > 0.
2
Typical running times: 21/ · n, n1/ , (n/ )2 , n1/ .
Some classical problems that have a PTAS:
Independent Set for planar graphs
TSP in the Euclidean plane
Steiner Tree in planar graphs
Knapsack
93. Baker’s shifting strategy for EPTAS
Fact: There is a 2O(1/ ) · n time PTAS for Independent Set for
planar graphs.
Let D := 1/ . For a fixed 0 ≤ s < D, delete every layer Li
with i = s (mod D)
The resulting graph is D-outerplanar, hence it has treewidth
at most 3D + 1 = O(1/ ).
Using the O(2w · n) time algorithm for Independent Set,
the problem can be solved in time 2O(1/ ) · n.
We do this for every 0 ≤ s < D: for at least one value of s,
we delete at most 1/D = fraction of the solution ⇒ we get
a (1 + )-approximate solution.
95. Bidimensionality
A powerful framework to obtain efficient algorithms on planar
graphs.
Let x(G ) be some graph invariant (i.e., an integer associated with
each graph).
Some typical examples:
Maximum independent set size.
Minimum vertex cover size.
Length of the longest path.
Minimum dominating set size
Minimum feedback vertex set size.
Given G and k, we want to decide if x(G ) ≤ k (or x(G ) ≥ k).
√
For many natural invariants, we can do this in time 2O( k) · nO(1) .
98. Bidimensionality for
Vertex Cover
√
Observation: If √ treewidth of a planar graph G is at least 4 2k
the √
⇒ It contains a 2k × 2k grid minor (Excluded Grid Theorem
for planar graphs)
⇒ The vertex cover size of the grid is at least k in the grid
⇒ Vertex cover size is at least k in G .
We use this observation to solve Vertex Cover on planar
graphs as follows:
√
Set w := 4 2k.
Use the 4-approximation tree decomposition algorithm
√
(2O(w ) · nO(1) = 2O( k) · nO(1) time).
If treewidth is at least w : we answer ’vertex cover is ≥ k’.
If we get a tree decomposition of width 4w , then we can solve
√
the problem in time 2w · nO(1) = 2O( k) · nO(1) .
99. Bidimensionality (cont.)
Definition: A graph invariant x(G ) is minor-bidimensional if
x(G ) ≤ x(G ) for every minor G of G , and
If Gk is the k × k grid, then x(Gk ) ≥ ck 2 (for some constant
c > 0).
Examples: minimum vertex cover, length of the longest path,
feedback vertex set are minor-bidimensional.
100. Bidimensionality (cont.)
Definition: A graph invariant x(G ) is minor-bidimensional if
x(G ) ≤ x(G ) for every minor G of G , and
If Gk is the k × k grid, then x(Gk ) ≥ ck 2 (for some constant
c > 0).
Examples: minimum vertex cover, length of the longest path,
feedback vertex set are minor-bidimensional.
101. Bidimensionality (cont.)
Definition: A graph invariant x(G ) is minor-bidimensional if
x(G ) ≤ x(G ) for every minor G of G , and
If Gk is the k × k grid, then x(Gk ) ≥ ck 2 (for some constant
c > 0).
Examples: minimum vertex cover, length of the longest path,
feedback vertex set are minor-bidimensional.
102. Bidimensionality (cont.)
We can answer “x(G ) ≥ k?” for a minor-bidimensional parameter
the following way:
√
Set w := c k for an appropriate constant c.
Use the 4-approximation tree decomposition algorithm.
If treewidth is at least w : x(G ) is at least k.
If we get a tree decomposition of width 4w , then we can solve
the problem using dynamic programming on the tree
decomposition.
Running time:
If we can solve the problem using a width w tree
decomposition in time 2O(w ) · nO(1) , then the running time is
√
2O( k) · nO(1) .
If we can solve the problem using a width w tree
decomposition in time w O(w ) · nO(1) , then the running time is
√
2O( k log k) · nO(1) .
103. Summary
Notion of treewidth allows us to generalize dynamic
programming on trees to more general graphs.
Standard techniques for designing algorithms on bounded
treewidth graphs: dynamic programming and Courcelle’s
Theorem.
Surprising uses of treewidth in other contexts (planar graphs).