algorithmic graph structure theory › adfocs-13 › ... · classesofgraphs example: trees 1...

273
Algorithmic graph structure theory Dániel Marx 1 1 Institute for Computer Science and Control, Hungarian Academy of Sciences (MTA SZTAKI) Budapest, Hungary 14th Max Planck Advanced Course on the Foundations of Computer Science (ADFOCS 2013) August 5–9, 2013 Saarbrücken, Germany 1

Upload: others

Post on 28-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Algorithmic graph structure theory

Dániel Marx1

1Institute for Computer Science and Control,Hungarian Academy of Sciences (MTA SZTAKI)

Budapest, Hungary

14th Max Planck Advanced Course on the Foundations ofComputer Science (ADFOCS 2013)

August 5–9, 2013Saarbrücken, Germany

1

Classes of graphs

Classes of graphs can be described by1 what they do not have,

(excluded structures)2 how they look like

(constructions and decompositions).

In general, the second description is more useful for algorithmicpurposes.

2

Classes of graphs

Example: Trees1 Do not contain cycles (and connected)2 Have a tree structure.

Example: Bipartite graphs1 Do not contain odd cycles,2 Edges going only between two classes.

Example: Chordal graphs1 Do not contain induced cycles,2 Clique-tree decomposition and simplicial

ordering.

3

Graph Structure Theory

“Graph structure theory” usually refers to the theory developed byRobertson and Seymour on graphs excluding minors.

DefinitionGraph H is a minor of G (H ≤ G ) if H can be obtained from G bydeleting edges, deleting vertices, and contracting edges.

deleting uv

vu w

u vcontracting uv

4

Excluding minors

Theorem [Wagner 1937]

A graph is a planar if and only if it excludes K5 and K3,3 as a minor.

K5 K3,3

How do graphs excluding H (or H1, . . . , Hk) look like?What other classes can be defined this way?

The work of Robertson and Seymour gives some kind ofcombinatorial answer to that and provides tools for the relatedalgorithmic questions.

5

Excluding minors

Theorem [Wagner 1937]

A graph is a planar if and only if it excludes K5 and K3,3 as a minor.

K5 K3,3

How do graphs excluding H (or H1, . . . , Hk) look like?What other classes can be defined this way?

The work of Robertson and Seymour gives some kind ofcombinatorial answer to that and provides tools for the relatedalgorithmic questions.

5

Minor closed properties

DefinitionA set G of graphs is minor closed if G ∈ G and H ≤ G impliesH ∈ G.

Examples of minor closed properties:planar graphsgraphs that can be drawn on the torusacyclic graphs (forests)graphs having no cycle longer than kempty graphs

Examples of not minor closed properties:complete graphsregular graphsbipartite graphs

6

Wagner’s conjecture

Let G be a minor closed class of graphs. Then G can becharacterized by the minimal obstructions:

Let H ∈ F if H 6∈ G, but every proper minor of H is in G.

G ∈ G ⇐⇒ ∀H ∈ F ,H 6≤ G

Theorem [Robertson and Seymour]

Every class G closed under taking minors has a finite set F ofminimal obstructions.

7

Wagner’s conjecture

Let G be a minor closed class of graphs. Then G can becharacterized by the minimal obstructions:

Let H ∈ F if H 6∈ G, but every proper minor of H is in G.

G ∈ G ⇐⇒ ∀H ∈ F ,H 6≤ G

Theorem [Robertson and Seymour]

Every class G closed under taking minors has a finite set F ofminimal obstructions.

7

Graph Minors Theorem

Well-quasi-ordering:

Theorem [Robertson and Seymour]

Every class G closed under taking minors has a finite set F ofminimal obstructions.

Minor testing:

Theorem [Robertson and Seymour]

For every fixed graph H, there is an O(n3) time algorithm fortesting whether H is a minor of the given graph G .

Corollary: For every minor closed property G, there is anO(n3) time algorithm for testing whether a given graph G isin G.

8

Graph Minors results

The proof spans around 400 pages in the paper series “GraphMinors I–XXIII”.The size of the obstruction sets and the constants in thealgorithms can be astronomical even for simple properties.

Why should you know about this theory?The theory introduces simpler concepts and techniques thatare useful on their own in many contexts.Some of the more complicated results can be formulated asself-contained powerful statements that can be used as a blackbox.

9

Graph Minors results

The proof spans around 400 pages in the paper series “GraphMinors I–XXIII”.The size of the obstruction sets and the constants in thealgorithms can be astronomical even for simple properties.

Why should you know about this theory?The theory introduces simpler concepts and techniques thatare useful on their own in many contexts.Some of the more complicated results can be formulated asself-contained powerful statements that can be used as a blackbox.

9

Graph Minors Theorem

TreewidthGrid theoremsPlanar graphs

Structure theorem

Minor testing Well-quasi-ordering

10

Fixed-parameter tractability

Main definitionA parameterized problem is fixed-parameter tractable (FPT) ifthere is an f (k)nc time algorithm for some constant c .

Main goal of parameterized complexity: to find FPT problems.

Examples of NP-hard problems that are FPT:Finding a vertex cover of size k .Finding a path of length k .Finding k disjoint triangles.Drawing the graph in the plane with k edge crossings.Finding disjoint paths that connect k pairs of points.. . .

11

Fixed-parameter tractability

Main definitionA parameterized problem is fixed-parameter tractable (FPT) ifthere is an f (k)nc time algorithm for some constant c .

Main goal of parameterized complexity: to find FPT problems.

Examples of NP-hard problems that are FPT:Finding a vertex cover of size k .Finding a path of length k .Finding k disjoint triangles.Drawing the graph in the plane with k edge crossings.Finding disjoint paths that connect k pairs of points.. . .

11

Fixed-parameter tractability

Downey and Fellows started the systematic investigation offixed-parameter tractability and its hardness theory in the 80s.nf (k) vs. f (k) · nc .Many of the algorithmic results from graph structure theorycan be formulated and appreciated using the language offixed-parameter tractability.The original motivation of Downey and Fellows comes fromgraph structure theory!

12

Outline

TreewidthDefinition, algorithms, properties.Applications

Graphs on surfacesThe Graph Structure TheoremMinor TestingWell-quasi-orderingOther containment relations

13

The Party ProblemParty Problem

Problem: Invite some colleagues for a party.Maximize: The total fun factor of the invited people.Constraint: Everyone should be having fun.

6

644

5

2

Input: A tree withweights on the vertices.Task: Find anindependent set ofmaximum weight.

14

The Party ProblemParty Problem

Problem: 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 andhis direct boss at the same time!

6

644

5

2

Input: A tree withweights on the vertices.Task: Find anindependent set ofmaximum weight.

14

The Party ProblemParty Problem

Problem: 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 andhis direct boss at the same time!

6

644

5

2

Input: A tree withweights on the vertices.Task: Find anindependent set ofmaximum weight.

14

The Party ProblemParty Problem

Problem: 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 andhis direct boss at the same time!

2

5

4 4 6

6Input: A tree withweights on the vertices.Task: Find anindependent set ofmaximum weight.

14

Solving the Party Problem

Dynamic programming paradigm:We solve a large number of subproblems that depend on eachother. The answer is a single subproblem.

Subproblems:Tv : the subtree rooted at v .

A[v ]: max. weight of an independent set in TvB[v ]: max. weight of an independent set in Tv

that does not contain v

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

15

Solving the Party Problem

Subproblems:Tv : the subtree rooted at v .

A[v ]: max. weight of an independent set in TvB[v ]: max. weight of an independent set in Tv

that does not contain v

Recurrence:Assume v1, . . . , vk are the children of v . Use the recurrencerelations

B[v ] =∑k

i=1 A[vi ]

A[v ] = maxB[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).

15

Treewidth

16

Generalizing treesHow could we define that a graph is “treelike”?

1 Number of cycles is bounded.

good bad bad bad2 Removing a bounded number of vertices makes it acyclic.

good good bad bad3 Bounded-size parts connected in a tree-like way.

bad bad good good

17

Generalizing treesHow could we define that a graph is “treelike”?

1 Number of cycles is bounded.

good bad bad bad

2 Removing a bounded number of vertices makes it acyclic.

good good bad bad3 Bounded-size parts connected in a tree-like way.

bad bad good good

17

Generalizing treesHow could we define that a graph is “treelike”?

1 Number of cycles is bounded.

good bad bad bad2 Removing a bounded number of vertices makes it acyclic.

good good bad bad

3 Bounded-size parts connected in a tree-like way.

bad bad good good

17

Generalizing treesHow could we define that a graph is “treelike”?

1 Number of cycles is bounded.

good bad bad bad2 Removing a bounded number of vertices makes it acyclic.

good good bad bad3 Bounded-size parts connected in a tree-like way.

bad bad good good17

Treewidth — a measure of “tree-likeness”Tree decomposition: Vertices are arranged in a tree structuresatisfying the following properties:

1 If u and v are neighbors, then there is a bag containing bothof them.

2 For every v , the bags containing v form a connected subtree.

Width of the decomposition: largest bag size −1.treewidth: width of the best decomposition.

dcb

a

e f g h

g , hb, e, fa, b, c

d , f , gb, c, f

c, d , f

18

Treewidth — a measure of “tree-likeness”Tree decomposition: Vertices are arranged in a tree structuresatisfying the following properties:

1 If u and v are neighbors, then there is a bag containing bothof them.

2 For every v , the bags containing v form a connected subtree.

Width of the decomposition: largest bag size −1.treewidth: width of the best decomposition.

dcb

a

e f g h

b, e, f

b, c, f

a, b, c

c, d , f

d , f , g

g , h

18

Treewidth — a measure of “tree-likeness”Tree decomposition: Vertices are arranged in a tree structuresatisfying the following properties:

1 If u and v are neighbors, then there is a bag containing bothof them.

2 For every v , the bags containing v form a connected subtree.

Width of the decomposition: largest bag size −1.treewidth: width of the best decomposition.

dcb

a

e f g h

g , ha, b, c

b, c, f

c, d , f

d , f , g

b, e, f

18

Treewidth — a measure of “tree-likeness”Tree decomposition: Vertices are arranged in a tree structuresatisfying the following properties:

1 If u and v are neighbors, then there is a bag containing bothof them.

2 For every v , the bags containing v form a connected subtree.Width of the decomposition: largest bag size −1.treewidth: width of the best decomposition.

dcb

a

e f g h

g , ha, b, c

b, c, f

c, d , f

d , f , g

b, e, f

18

Treewidth — a measure of “tree-likeness”Tree decomposition: Vertices are arranged in a tree structuresatisfying the following properties:

1 If u and v are neighbors, then there is a bag containing bothof them.

2 For every v , the bags containing v form a connected subtree.Width of the decomposition: largest bag size −1.treewidth: width of the best decomposition.

dcb

a

e f g h

g , hb, e, fa, b, c

d , f , gb, c, f

c, d , f

Each bag is a separator.

18

Treewidth — a measure of “tree-likeness”Tree decomposition: Vertices are arranged in a tree structuresatisfying the following properties:

1 If u and v are neighbors, then there is a bag containing bothof them.

2 For every v , the bags containing v form a connected subtree.Width of the decomposition: largest bag size −1.treewidth: width of the best decomposition.

hgfe

a

b c d

g , hb, e, fa, b, c

d , f , gb, c, f

c, d , f

A subtree communicates with the outside worldonly via the root of the subtree.

18

Treewidth

Fact: treewidth = 1 ⇐⇒ graph is a forest

aa

b

d

c

f ge

h

aa

b

d

c

f ge

h

a,b a,c

b,d b,e c,g

e,h

⇒c,f

Exercise: A cycle cannot have a tree decomposition of width 1.

19

Treewidth — outline

1 Basic algorithms2 Combinatorial properties3 Applications

20

Finding tree decompositions

Hardness:

Theorem [Arnborg, Corneil, Proskurowski 1987]

It is NP-hard to determine the treewidth of a graph (given a graphG and an integer w , decide if the treewidth of G is at most w).

Fixed-parameter tractability:

Theorem [Bodlaender 1996]

There is a 2O(w3) · n time algorithm that finds a tree decompositionof width w (if exists).

Consequence:If we want an FPT algorithm parameterized by treewidth w of theinput graph, then we can assume that a tree decomposition ofwidth w is available.

21

Finding tree decompositions — approximately

Sometimes we can get better dependence on treewidth usingapproximation.

FPT approximation:

Theorem [Robertson and Seymour]

There is a O(33w · w · n2) time algorithm that finds a treedecomposition of width 4w + 1, if the treewidth of the graph is atmost w .

Polynomial-time approximation:

Theorem [Feige, Hajiaghayi, Lee 2008]

There is a polynomial-time algorithm that finds a treedecomposition of width O(w

√logw), if the treewidth of the graph

is at most w .

22

Weighted Max Independent Set and treewidthTheoremGiven a tree decomposition of width w , Weighted MaxIndependent Set can be solved in time O(2w · wO(1) · n).

Bx : vertices appearing in node x .Vx : vertices appearing in the subtree rooted at x .

Generalizing our solution for trees:

Instead of computing 2 values A[v ], B[v ]for each vertex of the graph, we compute2|Bx | ≤ 2w+1 values for each bag Bx .

M[x , S ]:the max. weight of an independent setI ⊆ Vx with I ∩ Bx = S .

c, d , f

b, c, f d , f , g

a, b, c b, e, f g , h

∅ =? bc =?b =? cf =?c =? bf =?f =? bcf =?

How to determine M[x , S ] if all the values are known forthe children of x?

23

Weighted Max Independent Set and treewidthTheoremGiven a tree decomposition of width w , Weighted MaxIndependent Set can be solved in time O(2w · wO(1) · n).

Bx : vertices appearing in node x .Vx : vertices appearing in the subtree rooted at x .

Generalizing our solution for trees:

Instead of computing 2 values A[v ], B[v ]for each vertex of the graph, we compute2|Bx | ≤ 2w+1 values for each bag Bx .

M[x , S ]:the max. weight of an independent setI ⊆ Vx with I ∩ Bx = S .

c, d , f

b, c, f d , f , g

a, b, c b, e, f g , h

∅ =? bc =?b =? cf =?c =? bf =?f =? bcf =?

How to determine M[x , S ] if all the values are known forthe children of x? 23

Nice tree decompositions

DefinitionA rooted tree decomposition is nice if every node x is one of thefollowing 4 types:

Leaf: no children, |Bx | = 1Introduce: 1 child y with Bx = By ∪ v for some vertex vForget: 1 child y with Bx = By \ v for some vertex vJoin: 2 children y1, y2 with Bx = By1 = By2

Forget JoinIntroduceLeaf

u, v ,w

u,w u, v ,w

u,wv u, v ,w

u, v ,wu, v ,w

24

Nice tree decompositions

DefinitionA rooted tree decomposition is nice if every node x is one of thefollowing 4 types:

Leaf: no children, |Bx | = 1Introduce: 1 child y with Bx = By ∪ v for some vertex vForget: 1 child y with Bx = By \ v for some vertex vJoin: 2 children y1, y2 with Bx = By1 = By2

TheoremA tree decomposition of width w and n nodes can be turned into anice tree decomposition of width w and O(wn) nodes in timeO(w2n).

24

Weighted Max Independent Setand nice tree decompositions

Leaf: no children, |Bx | = 1Trivial!Introduce: 1 child y with Bx = By ∪ v for some vertex v

m[x , S ] =

m[y , S ] if v 6∈ S ,

m[y , S \ v] + w(v) if v ∈ S but v has noneighbor in S ,

−∞ if S contains v and its neighbor.

Forget JoinIntroduceLeaf

u, v ,w

u,w u, v ,w

u,wv u, v ,w

u, v ,wu, v ,w

25

Weighted Max Independent Setand nice tree decompositions

Forget: 1 child y with Bx = By \ v for some vertex v

m[x , S ] = maxm[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)

Forget JoinIntroduceLeaf

u, v ,w

u,w u, v ,w

u,wv u, v ,w

u, v ,wu, v ,w

25

Weighted Max Independent Setand nice tree decompositions

Forget: 1 child y with Bx = By \ v for some vertex v

m[x , S ] = maxm[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 eachsubproblem can be solved in wO(1) time

(assuming the children are already solved).⇓

Running time is O(2w · wO(1) · n).

25

3-Coloring and tree decompositionsTheoremGiven a tree decomposition of width w , 3-Coloring can besolved in O(3w · wO(1) · n).

Bx : vertices appearing in node x .Vx : vertices appearing in the subtree rooted at x .

For every node x and coloring c : Bx →1, 2, 3, we compute the Boolean valueE [x , c], which is true if and only if c canbe extended to a proper 3-coloring of Vx .

c, d , f

b, c, f d , f , g

a, b, c b, e, f g , h

bcf=T bcf=Fbcf=T bcf=F. . . . . .

How to determine E [x , c] if all the values are known forthe children of x?

26

3-Coloring and tree decompositionsTheoremGiven a tree decomposition of width w , 3-Coloring can besolved in O(3w · wO(1) · n).

Bx : vertices appearing in node x .Vx : vertices appearing in the subtree rooted at x .

For every node x and coloring c : Bx →1, 2, 3, we compute the Boolean valueE [x , c], which is true if and only if c canbe extended to a proper 3-coloring of Vx .

c, d , f

b, c, f d , f , g

a, b, c b, e, f g , h

bcf=T bcf=Fbcf=T bcf=F. . . . . .

How to determine E [x , c] if all the values are known forthe children of x?

26

3-Coloring and nice tree decompositionsLeaf: no children, |Bx | = 1Trivial!Introduce: 1 child y with Bx = By ∪ v for some vertex vIf c(v) 6= c(u) for every neighbor u of v , thenE [x , c] = E [y , c ′], where c ′ is c restricted to By .Forget: 1 child y with Bx = By \ v for some vertex vE [x , c] is true if E [y , c ′] is true for one of the 3 extensions of cto By .Join: 2 children y1, y2 with Bx = By1 = By2

E [x , c] = E [y1, c] ∧ E [y2, c]

Forget JoinIntroduceLeafu, v ,w

u,w u, v ,w

u,wv u, v ,w

u, v ,wu, v ,w

27

3-Coloring and nice tree decompositionsLeaf: no children, |Bx | = 1Trivial!Introduce: 1 child y with Bx = By ∪ v for some vertex vIf c(v) 6= c(u) for every neighbor u of v , thenE [x , c] = E [y , c ′], where c ′ is c restricted to By .Forget: 1 child y with Bx = By \ v for some vertex vE [x , c] is true if E [y , c ′] is true for one of the 3 extensions of cto 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 subprob-lem can be solved in wO(1) time (assuming the children are alreadysolved).

⇒ Running time is O(3w · wO(1) · n).

⇒ 3-Coloring is FPT parameterized by treewidth.

27

Monadic Second Order Logic

Extended Monadic Second Order Logic (EMSO)

A logical language on graphs consisting of the following:Logical connectives ∧, ∨, →, ¬, =, 6=quantifiers ∀, ∃ over vertex/edge variablespredicate adj(u, v): vertices u and v are adjacentpredicate inc(e, v): edge e is incident to vertex vquantifiers ∀, ∃ over vertex/edge set variables∈, ⊆ for vertex/edge sets

Example:The formula

∃C ⊆ V∃v0 ∈ C∀v ∈ C ∃u1, u2 ∈ C(u1 6= u2 ∧ adj(u1, v) ∧ adj(u2, v))

is true on graph G if and only if . . .

28

Monadic Second Order Logic

Extended Monadic Second Order Logic (EMSO)

A logical language on graphs consisting of the following:Logical connectives ∧, ∨, →, ¬, =, 6=quantifiers ∀, ∃ over vertex/edge variablespredicate adj(u, v): vertices u and v are adjacentpredicate inc(e, v): edge e is incident to vertex vquantifiers ∀, ∃ over vertex/edge set variables∈, ⊆ for vertex/edge sets

Example:The formula

∃C ⊆ V∃v0 ∈ C∀v ∈ C ∃u1, u2 ∈ C(u1 6= u2 ∧ adj(u1, v) ∧ adj(u2, v))

is true on graph G if and only if G has a cycle.

28

Courcelle’s Theorem

Courcelle’s TheoremIf a graph property can be expressed in EMSO, then for every fixedw ≥ 1, there is a linear-time algorithm for testing this property ongraphs having treewidth at most w .

Note: The constant depending on w can be very large (double,triple exponential etc.), therefore a direct dynamic programmingalgorithm can be more efficient.

If we can express a property in EMSO, then we immediately getthat testing this property is FPT parameterized by the treewidth wof the input graph.

Can we express 3-Coloring and Hamiltonian Cycle inEMSO?

29

Courcelle’s Theorem

Courcelle’s TheoremIf a graph property can be expressed in EMSO, then for every fixedw ≥ 1, there is a linear-time algorithm for testing this property ongraphs having treewidth at most w .

Note: The constant depending on w can be very large (double,triple exponential etc.), therefore a direct dynamic programmingalgorithm can be more efficient.

If we can express a property in EMSO, then we immediately getthat testing this property is FPT parameterized by the treewidth wof the input graph.

Can we express 3-Coloring and Hamiltonian Cycle inEMSO?

29

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))

)

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 6=

e2 ∧ inc(e1, v) ∧ inc(e2, v)))

degree2(H, v) := ¬degree0(H, v) ∧ ¬degree1(H, v) ∧(¬∃e1, e2, e3 ∈

H (e1 6= e2 ∧ e2 6= e3 ∧ e1 6= 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 6= u ∧ x 6= v ∧ (degree0(P, x) ∨ degree2(P, x))))

30

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))

)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 6=

e2 ∧ inc(e1, v) ∧ inc(e2, v)))

degree2(H, v) := ¬degree0(H, v) ∧ ¬degree1(H, v) ∧(¬∃e1, e2, e3 ∈

H (e1 6= e2 ∧ e2 6= e3 ∧ e1 6= 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 6= u ∧ x 6= v ∧ (degree0(P, x) ∨ degree2(P, x))))

30

Using Courcelle’s TheoremTwo 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 oftreewidth at most w , i.e., FPT parameterized by treewidth.

2 The problem can be described by a formula for each value ofthe parameter k .

Example: For each k , having a cycle of length exactly k canbe expressed as

∃v1, . . . , vk ∈ V ((v1 6= v2) ∧ (v1 6= v3) ∧ . . . (vk−1 6= vk))

∧(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 oftreewidth w , i.e., FPT parameterized with combinedparameter k and treewidth w .

31

Using Courcelle’s TheoremTwo 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 oftreewidth at most w , i.e., FPT parameterized by treewidth.

2 The problem can be described by a formula for each value ofthe parameter k .

Example: For each k , having a cycle of length exactly k canbe expressed as

∃v1, . . . , vk ∈ V ((v1 6= v2) ∧ (v1 6= v3) ∧ . . . (vk−1 6= vk))

∧(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 oftreewidth w , i.e., FPT parameterized with combinedparameter k and treewidth w .

31

Subgraph Isomorphism

Subgraph IsomorphismInput: graphs H and GFind: a copy of H in G as subgraph.

32

Subgraph Isomorphism

Subgraph IsomorphismInput: graphs H and GFind: a copy of H in G as subgraph.

For each H, we can construct a formula φH that expresses “G has asubgraph isomorphic to H” (similarly to the k-cycle on the previousslide).

⇒ By Courcelle’s Theorem, Subgraph Isomorphism can besolved in time f (H,w) · n if G has treewidth at most w .

32

Subgraph Isomorphism

Subgraph IsomorphismInput: graphs H and GFind: a copy of H in G as subgraph.

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 Hhas k vertices and G has treewidth at most w .

TheoremSubgraph Isomorphism is FPT parameterized by combinedparameter k := |V (H)| and the treewidth w of G .

32

MSO on words

Theorem [Büchi, Elgot, Trakhtenbrot 1960]

If a language L ⊆ Σ∗ can be defined by an MSO formula φ usingthe relation <, then L is regular.

Example: a∗bc∗ is defined by

∃x : Pb(x) ∧ (∀y : (y < x)→ Pa(y)) ∧ (∀y : (x < y)→ Pc(y)).

33

MSO on words

Theorem [Büchi, Elgot, Trakhtenbrot 1960]

If a language L ⊆ Σ∗ can be defined by an MSO formula φ usingthe relation <, then L is regular.

Example: a∗bc∗ is defined by

∃x : Pb(x) ∧ (∀y : (y < x)→ Pa(y)) ∧ (∀y : (x < y)→ Pc(y)).

We prove a more general statement for formulas φ(w ,X1, . . . ,Xk)and words over Σ ∪ 0, 1k , where Xi is a subset of symbols of w .

Induction over the structure of φ:FSM for ¬φ(w), given FSM for φ(w).FSM for φ1(w) ∧ φ2(w), given FSMs for φ1(w) and φ2(w).FSM for ∃Xφ(w ,X ), given FSM for φ(w ,X ).etc.

33

MSO on words

Theorem [Büchi, Elgot, Trakhtenbrot 1960]

If a language L ⊆ Σ∗ can be defined by an MSO formula φ usingthe relation <, then L is regular.

Proving Courcelle’s Theorem:Generalize from words to trees.A width-k tree decomposition can be interpreted as a tree overan alphabet of size f (k).Formula ⇒ tree automata.

33

Algorithms — overview

Algorithms exploit the fact that a subtree communicates withthe rest of the graph via a single bag.Key point: defining the subproblems.Courcelle’s Theorem makes this process automatic for manyproblems.There are notable problems that are easy for trees, but hardfor bounded-treewidth graphs.

34

Treewidth — outline

1 Basic algorithms2 Combinatorial properties3 Applications

35

Properties of treewidth

Fact: Treewidth does not increase if we delete edges, deletevertices, or contract edges.

⇒ If F is a minor of G , then the treewidth of F is at most thetreewidth of G .

Fact: For every clique K , there is a bag B with K ⊆ B .

Fact: The treewidth of the k-clique is k − 1.

Fact: For every k ≥ 2, the treewidth ofthe k × k grid is exactly k .

36

Properties of treewidth

Fact: Treewidth does not increase if we delete edges, deletevertices, or contract edges.

⇒ If F is a minor of G , then the treewidth of F is at most thetreewidth of G .

Fact: For every clique K , there is a bag B with K ⊆ B .

Fact: The treewidth of the k-clique is k − 1.

Fact: For every k ≥ 2, the treewidth ofthe k × k grid is exactly k .

36

Properties of treewidth

Fact: Treewidth does not increase if we delete edges, deletevertices, or contract edges.

⇒ If F is a minor of G , then the treewidth of F is at most thetreewidth of G .

Fact: For every clique K , there is a bag B with K ⊆ B .

Fact: The treewidth of the k-clique is k − 1.

Fact: For every k ≥ 2, the treewidth ofthe k × k grid is exactly k .

36

The Cops and Robber gameGame: k cops try to capture a robber in the graph.

In each step, the cops can move from vertex to vertexarbitrarily with helicopters.The robber moves infinitely fast on the edges, and sees wherethe cops will land.

Theorem [Seymour and Thomas 1993]

k+1 cops can win the game ⇐⇒ the treewidth of the graphis at most k .

37

The Cops and Robber gameGame: k cops try to capture a robber in the graph.

In each step, the cops can move from vertex to vertexarbitrarily with helicopters.The robber moves infinitely fast on the edges, and sees wherethe cops will land.

Theorem [Seymour and Thomas 1993]

k+1 cops can win the game ⇐⇒ the treewidth of the graphis at most k .

Consequence 1: Algorithms

The winner of the game can be determined in time nO(k) using stan-dard techniques (there are at most nk positions for the cops)

For every fixed k , it can be checked in polynomial-time if treewidthis at most k .

37

The Cops and Robber gameGame: k cops try to capture a robber in the graph.

In each step, the cops can move from vertex to vertexarbitrarily with helicopters.The robber moves infinitely fast on the edges, and sees wherethe cops will land.

Theorem [Seymour and Thomas 1993]

k+1 cops can win the game ⇐⇒ the treewidth of the graphis at most k .

Consequence 2: Lower bounds

Exercise 1:Show that the treewidth of the k × k grid is at least k − 1.(E.g., robber can win against k − 1 cops.)

Exercise 2:Show that the treewidth of the k × k grid is at least k .(E.g., robber can win against k cops.) 37

The Cops and Robber game

Example: 2 cops have a winning strategy in a tree.

38

The Cops and Robber game

Example: 2 cops have a winning strategy in a tree.

38

The Cops and Robber game

Example: 2 cops have a winning strategy in a tree.

38

The Cops and Robber game

Example: 2 cops have a winning strategy in a tree.

38

The Cops and Robber game

Example: 2 cops have a winning strategy in a tree.

38

The Cops and Robber game

Example: 2 cops have a winning strategy in a tree.

38

The Cops and Robber game

Example: 2 cops have a winning strategy in a tree.

38

The Cops and Robber game

Example: 2 cops have a winning strategy in a tree.

38

The Cops and Robber game

Example: 2 cops have a winning strategy in a tree.

38

A perfect structure theoremTheoremThe following are equivalent:

G does not have a K4 minor.G has treewidth ≤ 2.G is subgraph of a series-parallel graph.

39

A perfect structure theoremTheoremThe following are equivalent:

G does not have a K4 minor.G has treewidth ≤ 2.G is subgraph of a series-parallel graph.

A perfect structure theorem:

K4 6∈ G =⇒ G has a width-2tree decomposition

G has a width-2tree decomposition

=⇒ K4 6∈ G

39

Excluded Grid Theorem

Excluded Grid Theorem [Diestel et al. 1999]

If the treewidth of G is at least k4k2(k+2), then G has a k × k gridminor.

(A kO(1) bound was just announced [Chekuri and Chuznoy 2013]!)

40

Excluded Grid Theorem

Excluded Grid Theorem [Diestel et al. 1999]

If the treewidth of G is at least k4k2(k+2), then G has a k × k gridminor.

Observation: Every planar graph is the minor of a sufficiently largegrid.

ConsequenceIf H is planar, then every H-minor free graph has treewidth at mostf (H).

40

Excluded Grid Theorem

Excluded Grid Theorem [Diestel et al. 1999]

If the treewidth of G is at least k4k2(k+2), then G has a k × k gridminor.

A large grid minor is a “witness” that treewidth is large, but therelation is approximate:

No k × k grid minor =⇒ tree decompositionof width < f (k)

tree decompositionof width < f (k)

=⇒ no f (k)× f (k) gridminor

40

Excluding trees

As every forest is planar, the following holds for every forest F :

no F -minor =⇒ tree decompositionof width < f (F )

tree decompositionof width < f (F )

=⇒ Does not exclude anytree as minor!

This is not a good (approximate) structure theorem.

41

Excluding treesPath decomposition: the tree of bags is a path.Pathwidth: defined analogously to treewidth.Example: A complete binary tree on k levels has pathwidth k − 1.

Theorem [Diestel 1995]

If F is a forest, then every F -minor free graph has pathwidth atmost |V (F )| − 2.

a, b, c b, c, d d , e e, f , g e, h, i e, j

a

b

c

d e j

f g

ih

42

Excluding treesPath decomposition: the tree of bags is a path.Pathwidth: defined analogously to treewidth.Example: A complete binary tree on k levels has pathwidth k − 1.

Theorem [Diestel 1995]

If F is a forest, then every F -minor free graph has pathwidth atmost |V (F )| − 2.

no F -minor =⇒ path decompositionof width < f (F )

path decompositionof width < f (F )

=⇒ No (f (F ) + 1)-levelcomplete binary tree

42

Planar Excluded Grid Theorem

For planar graphs, we get linear instead of exponential dependence:

Theorem [Robertson, Seymour, Thomas 1994]

Every planar graph with treewidth at least 5k has a k × k gridminor.

43

Outerplanar graphs

DefinitionA planar graph is outerplanar if it has a planar embedding whereevery vertex is on the infinite face.

FactEvery outerplanar graph has treewidth at most 2.

⇒ Every outerplanar graph is subgraph of a series-parallel graph.

44

k-outerplanar graphsGiven a planar embedding, we can define layers by iterativelyremoving the vertices on the infinite face.

DefinitionA planar graph is k-outerplanar if it has a planar embeddinghaving at most k layers.

1 1 1

12

2

1

2

3

3

2

3

3

3

3

2

2

2

32

2

2

1

FactEvery k-outerplanar graph has treewidth at most 3k + 1.

45

k-outerplanar graphsGiven a planar embedding, we can define layers by iterativelyremoving the vertices on the infinite face.

DefinitionA planar graph is k-outerplanar if it has a planar embeddinghaving at most k layers.

1 1 1

12

2

1

2

3

3

2

3

3

3

3

2

2

2

32

2

2

1

FactEvery k-outerplanar graph has treewidth at most 3k + 1.

45

k-outerplanar graphsGiven a planar embedding, we can define layers by iterativelyremoving the vertices on the infinite face.

DefinitionA planar graph is k-outerplanar if it has a planar embeddinghaving at most k layers.

2

2

2 3

2

2

2

3

3

3

3

2

3

3

2

2

2

FactEvery k-outerplanar graph has treewidth at most 3k + 1.

45

k-outerplanar graphsGiven a planar embedding, we can define layers by iterativelyremoving the vertices on the infinite face.

DefinitionA planar graph is k-outerplanar if it has a planar embeddinghaving at most k layers.

2

2

2

3

3

2

3

3

3

3

2

2

2

32

2

2

FactEvery k-outerplanar graph has treewidth at most 3k + 1.

45

k-outerplanar graphsGiven a planar embedding, we can define layers by iterativelyremoving the vertices on the infinite face.

DefinitionA planar graph is k-outerplanar if it has a planar embeddinghaving at most k layers.

3

33

3

3

3

3

FactEvery k-outerplanar graph has treewidth at most 3k + 1.

45

Treewidth — outline

1 Basic algorithms2 Combinatorial properties3 Applications

The shifting techniqueBidimensionalityComplexity of CSP

46

Approximation schemes

DefinitionA polynomial-time approximation scheme (PTAS) for aproblem P is an algorithm that takes an instance of P and arational number ε > 0,

always finds a (1 + ε)-approximate solution,the running time is polynomial in n for every fixed ε > 0.

Typical running times: 21/ε · n, n1/ε, (n/ε)2, n1/ε2 .

Some classical problems that have a PTAS:Independent Set for planar graphsTSP in the Euclidean planeSteiner Tree in planar graphsKnapsack

47

Baker’s shifting strategy for PTASTheoremThere is a 2O(1/ε) · n time PTAS for Independent Set for planargraphs.

Let D := 1/ε. For a fixed 0 ≤ s < D, delete every layer Liwith i = s (mod D)

The resulting graph is D-outerplanar, hence it has treewidth atmost 3D + 1 = O(1/ε).Using the 2O(tw) · n time algorithm for Independent Set,the problem on the D-outerplanar graph can be solved in time2O(1/ε) · n.

48

Baker’s shifting strategy for PTASTheoremThere is a 2O(1/ε) · n time PTAS for Independent Set for planargraphs.

Let D := 1/ε. For a fixed 0 ≤ s < D, delete every layer Liwith i = s (mod D)

The resulting graph is D-outerplanar, hence it has treewidth atmost 3D + 1 = O(1/ε).Using the 2O(tw) · n time algorithm for Independent Set,the problem on the D-outerplanar graph can be solved in time2O(1/ε) · n.

48

Baker’s shifting strategy for PTASTheoremThere is a 2O(1/ε) · n time PTAS for Independent Set for planargraphs.

Let D := 1/ε. For a fixed 0 ≤ s < D, delete every layer Liwith i = s (mod D)

The resulting graph is D-outerplanar, hence it has treewidth atmost 3D + 1 = O(1/ε).Using the 2O(tw) · n time algorithm for Independent Set,the problem on the D-outerplanar graph can be solved in time2O(1/ε) · n.

48

Baker’s shifting strategy for PTASTheoremThere is a 2O(1/ε) · n time PTAS for Independent Set for planargraphs.

Let D := 1/ε. For a fixed 0 ≤ s < D, delete every layer Liwith i = s (mod D)

The resulting graph is D-outerplanar, hence it has treewidth atmost 3D + 1 = O(1/ε).Using the 2O(tw) · n time algorithm for Independent Set,the problem on the D-outerplanar graph can be solved in time2O(1/ε) · n.

48

Baker’s shifting strategy for PTASTheoremThere is a 2O(1/ε) · n time PTAS for Independent Set for planargraphs.

Let D := 1/ε. For a fixed 0 ≤ s < D, delete every layer Liwith i = s (mod D)

The resulting graph is D-outerplanar, hence it has treewidth atmost 3D + 1 = O(1/ε).Using the 2O(tw) · n time algorithm for Independent Set,the problem on the D-outerplanar graph can be solved in time2O(1/ε) · n.

48

Baker’s shifting strategy for PTASTheoremThere is a 2O(1/ε) · n time PTAS for Independent Set for planargraphs.

Let D := 1/ε. For a fixed 0 ≤ s < D, delete every layer Liwith i = s (mod D)

The resulting graph is D-outerplanar, hence it has treewidth atmost 3D + 1 = O(1/ε).Using the 2O(tw) · n time algorithm for Independent Set,the problem on the D-outerplanar graph can be solved in time2O(1/ε) · n. 48

Baker’s shifting strategy for PTASTheoremThere is a 2O(1/ε) · n time PTAS for Independent Set for planargraphs.

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.

48

Baker’s shifting strategy for FPT

Subgraph IsomorphismInput: graphs H and GFind: a copy of H in G as subgraph.

49

Baker’s shifting strategy for FPT

Subgraph IsomorphismInput: graphs H and GFind: a copy of H in G as subgraph.

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 atmost 3k + 1.Using the f (k , tw) · n time algorithm for SubgraphIsomorphism, the problem can be solved in timef (k , 3k + 1) · n.

49

Baker’s shifting strategy for FPT

Subgraph IsomorphismInput: graphs H and GFind: a copy of H in G as subgraph.

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 atmost 3k + 1.Using the f (k , tw) · n time algorithm for SubgraphIsomorphism, the problem can be solved in timef (k , 3k + 1) · n.

49

Baker’s shifting strategy for FPT

Subgraph IsomorphismInput: graphs H and GFind: a copy of H in G as subgraph.

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 atmost 3k + 1.Using the f (k , tw) · n time algorithm for SubgraphIsomorphism, the problem can be solved in timef (k , 3k + 1) · n.

49

Baker’s shifting strategy for FPT

Subgraph IsomorphismInput: graphs H and GFind: a copy of H in G as subgraph.

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 atmost 3k + 1.Using the f (k , tw) · n time algorithm for SubgraphIsomorphism, the problem can be solved in timef (k , 3k + 1) · n.

49

Baker’s shifting strategy for FPT

Subgraph IsomorphismInput: graphs H and GFind: a copy of H in G as subgraph.

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 atmost 3k + 1.Using the f (k , tw) · n time algorithm for SubgraphIsomorphism, the problem can be solved in timef (k , 3k + 1) · n. 49

Baker’s shifting strategy for FPT

Subgraph IsomorphismInput: graphs H and GFind: a copy of H in G as subgraph.

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.

49

Baker’s shifting strategy for FPT

Subgraph IsomorphismInput: graphs H and GFind: a copy of H in G as subgraph.

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.

49

Baker’s shifting strategy for FPT

Subgraph IsomorphismInput: graphs H and GFind: a copy of H in G as subgraph.

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.

49

Baker’s shifting strategy for FPT

Subgraph IsomorphismInput: graphs H and GFind: a copy of H in G as subgraph.

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.

49

Baker’s shifting strategy for FPT

Subgraph IsomorphismInput: graphs H and GFind: a copy of H in G as subgraph.

TheoremSubgraph Isomorphism for planar graphs is FPT parameterizedby k := |V (H)|.

49

Baker’s shifting strategy for FPT

The technique is very general, works for many problems onplanar graphs:

Independent SetVertex CoverDominating Set. . .

More generally: First-Order Logic problems.But for some of these problems, much better techniques areknown (see the following slides).

50

BidimensionalityA powerful framework for efficient algorithms on planar graphs.

Setup:

Let x(G ) be some graph invariant (i.e., an integer associatedwith each graph).Given G and k , we want to decide if x(G ) ≤ k (or x(G ) ≥ k).Typical examples:

Maximum independent set size.Minimum vertex cover size.Length of the longest path.Minimum dominating set size.Minimum feedback vertex set size.

Bidimensionality [Demaine, Fomin, Hajiaghayi, Thilikos 2005]

For many natural invariants, we can do this in time 2O(√

k) · nO(1)

on planar graphs.

51

Bidimensionality for Vertex CoverObservation: If the treewidth of a planar graph G is at least 5

√2k

⇒ It has a√2k ×

√2k grid minor (Planar Excluded Grid Theorem)

⇒ The grid has a matching of size k⇒ Vertex cover size 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:

52

Bidimensionality for Vertex CoverObservation: If the treewidth of a planar graph G is at least 5

√2k

⇒ It has a√2k ×

√2k grid minor (Planar Excluded Grid Theorem)

⇒ The grid has a matching of size k⇒ Vertex cover size 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:

Set w := 5√2k .

Find a 4-approximate treedecomposition.

If treewidth is at least w : weanswer “vertex cover is ≥ k .”If we get a tree decomposition ofwidth 4w , then we can solve theproblem in time2O(w) · nO(1) = 2O(

√k) · nO(1).

52

BidimensionalityDefinitionA graph invariant x(G ) is minor-bidimensional if

x(G ′) ≤ x(G ) for every minor G ′ of G , andIf Gk is the k × k grid, then x(Gk) ≥ ck2

(for some constant c > 0).

Examples: minimum vertex cover, length of the longest path,feedback vertex set are minor-bidimensional.

53

BidimensionalityDefinitionA graph invariant x(G ) is minor-bidimensional if

x(G ′) ≤ x(G ) for every minor G ′ of G , andIf Gk is the k × k grid, then x(Gk) ≥ ck2

(for some constant c > 0).

Examples: minimum vertex cover, length of the longest path,feedback vertex set are minor-bidimensional.

53

BidimensionalityDefinitionA graph invariant x(G ) is minor-bidimensional if

x(G ′) ≤ x(G ) for every minor G ′ of G , andIf Gk is the k × k grid, then x(Gk) ≥ ck2

(for some constant c > 0).

Examples: minimum vertex cover, length of the longest path,feedback vertex set are minor-bidimensional.

53

Bidimensionality (cont.)

We can answer “x(G ) ≥ k?” for a minor-bidimensional invariantthe 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 solvethe problem using dynamic programming on the treedecomposition.

Running time:If we can solve the problem on tree decomposition of width win time 2O(w) · nO(1), then the running time is 2O(

√k) · nO(1).

If we can solve the problem on tree decomposition of width win time wO(w) · nO(1), then the running time is2O(√

k log k) · nO(1).

54

Contraction bidimensionality

DefinitionA graph invariant x(G ) is minor-bidimensional if

x(G ′) ≤ x(G ) for every minor G ′ of G , andIf Gk is the k × k grid, then x(Gk) ≥ ck2

(for some constant c > 0).

Exercise: Dominating Set is not minor-bidimensional.

We fix the problem by allowing only contractions but notedge/vertex deletions.

55

Contraction bidimensionality

DefinitionA graph invariant x(G ) is minor-bidimensional if

x(G ′) ≤ x(G ) for every minor G ′ of G , andIf Gk is the k × k grid, then x(Gk) ≥ ck2

(for some constant c > 0).

Exercise: Dominating Set is not minor-bidimensional.

We fix the problem by allowing only contractions but notedge/vertex deletions.

55

Contraction bidimensionality

TheoremEvery planar graph with treewidth at least 5k can be contractedto a partially triangulated k × k grid.

Example:

56

Contraction bidimensionality

DefinitionA graph invariant x(G ) is contraction-bidimensional if

x(G ′) ≤ x(G ) for every contraction G ′ of G , andIf Gk is a k × k partially triangulated grid, then x(Gk) ≥ ck2

(for some constant c > 0).

Example:

56

Contraction bidimensionality

DefinitionA graph invariant x(G ) is contraction-bidimensional if

x(G ′) ≤ x(G ) for every contraction G ′ of G , andIf Gk is a k × k partially triangulated grid, then x(Gk) ≥ ck2

(for some constant c > 0).

Example: minimum dominating set, maximum independent set arecontraction-bidimensional. 56

Contraction bidimensionality

DefinitionA graph invariant x(G ) is contraction-bidimensional if

x(G ′) ≤ x(G ) for every contraction G ′ of G , andIf Gk is a k × k partially triangulated grid, then x(Gk) ≥ ck2

(for some constant c > 0).

Example: minimum dominating set, maximum independent set arecontraction-bidimensional. 56

Bidimensionality for Dominating Set

The size of a minimum dominating set is a contractionbidimensional invariant: we need at least (k − 2)2/9 vertices todominate all the internal vertices of a partially triangulated k × kgrid (since a vertex can dominate at most 9 internal vertices).

TheoremGiven a tree decomposition of width w , Dominating Set can besolved in time 3w · wO(1) · nO(1).

Solving Dominating Set on planar graphs:

Set w := 5(3√k + 2).

Use the 4-approximation tree decomposition algorithm.If treewidth is at least w : we answer ’dominating set is ≥ k’.If we get a tree decomposition of width 4w , then we can solvethe problem in time 3w · nO(1) = 2O(

√k) · nO(1).

57

Constraint Satisfaction Problems (CSP)

A CSP instance is given by describing thevariables,domain of the variables,constraints on the variables.

Task: Find an assignment that satisfies every constraint.

I = C1(x1, x2, x3) ∧ C2(x2, x4) ∧ C3(x1, x3, x4)

Examples:3SAT: 2-element domain, every constraint is ternaryVertex Coloring: domain is the set of colors, binaryconstraintsk-Clique (in graph G ): k variables, domain is the vertices ofG ,(k2

)binary constraints

58

Constraint Satisfaction Problems (CSP)

A CSP instance is given by describing thevariables,domain of the variables,constraints on the variables.

Task: Find an assignment that satisfies every constraint.

I = C1(x1, x2, x3) ∧ C2(x2, x4) ∧ C3(x1, x3, x4)

Examples:3SAT: 2-element domain, every constraint is ternaryVertex Coloring: domain is the set of colors, binaryconstraintsk-Clique (in graph G ): k variables, domain is the vertices ofG ,(k2

)binary constraints

58

Graphs and hypergraphs related to CSPGaifman/primal graph: vertices are the variables, two variablesare adjacent if they appear in a common constraint.

Incidence graph: bipartite graph, vertices are the variables andconstraints.

Hypergraph: vertices are the variables, constraints are thehyperedges.

I = C1(x2, x1, x3) ∧ C2(x4, x3) ∧ C3(x1, x4, x2)

C1 C3

C2HypergraphIncidence graphPrimal graph

x3

x2

x1

x4 x4

x4

C3x3

x2

x1

C2C1

x3x2x1

59

Treewidth and CSP

Theorem [Freuder 1990]

For every fixed k , CSP can be solved in polynomial time if theprimal graph of the instance has treewidth at most k .

Proof sketch:Find a tree decomposition of width k (linear-time for fixed k).For each bag, enumerate every assignment of the bag thatsatisfies every constraint fully contained in the bag. Each baghas at most k + 1 variables, thus there are at most |D|k+1

such assignments for each bag.Use bottom-up DP to find a satisfying assignment.Each constraint induces a clique in the primal graph, thus eachconstraint is fully contained in one of the bags.Running time of DP is polynomial in |D|k+1 and the numberof variables.

60

Dichotomy for binary CSPBinary CSP: Every constraint is of arity 2.We know that binary CSP(G) is polynomial-time solvable for everyclass G of graphs with bounded treewidth. Are there otherpolynomial cases?

Theorem [Grohe-Schwentick-Segoufin 2001]

Let G be a recursively enumerable class of graphs. AssumingFPT 6= W[1], the following are equivalent:

Binary CSP(G) is polynomial-time solvable.Binary CSP(G) is FPT.G has bounded treewidth.

Note: FPT 6= W[1] is a standard complexity assumption.

Note: Fixed-parameter tractability does not give us more powerhere than polynomial-time solvability.

61

Dichotomy for binary CSPBinary CSP: Every constraint is of arity 2.We know that binary CSP(G) is polynomial-time solvable for everyclass G of graphs with bounded treewidth. Are there otherpolynomial cases?

Theorem [Grohe-Schwentick-Segoufin 2001]

Let G be a recursively enumerable class of graphs. AssumingFPT 6= W[1], the following are equivalent:

Binary CSP(G) is polynomial-time solvable.Binary CSP(G) is FPT.G has bounded treewidth.

Note: FPT 6= W[1] is a standard complexity assumption.

Note: Fixed-parameter tractability does not give us more powerhere than polynomial-time solvability.

61

Dichotomy for binary CSPBinary CSP: Every constraint is of arity 2.We know that binary CSP(G) is polynomial-time solvable for everyclass G of graphs with bounded treewidth. Are there otherpolynomial cases?

Theorem [Grohe-Schwentick-Segoufin 2001]

Let G be a recursively enumerable class of graphs. AssumingFPT 6= W[1], the following are equivalent:

Binary CSP(G) is polynomial-time solvable.Binary CSP(G) is FPT.G has bounded treewidth.

Note: FPT 6= W[1] is a standard complexity assumption.

Note: Fixed-parameter tractability does not give us more powerhere than polynomial-time solvability.

61

Proof outlineSuppose that G has unbounded treewidth, but CSP(G) is FPT.

Assuming FPT 6= W[1], there is no f (k)nc time algorithm fork-CLIQUE. But we can solve k-CLIQUE the following way:Formulate k-CLIQUE as a binary CSP instance on the k × kgrid.Find a Gk ∈ G containing a k × k minor (there is such a Gk bythe Excluded Grid Theorem).Reduce CSP on the k × k grid to CSP with graph Gk , which isan instance of CSP(G).Use the assumed algorithm for CSP(G).The running time is f (k)nc : the nonpolynomial factors in therunning time depend only on k (finding Gk , size of Gk , solvingCSP(G))⇒ k-CLIQUE is FPT, contradicting the hypothesisFPT 6= W[1].

62

Treewidth — overview

AlgorithmsDynamic programmingCourcelle’s Theorem

PropertiesCharacterization by the Cops and Robber game.Excluding a grid, excluding a tree.k-outerplanar graphs.

ApplicationsShifting technique for PTAS and FPT.Minor/contraction bidimensionalty.Excluded Grid Theorem in the classification of CSP(G).

63

TreewidthTree decomposition: Vertices are arranged in a tree structuresatisfying the following properties:

1 If u and v are neighbors, then there is a bag containing bothof them.

2 For every v , the bags containing v form a connected subtree.Width of the decomposition: largest bag size −1.

treewidth: width of the best decomposition.

dcb

a

e f g h

g , hb, e, fa, b, c

d , f , gb, c, f

c, d , f

64

Surfaces65

Surfaces

A topological surface is a nonempty second countableHausdorff topological space in which every point has anopen neighborhood homeomorphic to some open subsetof the Euclidean plane E 2.

Intuitively: something thin floating in space.

Our viewpoint: which graphs can be drawn on the differentsurfaces, thus we do not distinguish surfaces that arehomeomorphic.

66

Planar graphs

The following are equivalent:Graph G can be drawn on the plane.Graph G can be drawn inside a disc.Graph G can be drawn on the sphere.

67

Euler’s FormulaTheoremIf G is a connected simple graph drawn in the plane with v vertices,e edges, and f faces, then

v + f = e + 2.

Example:

v = 8f = 6e = 12

Consequence: e ≤ 3v − 6Proof: 2e ≥ 3f (every face has at least 3 edges)e = v + f − 2 ≤ v + 2

3e − 213e ≤ v − 2e ≤ 3v − 6

68

Euler’s FormulaTheoremIf G is a connected simple graph drawn in the plane with v vertices,e edges, and f faces, then

v + f = e + 2.

Example:

v = 8f = 6e = 12

Consequence: e ≤ 3v − 6Proof: 2e ≥ 3f (every face has at least 3 edges)e = v + f − 2 ≤ v + 2

3e − 213e ≤ v − 2e ≤ 3v − 6

68

Examples of surfaces: disk

Rectangle with boundary: same as disk.

69

Examples of surfaces: cylinder

Gluing together the vertical sides creates a cylinder.

70

Examples of surfaces: torus

Gluing together both the two horizontal and the two vertical sidescreates a torus.

K5 can be drawn on the torus.

Exercise: draw K7 on the torus.

71

Examples of surfaces: torus

Gluing together both the two horizontal and the two vertical sidescreates a torus.

K5 can be drawn on the torus.

Exercise: draw K7 on the torus.

71

Examples of surfaces: sphere

Gluing together top with left and bottom with right creates asphere.

72

Examples of surfaces: Möbius strip

Gluing together the vertical sides in twisted way creates a Möbiusstrip.

73

Examples of surfaces: real projective plane

Gluing together both the horizontal and vertical sides in a twistedway creates a real projective plane, which is a sphere with a crosscap.

74

Examples of surfaces: Klein bottle

Gluing together both the horizontal sides in a normal and thevertical sides in a twisted way creates a Klein bottle, which is asphere with two cross caps.

75

Examples of surfaces: Klein bottle

Gluing together both the horizontal sides in a normal and thevertical sides in a twisted way creates a Klein bottle, which is asphere with two cross caps.

75

Examples of surfaces: Klein bottle

Gluing together both the horizontal sides in a normal and thevertical sides in a twisted way creates a Klein bottle, which is asphere with two cross caps.

75

Orientable vs. nonorientableDefinitionA surface Σ is orientable if whenever a graph is drawn on Σ suchthat every face is a disk, then each face can be assigned anorientation such that two faces sharing an edge give the oppositeorientation to that edge.

The sphere and the torus are orientable.The Möbius strip and the Klein bottle are nonorientable.

76

Surfaces with boundariesSome surfaces have boundaries:

The cylinder and the Möbius strip have boundaries.The sphere, torus, Klein bottle are closed surfaces.

Every surface with boundaries can be obtained from a closedsurface by removing some number of disks.

As removing disks does not change which graphs can be embedded,we consider only closed surfaces from now.

77

Surfaces with boundariesSome surfaces have boundaries:

The cylinder and the Möbius strip have boundaries.The sphere, torus, Klein bottle are closed surfaces.

Every surface with boundaries can be obtained from a closedsurface by removing some number of disks.

As removing disks does not change which graphs can be embedded,we consider only closed surfaces from now.

77

Classification of closed surfaces

Theorem [Brahana 1921]

Every closed surface is equivalent either toa sphere with k ≥ 0 handles (orientable surfaces), oror to a sphere with k ≥ 1 crosscaps (nonorientable surfaces).

Alternative version:

Theorem [Brahana 1921]

Every closed surface is equivalent to a sphere with k ≥ 0 handlesand 0, 1, or 2 crosscaps attached to it.

78

Classification of closed surfaces

Theorem [Brahana 1921]

Every closed surface is equivalent either toa sphere with k ≥ 0 handles (orientable surfaces), oror to a sphere with k ≥ 1 crosscaps (nonorientable surfaces).

Alternative version:

Theorem [Brahana 1921]

Every closed surface is equivalent to a sphere with k ≥ 0 handlesand 0, 1, or 2 crosscaps attached to it.

78

5 handles, 2 crosscaps

79

Euler’s formula

TheoremLet G be a connected simple graph drawn on a closed surface Σsuch that every face is a disk. If G has v vertices, e edges, and ffaces, then

v + f = e + 2− eg(Σ),

where the Euler genus eg(Σ) is2k if Σ is a sphere with k handles, andk if Σ is a sphere with k crosscaps.

Consequence: e ≤ 3v − 6 + 3eg(Σ)

Bounded-genus graphs have bounded average degree.

80

Algorithms for bounded-genus graphs

Can we generalize the powerful techniques from planar graphs tosurfaces?

Shifting strategy for approximation schemes/parameterizedalgorithms

Crucial tool: bounding the treewidth of k-outerplanar graphs.

Subexponential algorithms for minor/contraction-bidimensionalproblems.

Crucial tool: grid theorems.

81

Grid theorems

TheoremEvery planar graph with treewidth at least 5k has a k × k gridminor.

Theorem [Demaine, Fomin, Hajiaghayi, Thilikos 2005]

If G is a graph drawn on Σ and has treewidth at leastc(eg(Σ) + 1) · k , then G has a k × k grid minor.

Subexponential parameterized algorithms for e.g., k-VertexCover go through:

either the graph has a Ω(√k)× Ω(

√k) grid minor and then

the vertex cover size is at least k , ortreewidth is O(

√k(eg(Σ) + 1)) and we can solve the problem

in time 2O(√

k(eg(Σ)+1)) · nO(1).Similar (more complicated) generalizations forcontraction-bidimensional problems.

82

Grid theorems

TheoremEvery planar graph with treewidth at least 5k has a k × k gridminor.

Theorem [Demaine, Fomin, Hajiaghayi, Thilikos 2005]

If G is a graph drawn on Σ and has treewidth at leastc(eg(Σ) + 1) · k , then G has a k × k grid minor.

Subexponential parameterized algorithms for e.g., k-VertexCover go through:

either the graph has a Ω(√k)× Ω(

√k) grid minor and then

the vertex cover size is at least k , ortreewidth is O(

√k(eg(Σ) + 1)) and we can solve the problem

in time 2O(√

k(eg(Σ)+1)) · nO(1).

Similar (more complicated) generalizations forcontraction-bidimensional problems.

82

Grid theorems

TheoremEvery planar graph with treewidth at least 5k has a k × k gridminor.

Theorem [Demaine, Fomin, Hajiaghayi, Thilikos 2005]

If G is a graph drawn on Σ and has treewidth at leastc(eg(Σ) + 1) · k , then G has a k × k grid minor.

Subexponential parameterized algorithms for e.g., k-VertexCover go through:

either the graph has a Ω(√k)× Ω(

√k) grid minor and then

the vertex cover size is at least k , ortreewidth is O(

√k(eg(Σ) + 1)) and we can solve the problem

in time 2O(√

k(eg(Σ)+1)) · nO(1).Similar (more complicated) generalizations forcontraction-bidimensional problems.

82

Local treewidth

The shifting technique relied on the fact that the treewidth ofk-outerplanar graphs have bounded treewidth.

DefinitionA class G of graphs has bounded local treewidth if there is afunction f such that tw(G ) ≤ f (diam(G )) for every G ∈ G.

Bounded genus implies bounded local treewidth:

TheoremThe class GΣ of graphs embeddable into Σ has bounded localtreewidth with tw(G ) ≤ 3eg(Σ)diam(G ).

83

Local treewidthBv [d ] : the ball containing vertices at distance ≤ d from v .Rv [x , y ] the ring containing vertices at distance x ≤ d ≤ y from v .

LemmaLet G be a minor-closed class of graphs having bounded localtreewidth. Then the treewidth of Rv [x , y ] can be bounded by afunction of y − x + 1.

Proof:

Contract Bv [x − 1].Ring Rv [x , y ] appears now at distancey − x + 1 from v .The ring appears in a graph oftreewidth f (y − x + 1).

84

Local treewidthBv [d ] : the ball containing vertices at distance ≤ d from v .Rv [x , y ] the ring containing vertices at distance x ≤ d ≤ y from v .

LemmaLet G be a minor-closed class of graphs having bounded localtreewidth. Then the treewidth of Rv [x , y ] can be bounded by afunction of y − x + 1.

Proof:

Contract Bv [x − 1].Ring Rv [x , y ] appears now at distancey − x + 1 from v .The ring appears in a graph oftreewidth f (y − x + 1).

v

Rv [x , y ]

84

Local treewidthBv [d ] : the ball containing vertices at distance ≤ d from v .Rv [x , y ] the ring containing vertices at distance x ≤ d ≤ y from v .

LemmaLet G be a minor-closed class of graphs having bounded localtreewidth. Then the treewidth of Rv [x , y ] can be bounded by afunction of y − x + 1.

Proof:

Contract Bv [x − 1].Ring Rv [x , y ] appears now at distancey − x + 1 from v .The ring appears in a graph oftreewidth f (y − x + 1).

v

Rv [x , y ]

84

PTAS using bounded local treewidth

TheoremIf G is minor-closed and has bounded local treewidth, thenIndependent Set has a PTAS on G.

Repeat the following for i = 0, . . . ,D, where D = d1/εe.Pick a vertex v and remove every vertex at distance jD + i forj = 0, 1, . . . .The graph falls apart into disjoint rings Rv [0, i − 1],Rv [i + 1,D + i − 1], Rv [D + i + 1, 2D + i − 1], . . . .Thus treewidth is f (D), i.e., can be bounded as function of ε.Problem can be solved in time f (1/ε) · n.At least one choice of i removes at most an ε fraction of theoptimum solution.

85

Bounded degree

A potential source of confusion3-regular graphs have bounded local treewidth: if diameter isd , then there are at most

∑di=0 3

i = (3d+1 − 1)/2 vertices,hence treewidth is bounded by a function of d .Independent Set is APX-hard on 3-regular graphs, thus ithas no PTAS unless P = NP.

Have we just proved P = NP?

TheoremIf G is a minor-closed and has bounded local treewidth, thenIndependent Set has a PTAS on G.

Local treewidth is useful only for minor-closed classes!

86

Bounded degree

A potential source of confusion3-regular graphs have bounded local treewidth: if diameter isd , then there are at most

∑di=0 3

i = (3d+1 − 1)/2 vertices,hence treewidth is bounded by a function of d .Independent Set is APX-hard on 3-regular graphs, thus ithas no PTAS unless P = NP.

Have we just proved P = NP?

TheoremIf G is a minor-closed and has bounded local treewidth, thenIndependent Set has a PTAS on G.

Local treewidth is useful only for minor-closed classes!

86

Local treewidth

Theorem [Frick and Grohe 2001]

If a graph property can be expressed in first-order logic and G is aclass of graphs with bounded local treewidth, then there is alinear-time algorithm for testing this property on members of G.

Note: we do not need here that G is closed under taking minors.

Shows, e.g., that Subgraph Isomorphism is FPT on planargraphs or on bounded-degree graphs.

Exercise: Can this result be generalized to EMSO instead offirst-order logic?

87

Excluding minors

88

Minors

DefinitionGraph H is a minor G (H ≤ G ) if H can be obtained from G bydeleting edges, deleting vertices, and contracting edges.

deleting uv

vu w

u vcontracting uv

89

Minors

Equivalent definitionGraph H is a minor of G if there is a mapping φ (the minor model)that maps each vertex of H to a connected subset of G such that

φ(u) and φ(v) are disjoint if u 6= v , andif uv ∈ E (G ), then there is an edge between φ(u) and φ(v).

76

54321

12 3 4 5

6

7

90

Minors

Equivalent definitionGraph H is a minor of G if there is a mapping φ (the minor model)that maps each vertex of H to a connected subset of G such that

φ(u) and φ(v) are disjoint if u 6= v , andif uv ∈ E (G ), then there is an edge between φ(u) and φ(v).

3 4 5

6 7

1 2

46

77

32

57

5

541

7

6 6

90

Excluding minors

Connection to surfaces:Graphs excluding K5- and K3,3-minors are planar.Graphs that can be drawn on a fixed surface (e.g., torus) canbe characterized by a finite list of excluded minors.

Is it true for every H that H-minor free graphs can be drawn on afixed surface?

NO (clique sums), NO (apices), NO (vortices)

YES (in a sense — Robertson-Seymour Structure Theorem)

91

Excluding minors

Connection to surfaces:Graphs excluding K5- and K3,3-minors are planar.Graphs that can be drawn on a fixed surface (e.g., torus) canbe characterized by a finite list of excluded minors.

Is it true for every H that H-minor free graphs can be drawn on afixed surface?

NO (clique sums), NO (apices), NO (vortices)

YES (in a sense — Robertson-Seymour Structure Theorem)

91

Excluding minors

Connection to surfaces:Graphs excluding K5- and K3,3-minors are planar.Graphs that can be drawn on a fixed surface (e.g., torus) canbe characterized by a finite list of excluded minors.

Is it true for every H that H-minor free graphs can be drawn on afixed surface?

NO (clique sums), NO (apices), NO (vortices)

YES (in a sense — Robertson-Seymour Structure Theorem)

91

Excluding minors

The following graph does not have a K6-minor, but its genus canbe large:

Connecting bounded-genus graphs can increase genus withoutcreating a clique minor.

92

Clique sums

DefinitionLet G1 and G2 be two graphs with two cliques K1 ⊆ V (G1) andK2 ⊆ V (G2) of the same size. Graph G is a clique sum of G1 andG2 if it can be obtained by identifying K1 and K2, and thenremoving some of the edges of the clique.

G1 G2

93

Clique sums

DefinitionLet G1 and G2 be two graphs with two cliques K1 ⊆ V (G1) andK2 ⊆ V (G2) of the same size. Graph G is a clique sum of G1 andG2 if it can be obtained by identifying K1 and K2, and thenremoving some of the edges of the clique.

G1 G2

93

Clique sums

DefinitionLet G1 and G2 be two graphs with two cliques K1 ⊆ V (G1) andK2 ⊆ V (G2) of the same size. Graph G is a clique sum of G1 andG2 if it can be obtained by identifying K1 and K2, and thenremoving some of the edges of the clique.

G1 G2

93

Clique sums

ObservationIf Kk 6≤ G1,G2 and G is a clique sum of G1 and G2, then Kk 6≤ G .

Thus we can build Kk -minor-free graphs by repeated clique sums.

Proof:For either i = 1 or i = 2, every set in the model of Kk in Gintersects V (Gi ). Restricting to V (Gi ) gives a model of Kk in Gi(using that the separator is a clique).

94

Clique sums

ObservationIf Kk 6≤ G1,G2 and G is a clique sum of G1 and G2, then Kk 6≤ G .

Thus we can build Kk -minor-free graphs by repeated clique sums.

Proof:For either i = 1 or i = 2, every set in the model of Kk in Gintersects V (Gi ). Restricting to V (Gi ) gives a model of Kk in Gi(using that the separator is a clique).

G1 G2

94

Clique sums

ObservationIf Kk 6≤ G1,G2 and G is a clique sum of G1 and G2, then Kk 6≤ G .

Thus we can build Kk -minor-free graphs by repeated clique sums.

Proof:For either i = 1 or i = 2, every set in the model of Kk in Gintersects V (Gi ). Restricting to V (Gi ) gives a model of Kk in Gi(using that the separator is a clique).

G1

94

Excluding K5

Theorem [Wagner 1937]

A graph is K5-minor-free if and only if it can be built from planargraphs and V8 by repeated clique sums.

V8 V8

95

Tree decomposition

Tree decomposition: Vertices are arranged in a tree structuresatisfying the following properties:

1 If u and v are neighbors, then there is a bag containing bothof them.

2 For every v , the bags containing v form a connected subtree.

dcb

a

e f g h

g , hb, e, fa, b, c

d , f , gb, c, f

c, d , f

96

Torso

Torso of a bag: we make the intersections with the adjacent bagscliques.

97

Torso

Torso of a bag: we make the intersections with the adjacent bagscliques.

97

Torso

Torso of a bag: we make the intersections with the adjacent bagscliques.

97

Torso

Torso of a bag: we make the intersections with the adjacent bagscliques.

97

Torso

Torso of a bag: we make the intersections with the adjacent bagscliques.

97

Torso

Torso of a bag: we make the intersections with the adjacent bagscliques.

97

Torso

Torso of a bag: we make the intersections with the adjacent bagscliques.

97

Excluding K5 — restated

Theorem [Wagner 1937]

A graph is K5-minor-free if and only if it can be built from planargraphs and V8 by repeated clique sums.

Equivalently:

Theorem [Wagner 1937]

A graph is K5-minor-free if and only if it has a tree decompositionwhere every torso is either a planar graph or the graph V8.

V8 V8

98

Apex vertices

The graph formed from a grid by attaching a universal vertex isK6-minor-free, but has large genus.

A planar graph + k extra vertices has no Kk+5-minor.Instead of bounded genus graphs, our building blocks shouldbe “bounded genus graphs + a bounded number of apexvertices connected arbitrarily.”

99

VorticesOne can show that the following graph has large genus, but cannothave a K8-minor.

Removing a few apex vertices or decomposing by clique sums donot help.

100

VorticesA vortex of width k and perimeter v1, . . . , vn is a graph Fthat has a width-k path decomposition B1, . . . , Bn such thatvi ∈ Bi .Let G be embedded in Σ and let D be a disk intersecting Gonly in vertices v1, . . . , vn. Attaching a vortex on D meanstaking the union of G and a vortex on v1, . . . , vn (the vortexintersects G only in these vertices).

v1

v2

v3

v4

v5

v6

v7

101

VorticesA vortex of width k and perimeter v1, . . . , vn is a graph Fthat has a width-k path decomposition B1, . . . , Bn such thatvi ∈ Bi .Let G be embedded in Σ and let D be a disk intersecting Gonly in vertices v1, . . . , vn. Attaching a vortex on D meanstaking the union of G and a vortex on v1, . . . , vn (the vortexintersects G only in these vertices).

v1v2

v3

v4

v5 v6

101

VorticesA vortex of width k and perimeter v1, . . . , vn is a graph Fthat has a width-k path decomposition B1, . . . , Bn such thatvi ∈ Bi .Let G be embedded in Σ and let D be a disk intersecting Gonly in vertices v1, . . . , vn. Attaching a vortex on D meanstaking the union of G and a vortex on v1, . . . , vn (the vortexintersects G only in these vertices).

v1v2

v3

v4

v5 v6

D

101

VorticesA vortex of width k and perimeter v1, . . . , vn is a graph Fthat has a width-k path decomposition B1, . . . , Bn such thatvi ∈ Bi .Let G be embedded in Σ and let D be a disk intersecting Gonly in vertices v1, . . . , vn. Attaching a vortex on D meanstaking the union of G and a vortex on v1, . . . , vn (the vortexintersects G only in these vertices).

v1v2

v3

v4

v5 v6

101

k-almost embeddable

DefinitionGraph G is k-almost embeddable in surface Σ if

there is a set X of at most k apex vertices anda graph G0 embedded in Σ, such thatG \ X can be obtained from G0 by attaching vortices of widthk on disjoint disks D1, . . . , Dk .

102

Graph Structure Theorem

Theorem [Robertson-Seymour]

For every graph H, there is an integer k and a surface Σ such thatevery H-minor-free graph has a tree decomposition where everytorso is k-almost embeddable in Σ.

Originally stated only combinatorially, algorithmic versions areknown.

Running time was improved from nf (H) to f (H) · nO(1).Algorithm finds also an apex set of size at most k for eachtorso.

103

Planar

Bounded Genus

H-Minor-Free

[figure by Felix Reidl]

104

Excluding cliques

What do we get by excluding small cliques?K3-minor free: every torso is size ≤ 2 (trees).K4-minor free: every torso is size ≤ 3 (series-parallel graphs).K5-minor free: every torso is planar or V8.Kk -minor free for k ≥ 6: every torso is k-almost embeddablein some surface Σk .

105

Algorithmic applications

Theorem [Demaine, Hajiaghayi, Kawarabayashi 2005]

For every graph H, there is a constant cH such that for any k ≥ 1,every H-minor-free graph G can be partitioned into k + 1 vertexsets V1, . . . , Vk+1 such that G \ Vi has treewidth at most cH · kfor any i . Furthermore, such a partition can be found in polynomialtime.

PTAS is immediate for e.g., Independent Set:Set k := d1/εe and find the partition.For every i = 1, . . . , k + 1, compute the solution optimally forG \ Vi .There is one i for which the solution is k/(k + 1) ≥ 1− εtimes the optimum.

106

Algorithmic applications

Theorem [Demaine, Hajiaghayi, Kawarabayashi 2005]

For every graph H, there is a constant cH such that for any k ≥ 1,every H-minor-free graph G can be partitioned into k + 1 vertexsets V1, . . . , Vk+1 such that G \ Vi has treewidth at most cH · kfor any i . Furthermore, such a partition can be found in polynomialtime.

PTAS is immediate for e.g., Independent Set:Set k := d1/εe and find the partition.For every i = 1, . . . , k + 1, compute the solution optimally forG \ Vi .There is one i for which the solution is k/(k + 1) ≥ 1− εtimes the optimum.

106

Finding minors107

Finding minors

H-minor testing

Input: graph GFind: a model of H in G .

TheoremH-minor testing for planar H can be solved in time f (H) · nO(1).

Proof:

If G has treewidth ≥ g(H), then it contains a large grid minor,hence contains H.If G has treewidth < g(H), then e.g., Courcelle’s Theorem canbe invoked to check if G contains an H-minor.

108

Finding minors

H-minor testing

Input: graph GFind: a model of H in G .

TheoremH-minor testing for planar H can be solved in time f (H) · nO(1).

Proof:

If G has treewidth ≥ g(H), then it contains a large grid minor,hence contains H.If G has treewidth < g(H), then e.g., Courcelle’s Theorem canbe invoked to check if G contains an H-minor.

108

Finding rooted minors

Theorem [Robertson and Seymour]

H-minor testing can be solved in time f (H) · n3.

Robertson and Seymour actually solved a more general problem:

Rooted H-minor testing

Input: graph G , a vertex ρ(v) ∈ V (G ) for every v ∈ V (H).Find: a model of H in G where the image of v contains ρ(v).

A very useful special case (let H be a matching with k edges):

k-Disjoint Paths

Input: graph G with vertices (s1, t1), . . . , (sk , tk).Find: vertex-disjoint paths P1, . . . , Pk

where Pi connects si and ti .

109

Algorithm for minor testing

A vertex v ∈ V (G ) is irrelevant if its removal does not change theanswer to H ≤ G .

Ingredients of minor testing by [Robertson and Seymour]

1 Solve the problem on bounded-treewidth graphs.2 If treewidth is large, either find an irrelevant vertex or the

model of a large clique minor.3 If we have a large clique minor, then either we are done (if the

clique minor is “close” to the roots), or a vertex of the cliqueminor is irrelevant.

By iteratively removing irrelevant vertices, eventually we arrive to agraph of bounded treewidth.

110

Planar k-Disjoint Paths

k-Disjoint Paths

Input: graph G with vertices (s1, t1), . . . , (sk , tk).Find: vertex-disjoint paths P1, . . . , Pk

where Pi connects si and ti .

Theorem [Adler et al. 2011]

The k-Disjoint Paths problem on planar graphs can be solved intime 22O(k) · nO(1).

Main argument:either treewidth is 2O(k) and we can use standard algorithmictechniques of bounded treewidth graphs, ortreewidth is 2Ω(k) and we can find an irrelevant vertex whosedeletion does not change the problem.

111

Planar k-Disjoint Paths

k-Disjoint Paths

Input: graph G with vertices (s1, t1), . . . , (sk , tk).Find: vertex-disjoint paths P1, . . . , Pk

where Pi connects si and ti .

Theorem [Adler et al. 2011]

The k-Disjoint Paths problem on planar graphs can be solved intime 22O(k) · nO(1).

Main argument:either treewidth is 2O(k) and we can use standard algorithmictechniques of bounded treewidth graphs, ortreewidth is 2Ω(k) and we can find an irrelevant vertex whosedeletion does not change the problem.

111

Planar k-Disjoint Paths

TheoremEvery planar graph with treewidth at least 5k has a k × k gridminor.

112

Planar k-Disjoint Paths

TheoremIf treewidth of a planar graph is Ω(k), then it contains thesubdivision of a k × k wall.

Lemma [Adler et al. 2011]

If a 2O(k) × 2O(k) wall of a planar graph does not enclose anyterminals, then the middle vertex of the wall is irrelevant to thek-disjoint paths problem.

112

Planar k-Disjoint Paths

TheoremIf treewidth of a planar graph is Ω(k), then it contains thesubdivision of a k × k wall.

Lemma [Adler et al. 2011]

If a 2O(k) × 2O(k) wall of a planar graph does not enclose anyterminals, then the middle vertex of the wall is irrelevant to thek-disjoint paths problem.

112

Planar k-Disjoint Paths

TheoremIf treewidth of a planar graph is Ω(k), then it contains thesubdivision of a k × k wall.

Lemma [Adler et al. 2011]

If a 2O(k) × 2O(k) wall of a planar graph does not enclose anyterminals, then the middle vertex of the wall is irrelevant to thek-disjoint paths problem.

112

Irrelevant vertices

Lemma [Adler et al. 2011]

If there are 2O(k) concentric cycles in a planar graph not enclosingany terminals, then the innermost cycle is irrelevant to thek-disjoint paths problem.

Any solution can be rerouted to avoid the innermost cycle.

113

Well-quasi-ordering

114

Well-quasi-orderingDefinitionA partial order is a well-quasi-ordering if

1 There is no infinite antichain.2 There is no infinite descending chain.

115

Well-quasi-orderingDefinitionA partial order is a well-quasi-ordering if

1 There is no infinite antichain.2 There is no infinite descending chain.

115

Well-quasi-orderingDefinitionA partial order is a well-quasi-ordering if

1 There is no infinite antichain.2 There is no infinite descending chain.

115

Well-quasi-ordering

DefinitionA partial order is a well-quasi-ordering if

1 There is no infinite antichain.2 There is no infinite descending chain.

Example: the subgraph relation ⊆ is not a well-quasi-ordering:

115

Well-quasi-orderingGraph Minors TheoremThe minor relation ≤ is a well-quasi-ordering on finite graphs.

Some equivalent reformulations:

Corollary

If G is minor closed, then G has a finite number of minimalelements.

CorollaryIf G is minor closed, then G has a finite obstruction setF = H1, . . . ,Hk, i.e.,

G ∈ G ⇐⇒ ∀H ∈ F ,H 6≤ G

116

Well-quasi-ordering

Corollary

If G is minor closed, then G has a finite number of minimalelements.

G

G

117

Well-quasi-ordering

Corollary

If G is minor closed, then G has a finite number of minimalelements.

G

G

117

Nonconstructive algorithmsCorollaryIf G is minor closed, then G has a finite obstruction setF = H1, . . . ,Hk, i.e.,

G ∈ G ⇐⇒ ∀H ∈ F ,H 6≤ G

As we have a O(n3) minor test algorithm for every Hi ∈ H:

TheoremIf G is minor closed, then there is a O(n3) time algorithm forrecognizing graphs in G.

Examples:graphs that can be drawn on a torus (double torus etc.) forma minor-closed class: there is a O(n3) algorithm.graphs that have a linkless embedding in 3-space form a minorclosed class: there is a O(n3) algorithm. 118

Applications

Planar Face Cover: Given a graph G and an integer k , findan embedding of planar graph G such that there are k faces thatcover all the vertices.

For every fixed k , the class Gk of graphs of yes-instances is minorclosed.

⇓For every fixed k , there is a O(n3) time algorithm for Planar FaceCover.

119

Applications

Planar Face Cover: Given a graph G and an integer k , findan embedding of planar graph G such that there are k faces thatcover all the vertices.

For every fixed k , the class Gk of graphs of yes-instances is minorclosed.

⇓For every fixed k , there is a O(n3) time algorithm for Planar FaceCover.

119

Applicationsk-Leaf Spanning Tree: Given a graph G and an integer k , finda spanning tree with at least k leaves.

Technical modification: Is there such a spanning tree for at leastone component of G?

For every fixed k , the class Gk of no-instances is minor closed.⇓

For every fixed k , k-Leaf Spanning Tree can be solved in timeO(n3).

120

Applicationsk-Leaf Spanning Tree: Given a graph G and an integer k , finda spanning tree with at least k leaves.

Technical modification: Is there such a spanning tree for at leastone component of G?

For every fixed k , the class Gk of no-instances is minor closed.⇓

For every fixed k , k-Leaf Spanning Tree can be solved in timeO(n3).

120

G + k vertices

DefinitionIf G is a graph property, then G + kv contains graph G if there is aset S ⊆ V (G ) of k vertices such that G \ S ∈ G.

S

121

G + k vertices

DefinitionIf G is a graph property, then G + kv contains graph G if there is aset S ⊆ V (G ) of k vertices such that G \ S ∈ G.

S

ObservationIf G is minor closed, then G + kv is minor closed for every fixed k .

⇒ It is (nonuniform) FPT to decide if G can be transformed into amember of G by deleting k vertices.

121

G + k vertices

ObservationIf G is minor closed, then G + kv is minor closed for every fixed k .

⇒ It is (nonuniform) FPT to decide if G can be transformed into amember of G by deleting k vertices.

If G = forests ⇒ G + kv = graphs that can be made acyclic bythe deletion of k vertices⇒ Feedback Vertex Set is FPT.If G = planar graphs ⇒ G + kv = graphs that can be madeplanar by the deletion of k vertices (k-apex graphs)⇒ k-Apex Graph is FPT.If G = empty graphs ⇒ G + kv = graphs with vertex covernumber at most k⇒ Vertex Cover is FPT.

121

Nonconstructive algorithms

The running time is beyond horrible.Quick tool for obtaining very general results.For many concrete problems, simpler and more efficientalgorithms were found.Nonuniform FPT: a separate algorithm for every fixed k ,rather than a single f (k) · nO(1) algorithm.

122

Other containment relations

123

Topological subgraphsDefinitionSubdivision of a graph: replacing each edge by a path of length 1or more.Graph H is a topological subgraph of G (or topological minorof G , or H ≤T G ) if a subdivision of H is a subgraph of G .

≤T

124

Topological subgraphsDefinitionSubdivision of a graph: replacing each edge by a path of length 1or more.Graph H is a topological subgraph of G (or topological minorof G , or H ≤T G ) if a subdivision of H is a subgraph of G .

≤T

124

Topological subgraphsDefinitionSubdivision of a graph: replacing each edge by a path of length 1or more.Graph H is a topological subgraph of G (or topological minorof G , or H ≤T G ) if a subdivision of H is a subgraph of G .

Equivalently, H ≤T G means that H can be obtained from G by re-moving vertices, removing edges, and dissolving degree two vertices.

a c

dissolving b

b

a c

124

A classical result

Theorem [Kuratowski 1930]

A graph G is planar if and only if K5 6≤T G and K3,3 6≤T G .

Theorem [Wagner 1937]

A graph G is planar if and only if K5 6≤ G and K3,3 6≤ G .

K5 K3,3

125

Minors vs. subdivisions

Simple factIf H has max. degree ≤ 3, then H ≤ G ⇐⇒ H ≤T G .

126

Minors vs. subdivisions

Simple factIf H has max. degree ≤ 3, then H ≤ G ⇐⇒ H ≤T G .

126

Minors vs. subdivisionsSimple factFor every H, there is a finite set H such that

H ≤ G ⇐⇒ ∃H ′ ∈ H : H ′ ≤T G .

H H

Every class that can be defined by excluding minors can bedefined by excluding topological subgraphs.But the converse is not true: excluding a K1,4 topologicalsubgraph means that max. degree is < 4.

127

Minors vs. subdivisionsSimple factFor every H, there is a finite set H such that

H ≤ G ⇐⇒ ∃H ′ ∈ H : H ′ ≤T G .

H H

Every class that can be defined by excluding minors can bedefined by excluding topological subgraphs.But the converse is not true: excluding a K1,4 topologicalsubgraph means that max. degree is < 4.

127

Minors vs. subdivisionsSimple factFor every H, there is a finite set H such that

H ≤ G ⇐⇒ ∃H ′ ∈ H : H ′ ≤T G .

H H

Every class that can be defined by excluding minors can bedefined by excluding topological subgraphs.But the converse is not true: excluding a K1,4 topologicalsubgraph means that max. degree is < 4.

127

Finding topological subgraphs

Deciding H ≤T G :Guess the image of each v ∈ V (H) in G .Solve the k-Disjoint Paths where k = |E (H)| and thepaths correspond to the edges of H in G .

Corollary

We can decide in nf (H) time if H ≤T G .

Theorem [Grohe, Kawarabayashi, M., Wollan 2011]

We can decide in f (H) · n3 time if H ≤T G .

128

Well-quasi-ordering (lack of)

The relation ≤T is not a well-quasi-ordering.

129

Torso

Torso of a bag: we make the intersections with the adjacent bagscliques.

130

Torso

Torso of a bag: we make the intersections with the adjacent bagscliques.

130

Structure theorems

Theorem [Grohe and M. 2012]

For every H, there is an integer k ≥ 1 such that everyH-subdivision free graph has a tree decomposition where the torsoof every bag is either

Kk -minor free orhas degree at most k with the exception of at most k vertices(“almost bounded degree”).

Note: there is an f (H) · nO(1) time algorithm for computing such adecomposition.

131

Structure theorems

Theorem [Grohe and M. 2012]

For every H, there is an integer k ≥ 1 such that everyH-subdivision free graph has a tree decomposition where the torsoof every bag is either

k-almost embeddable in a surface of genus at most k orhas degree at most k with the exception of at most k vertices(“almost bounded degree”).

Note: there is an f (H) · nO(1) time algorithm for computing such adecomposition.

131

Planar

Bounded Genus

H-Minor-Free

H-Topological- Minor-Free

[figure by Felix Reidl]132

Algorithmic applications

Theorem [Grohe and M. 2012]

For every H, there is an integer k ≥ 1 such that everyH-subdivision free graph has a tree decomposition where the torsoof every bag is either

k-almost embeddable in a surface of genus at most k orhas degree at most k with the exception of at most k vertices(“almost bounded degree”).

General message:If a problem can be solved both

on (almost-) embeddable graphs andon (almost-) bounded degree graphs,

then these results can be raised toH-subdivision free graphs

without too much extra effort.133

Partial Dominating Set

Partial Dominating SetInput: graph G , integer kFind: a set S of at most k vertices whose closed neighborhood hasmaximum size

TheoremPartial Dominating Set can be solved in time f (H, k) · nO(1)

on H-subdivision free graphs.

134

Partial Dominating Set

Sketch:Partial Dominating Set can be solved in linear-time onbounded-degree graphs (the closed neighborhood has boundedsize).Partial Dominating Set can be solved in linear-time onplanar graphs (standard layering/treewidth arguments).With some extra work, we can generalize this toalmost-bounded degree and almost-embeddable graphs.The structure theorem together with bottom-up dynamicprogramming gives an algorithm for H-subdivision free graphs.

135

Graph IsomorphismTheorem [Luks 1982] [Babai, Luks 1983]

For every fixed d , Graph Isomorphism can be solved inpolynomial time on graphs with maximum degree d .

Theorem [Ponomarenko 1988]

For every fixed H, Graph Isomorphism can be solved inpolynomial time on H-minor free graphs.

Theorem [Grohe and M. 2012]

For every fixed H, Graph Isomorphism can be solved inpolynomial-time on H-subdivision free graphs.

Note:Running time is nf (H), not FPT parameterized by H.Requires a more general “invariant acyclic tree-likedecomposition.”

136

Immersions

DefinitionGraph H has an immersion in G (H ≤im G ) if there is a mappingφ such that

For every v ∈ V (H), φ(v) is a distinct vertex in G .For every xy ∈ E (H), φ(xy) is a path between φ(x) and φ(y),and all these paths are edge disjoint.

≤im

Note: H ≤T G implies H ≤im G .

137

Immersion

Finding immersions:

Theorem [Grohe, Kawarabayashi, M., Wollan 2011]

We can decide in f (H) · n3 time if H ≤im G .

Well-quasi-ordering:

Robertson and SeymourThe immersion relation ≤im is a well-quasi-ordering on finite graphs.

What about a structure theorem?

138

Excluding immersionsAs excluding Kk -immersions implies excluding Kk topologicalsubgraphs, we get:

Theorem [Grohe and M. 2012]

For every H, there is an integer k ≥ 1 such that every H-immersionfree graph has a tree decomposition where the torso of every bag iseither

k-almost embeddable in a surface of genus at most k orhas degree at most k with the exception of at most k vertices(“almost bounded degree”).

However, embeddability does not seem to be relevant forimmersions: the following graph has large clique immersions.

Can we omit the first case?

139

Excluding immersionsAs excluding Kk -immersions implies excluding Kk topologicalsubgraphs, we get:

Theorem [Grohe and M. 2012]

For every H, there is an integer k ≥ 1 such that every H-immersionfree graph has a tree decomposition where the torso of every bag iseither

k-almost embeddable in a surface of genus at most k orhas degree at most k with the exception of at most k vertices(“almost bounded degree”).

However, embeddability does not seem to be relevant forimmersions: the following graph has large clique immersions.

Can we omit the first case?

139

Excluding immersionsAs excluding Kk -immersions implies excluding Kk topologicalsubgraphs, we get:

Theorem [Grohe and M. 2012]

For every H, there is an integer k ≥ 1 such that every H-immersionfree graph has a tree decomposition where the torso of every bag iseither

k-almost embeddable in a surface of genus at most k or????has degree at most k with the exception of at most k vertices(“almost bounded degree”).

However, embeddability does not seem to be relevant forimmersions: the following graph has large clique immersions.

Can we omit the first case?139

Excluding immersions

Theorem [Wollan]

If Kk has no immersion in G , then G has a “tree-cutdecomposition” of adhesion at most k2 such that each “torso” hasat most k vertices of degree at least k2.

Tree cut decomposition: a partition of the vertex set in tree-likeway.

≤ k2

140

Excluding immersions

Theorem [Wollan]

If Kk has no immersion in G , then G has a “tree-cutdecomposition” of adhesion at most k2 such that each “torso” hasat most k vertices of degree at least k2.

Tree cut decomposition: a partition of the vertex set in tree-likeway.

torso

140

Odd minorsDefinitionGraph H is an odd minor of G (H ≤odd G ) if G has a 2-coloringand there is a mapping φ that maps each vertex of H to a tree ofG such that

φ(u) and φ(v) are disjoint if u 6= v ,every edge of φ(u) is bichromatic,if uv ∈ E (H), then there is a monochromatic edge betweenφ(u) and φ(v).

Example: K3 is an odd minor of G if and only if G is not bipartite.141

Odd minorsFinding odd minors:

Theorem [Kawarabayashi, Reed, Wollan 2011]

There is an f (H) · nO(1) time algorithm for finding an odd H-minor.

Structure theorem:

Theorem [Demaine, Hajiaghayi, Kawarabayashi 2010]

For every H, there is an integer k ≥ 1 such that every odd H-minorfree graph has a tree decomposition where the torso of every bag is

k-almost embeddable in a surface of genus at most k orbipartite after deleting at most k vertices (“almost bipartite”)

Consequence:

Theorem [Demaine, Hajiaghayi, Kawarabayashi 2010]

For every fixed H, there is a polynomial-time 2-approximationalgorithm for chromatic number on odd H-minor free graphs.

142

Odd subdivisions

DefinitionOdd subdivision of a graph: replacing each edge by a path of oddlength (1 or more).

If G contains an odd H-subdivision, then H ≤T G and H ≤odd G .

143

Odd subdivisionsA structure theorem for excluding odd H-subdivision should bestronger than

the structure theorem for excluded subdivisions(k-almost embeddable, almost bounded degree) andthe structure theorem for excluded odd minors(k-almost embeddable, almost bipartite).

Theorem [Kawarabayashi 2013]

For every H, there is an integer k ≥ 1 such that every oddH-subdivision free graph has a tree decomposition where the torsoof every bag is either

k-almost embeddable in a surface of genus at most k ,has degree at most k with the exception of at most k vertices(“almost bounded degree”), orbipartite after deleting at most k vertices (“almost bipartite”).

144

Odd subdivisionsA structure theorem for excluding odd H-subdivision should bestronger than

the structure theorem for excluded subdivisions(k-almost embeddable, almost bounded degree) andthe structure theorem for excluded odd minors(k-almost embeddable, almost bipartite).

Theorem [Kawarabayashi 2013]

For every H, there is an integer k ≥ 1 such that every oddH-subdivision free graph has a tree decomposition where the torsoof every bag is either

k-almost embeddable in a surface of genus at most k ,has degree at most k with the exception of at most k vertices(“almost bounded degree”), orbipartite after deleting at most k vertices (“almost bipartite”).

144

What did we learn, Palmer?

Algorithms for bounded treewidth graphs: tedious, butelementary.(dynamic programming, Courcelle’s Theorem)Applications of bounded treewidth algorithms.(the shifting technique, bidimensionality, grid theorems)Generalization to bounded genus graphs.The structure theorem.Minor testing and well-quasi-ordering.

145