Presentation is loading. Please wait.

Presentation is loading. Please wait.

Graphs and Algorithms (2MMD30)

Similar presentations


Presentation on theme: "Graphs and Algorithms (2MMD30)"— Presentation transcript:

1 Graphs and Algorithms (2MMD30)
Lecture 7 (part 1) Introduction to Treewidth

2 Treewidth Today: Next time: A measure of how `treelike’ a graph is
On a high level, very useful for two reasons: very many NP-hard graph problems can be solved fast on graphs of small treewidth, many graphs of interest have small treewidth. Today: Defn of treewidth, how to use it, one application Next time: Applications to planar graphs, apx, fpt via minors; exercises.

3 Weighted Independent Set in Trees
Let 𝑇 be a rooted tree, 𝑇[𝑣] the subtree rooted at v∈𝑉. Define 𝐴 𝑣 as the max weight of an ind. set of 𝑇[𝑣], then v =max , 𝜔 𝑣 +

4 Weighted Independent Set in Trees
Let 𝑇 be a rooted tree, 𝑇[𝑣] the subtree rooted at v∈𝑉. Define 𝐴 𝑣 as the max weight of an ind. set of 𝑇[𝑣], then For each bag 𝑣 in 𝑇 and subsets 𝑋 of the vertices in it, store the optimal IS of 𝑇 𝑣 containing that set T 𝐴[𝑣, 𝑎,𝑑 ] v a b c d

5 Treewidth Refer to        as a bag. Definition A tree decomposition of graph 𝐺= 𝑉,𝐸 is a pair (𝑋,𝑇) where 𝑋={ 𝑋 1 ,…, 𝑋 𝑙 } with 𝑋 𝑖 ⊆𝑉 and 𝑇 a tree with vertex set 𝑋 such that 𝑖=1 𝑙 𝑋 𝑖 =𝑉 , 𝐸⊆ 𝑖=1 𝑙 𝑋 𝑖 × 𝑋 𝑖 , ∀𝑣∈𝑉: all 𝑋 𝑖 containing 𝑣 induce connected subtree if 𝑇.

6 Treewidth Refer to        as a bag. Definition A tree decomposition of graph 𝐺= 𝑉,𝐸 is a pair (𝑋,𝑇) where 𝑋={ 𝑋 1 ,…, 𝑋 𝑙 } with 𝑋 𝑖 ⊆𝑉 and 𝑇 a tree with vertex set 𝑋 such that 𝑖=1 𝑙 𝑋 𝑖 =𝑉 , 𝐸⊆ 𝑖=1 𝑙 𝑋 𝑖 × 𝑋 𝑖 , ∀𝑣∈𝑉: all 𝑋 𝑖 containing 𝑣 induce connected subtree if 𝑇.

7 Treewidth Definition a b c d f g h e
Refer to        as a bag. Definition A tree decomposition of graph 𝐺= 𝑉,𝐸 is a pair (𝑋,𝑇) where 𝑋={ 𝑋 1 ,…, 𝑋 𝑙 } with 𝑋 𝑖 ⊆𝑉 and 𝑇 a tree with vertex set 𝑋 such that 𝑖=1 𝑙 𝑋 𝑖 =𝑉 , 𝐸⊆ 𝑖=1 𝑙 𝑋 𝑖 × 𝑋 𝑖 , ∀𝑣∈𝑉: all 𝑋 𝑖 containing 𝑣 induce connected subtree if 𝑇. a b c d f g h e

8 Treewidth Definition d b a a b c d e f g h
Refer to        as a bag. Definition A tree decomposition of graph 𝐺= 𝑉,𝐸 is a pair (𝑋,𝑇) where 𝑋={ 𝑋 1 ,…, 𝑋 𝑙 } with 𝑋 𝑖 ⊆𝑉 and 𝑇 a tree with vertex set 𝑋 such that 𝑖=1 𝑙 𝑋 𝑖 =𝑉 , 𝐸⊆ 𝑖=1 𝑙 𝑋 𝑖 × 𝑋 𝑖 , ∀𝑣∈𝑉: all 𝑋 𝑖 containing 𝑣 induce connected subtree if 𝑇. d b a a b c d e f g h

9 Treewidth Definition d b a a b c d g b d e f g h
Refer to        as a bag. Definition A tree decomposition of graph 𝐺= 𝑉,𝐸 is a pair (𝑋,𝑇) where 𝑋={ 𝑋 1 ,…, 𝑋 𝑙 } with 𝑋 𝑖 ⊆𝑉 and 𝑇 a tree with vertex set 𝑋 such that 𝑖=1 𝑙 𝑋 𝑖 =𝑉 , 𝐸⊆ 𝑖=1 𝑙 𝑋 𝑖 × 𝑋 𝑖 , ∀𝑣∈𝑉: all 𝑋 𝑖 containing 𝑣 induce connected subtree if 𝑇. d b a a b c d g b d e f g h

10 Treewidth Definition d b a a b c d g b d e f g d f g h
Refer to        as a bag. Definition A tree decomposition of graph 𝐺= 𝑉,𝐸 is a pair (𝑋,𝑇) where 𝑋={ 𝑋 1 ,…, 𝑋 𝑙 } with 𝑋 𝑖 ⊆𝑉 and 𝑇 a tree with vertex set 𝑋 such that 𝑖=1 𝑙 𝑋 𝑖 =𝑉 , 𝐸⊆ 𝑖=1 𝑙 𝑋 𝑖 × 𝑋 𝑖 , ∀𝑣∈𝑉: all 𝑋 𝑖 containing 𝑣 induce connected subtree if 𝑇. d b a a b c d g b d e f g d f g h

11 Treewidth Definition d b a a b c d g b b e g d e f g d f g h
Refer to        as a bag. Definition A tree decomposition of graph 𝐺= 𝑉,𝐸 is a pair (𝑋,𝑇) where 𝑋={ 𝑋 1 ,…, 𝑋 𝑙 } with 𝑋 𝑖 ⊆𝑉 and 𝑇 a tree with vertex set 𝑋 such that 𝑖=1 𝑙 𝑋 𝑖 =𝑉 , 𝐸⊆ 𝑖=1 𝑙 𝑋 𝑖 × 𝑋 𝑖 , ∀𝑣∈𝑉: all 𝑋 𝑖 containing 𝑣 induce connected subtree if 𝑇. d b a a b c d g b b e g d e f g d f g h

12 Treewidth Definition c e b d b a a b c d g b b e g d e f g d f g h
Refer to        as a bag. Definition A tree decomposition of graph 𝐺= 𝑉,𝐸 is a pair (𝑋,𝑇) where 𝑋={ 𝑋 1 ,…, 𝑋 𝑙 } with 𝑋 𝑖 ⊆𝑉 and 𝑇 a tree with vertex set 𝑋 such that 𝑖=1 𝑙 𝑋 𝑖 =𝑉 , 𝐸⊆ 𝑖=1 𝑙 𝑋 𝑖 × 𝑋 𝑖 , ∀𝑣∈𝑉: all 𝑋 𝑖 containing 𝑣 induce connected subtree if 𝑇. c e b d b a a b c d g b b e g d e f g d f g h

13 Treewidth Definition c e b d b a a b c d g b b e g d e f g d g h e f g
Refer to        as a bag. Definition A tree decomposition of graph 𝐺= 𝑉,𝐸 is a pair (𝑋,𝑇) where 𝑋={ 𝑋 1 ,…, 𝑋 𝑙 } with 𝑋 𝑖 ⊆𝑉 and 𝑇 a tree with vertex set 𝑋 such that 𝑖=1 𝑙 𝑋 𝑖 =𝑉 , 𝐸⊆ 𝑖=1 𝑙 𝑋 𝑖 × 𝑋 𝑖 , ∀𝑣∈𝑉: all 𝑋 𝑖 containing 𝑣 induce connected subtree if 𝑇. Separates a, f and ceh. c e b d b a a b c d g b b e g d e f g d g h e f g h

14 Treewidth Definition Definition
Refer to        as a bag. Definition A tree decomposition of graph 𝐺= 𝑉,𝐸 is a pair (𝑋,𝑇) where 𝑋={ 𝑋 1 ,…, 𝑋 𝑙 } with 𝑋 𝑖 ⊆𝑉 and 𝑇 a tree with vertex set 𝑋 such that 𝑖=1 𝑙 𝑋 𝑖 =𝑉 , 𝐸⊆ 𝑖=1 𝑙 𝑋 𝑖 × 𝑋 𝑖 , ∀𝑣∈𝑉: all 𝑋 𝑖 containing 𝑣 induce connected subtree if 𝑇. Definition The width of a treedecomposition is                                . The treewidth of a graph is the minimum width among all possible tree decompositions of G.

15 Cops and Robber Interpretation
𝑤 cops try to capture a robber Everybody sees everybody In each turn, the cops can move from vertex to vertex arbitrarily with helicopters. The robber moves infinitely fast on the edges, and sees where the cops will land. 𝑤+1 cops can eventually win iff graph has treewidth ≤𝑤. Proof is not easy and we skip it has treewidth 2

16 Cops and Robber Interpretation
𝑤 cops try to capture a robber Everybody sees everybody In each turn, the cops can move from vertex to vertex arbitrarily with helicopters. The robber moves infinitely fast on the edges, and sees where the cops will land. 𝑤+1 cops can eventually win iff graph has treewidth ≤𝑤. Proof is not easy and we skip it l has treewidth l (exercise) r b a has treewidth 2 c b

17 Finding Good Tree Decompositions
Treewidth problem: Given 𝐺 and integer w, does 𝐺 have treewidth w? Treewidth param’d by w is NP-hard, but also FPT: Idea is to use iterative compression: A given tree decomposition of width w+1 can be used to determine the treewidth Full algorithm is technical and beyond the scope of the course There are algorithms that given graph of TW w, return TD of width w in 𝑤 𝑂(𝑤 3 ) 𝑛 time. return TD of width 4𝑤+1 in 𝑂( 3 3𝑤 𝑤 𝑛 2 ) time return TD of width O(𝑤 lg 𝑤 ) in polynomial time

18 Max weight IS with given TD in 𝑂 ∗ (2 𝑤 )
Use given TD to compute a nice TD of width k. For a bag 𝑖, let 𝐺 𝑖 =( 𝑉 𝑖 , 𝐸 𝑖 ) be the subgraph of 𝐺 formed by all vertices in sets 𝑋𝑗, with 𝑗=𝑖 or j a descendant of i in the tree. 𝐴[𝑖,𝑌] = maximum weight of an independent set W of 𝐺 𝑖 with 𝑊∩ 𝑋 𝑖 =𝑌 (which is −∞ if such 𝑊 does not exist) 𝐴[6,{ℎ}]=1, 𝐴 4, 𝑒,𝑔 =−∞,𝐴 1, 𝑏 =3, 𝐴 3,{𝑔} =2 1=root 5 a b c e b c d b a 3 4 d g b b d e e g f g d g h e f g h 2 6

19 Nice tree decompositions
𝑇,𝑋 where 𝑇 is a rooted tree, and four types of bags i: Leaf: leaf of tree with | 𝑋 𝑖 | = 1 Join: bag with two children 𝑗,𝑗′ with 𝑋 𝑖 = 𝑋 𝑗 = 𝑋 𝑗′ ’ Introduce: bag with one child j with 𝑋 𝑖 = 𝑋 𝑗 ∪𝑣 for some vertex 𝑣 Forget: bag with one child j with 𝑋 𝑖 = 𝑋 𝑗 ∖𝑣 for some vertex v Given any TD, we can compute a nice TD of same width in polynomial time.

20 Nice tree decompositions
g b a c e h f g d b a c e h f root Leaf Join Introduce Forget

21 𝐺 𝑖 is a graph with one vertex
Leaf bags Let i be a leaf bag. Say 𝑋 𝑖 ={𝑣} 𝐴 𝑖, 𝑣 =𝜔 𝑣 𝐴 𝑖,∅ =0 v 𝐺 𝑖 is a graph with one vertex

22 𝜔( ) Join bags - = + Let i be a join bag with children 𝑗1, 𝑗2.
𝐴 𝑖,𝑌 =𝐴 𝑗 1 ,𝑌 +𝐴 𝑗 2 ,𝑌 − 𝑣∈𝑌 𝜔(𝑣) + - 𝜔( ) =

23 Introduce bags = = + 𝜔(𝑣) = −∞
Let i be an introduce bag with child 𝑗, 𝑋 𝑖 = 𝑋 𝑗 ∪{𝑣} 𝐴 𝑖,𝑆 =𝐴[𝑗,𝑆] for 𝑣∉𝑆 𝐴 𝑖,𝑆∪{𝑣} =𝐴 𝑗,𝑆 +𝜔(𝑣), if 𝑁(𝑣)∩𝑆=∅ 𝐴 𝑖,𝑆∪{𝑣} =−∞ if 𝑁(𝑣)∩𝑆≠∅ v = v = + 𝜔(𝑣) v = −∞

24 Forget bags = 𝑚𝑎𝑥 , Let i be a forget bag with child 𝑗, 𝑋 𝑖 = 𝑋 𝑗 ∖{𝑣}
𝐴 𝑖,𝑆 = max { 𝐴 𝑗,𝑆 ,𝐴 𝑗,𝑆∪𝑣 } = 𝑚𝑎𝑥 ,

25 Maximum weighted independent set on graphs with treewidth k
Compute all table entries in bottom up fashion (starting at the leaves of T) in the usual way. Gives 2 𝑤 𝑤 𝑂(1) 𝑛= 𝑂 ∗ 2 𝑤 -time algorithm for max weight ind. set if TD of width w is given. FPT algorithms for very many, NP-hard graph problems when parameterized by treewidth.

26 Graphs and Algorithms (2MMD30)
Lecture 7 (part 2) Introduction to Treewidth

27 Weighted Dominating Set in Trees
Dominating set: 𝑋⊆𝑉 such that each vertex is in 𝑋 or is a neighbor of some vertex in X. Can also be solved in 𝑂(𝑛) time on trees, and 3 𝑤 𝑤 𝑂(1) 𝑛 time if a tree decomposition of width w is given ( 9 𝑤 𝑤 𝑂 1 𝑛 in ex). Has a dominating set of size 2

28 Weighted Dominating Set in Trees
Dominating set: 𝑋⊆𝑉 such that each vertex is in 𝑋 or is a neighbor of some vertex in 𝑥. Define 𝐴 𝐷 𝑣 as min weight DS of 𝑇 𝑣 ∖𝑣 Define 𝐴 𝐼 𝑣 as min weight DS of 𝑇[𝑣] including 𝑣 Define 𝐴 𝐸 𝑣 as min weight DS of 𝑇[𝑣] excluding 𝑣 If 𝑣 is leaf, 𝐴 𝐸 𝑣 =∞, 𝐴 𝐷 [𝑣]=0, 𝐴 𝐼 𝑣 =𝜔(𝑣), otherwise: 𝐴 𝐷 𝑣 = 𝑐∈𝑐ℎ(𝑣) min { 𝐴 𝐼 𝑐 , 𝐴 𝐸 [𝑐]} v

29 Weighted Dominating Set in Trees
Dominating set: 𝑋⊆𝑉 such that each vertex is in 𝑋 or is a neighbor of some vertex in 𝑥. Define 𝐴 𝐷 𝑣 as min weight DS of 𝑇 𝑣 ∖𝑣 Define 𝐴 𝐼 𝑣 as min weight DS of 𝑇[𝑣] including 𝑣 Define 𝐴 𝐸 𝑣 as min weight DS of 𝑇[𝑣] excluding 𝑣 If 𝑣 is leaf, 𝐴 𝐸 𝑣 =∞, 𝐴 𝐷 [𝑣]=0, 𝐴 𝐼 𝑣 =𝜔(𝑣), otherwise: 𝐴 𝐷 𝑣 = 𝑐∈𝑐ℎ(𝑣) min { 𝐴 𝐼 𝑐 , 𝐴 𝐸 [𝑐]} 𝐴 𝐼 𝑣 =𝜔 𝑣 + 𝑐∈𝑐ℎ(𝑣) min { 𝐴 𝐷 𝑐 , 𝐴 𝐼 𝑐 } v

30 Weighted Dominating Set in Trees
Dominating set: 𝑋⊆𝑉 such that each vertex is in 𝑋 or is a neighbor of some vertex in 𝑥. Define 𝐴 𝐷 𝑣 as min weight DS of 𝑇 𝑣 ∖𝑣 Define 𝐴 𝐼 𝑣 as min weight DS of 𝑇[𝑣] including 𝑣 Define 𝐴 𝐸 𝑣 as min weight DS of 𝑇[𝑣] excluding 𝑣 If 𝑣 is leaf, 𝐴 𝐸 𝑣 =∞, 𝐴 𝐷 [𝑣]=0, 𝐴 𝐼 𝑣 =𝜔(𝑣), otherwise: 𝐴 𝐷 𝑣 = 𝑐∈𝑐ℎ(𝑣) min { 𝐴 𝐼 𝑐 , 𝐴 𝐸 [𝑐]} 𝐴 𝐼 𝑣 =𝜔 𝑣 + 𝑐∈𝑐ℎ(𝑣) min { 𝐴 𝐷 𝑐 , 𝐴 𝐼 𝑐 } 𝐴 𝐸 𝑣 = min 𝑐∈𝑐ℎ(𝑣) { 𝐴 𝐼 [𝑐] + 𝑐 ′ ∈𝑐ℎ 𝑣 ∖𝑐 min⁡{ 𝐴 𝐼 𝑐 ′ , 𝐴 𝐸 [𝑐′]} v v still need to dominate v!

31 Weighted Dominating Set and Treewidth
Similar approach as for ind. set. Table 𝑇[𝑖,𝐷,𝐸,𝐼] for bag 𝑖 and partition D,E,I of 𝑋 𝑖 We need 3 states now for every vertex! Excluded and dominated already (D) Excluded and still needs to be dominated Included (I) Gives 9 𝑤 𝑤 𝑂(1) 𝑛 time algo, if given TD of width w ( exercise, 𝑂 ∗ (3 𝑤 ) table entries, additional time used for join bags)

32 Rule of thumb for other problems
Need table entry for bag and a characteristic of partial sol’s: ind. set.: which vertices of 𝑋 𝑖 are included dom. set: which vertices of 𝑋 𝑖 are included, and for the excluded ones, which ones are dominated by the vertices in 𝑉 𝑖 ? Usually the run time is proportional to the number of such characteristics (at most the square of it).

33 One first application In the 𝑘-path problem we are given an undirected graph 𝐺 and need to determine whether there exists a simple path on 𝑘 vertices.

34 One first application In the 𝑘-path problem we are given an undirected graph 𝐺 and need to determine whether there exists a simple path on 𝑘 vertices. NP-complete: 𝑘=𝑛 is Hamiltonian path Similarly as for IS and DS, it can be determined whether a 𝑘-path exists in 𝑤 𝑂(𝑤) 𝑛 time if a TD of width w if given (we’ll look at Ham. cycle in ex)

35 S            

36 2       S      

37 2 2 2 S            

38 2 2 2 S            

39 2 2 2 S            

40 A first application of treewidth
𝑘-path: given an undirected graph 𝐺=(𝑉,𝐸), determine whether there is a simple path on 𝑘 vertices. NP-complete (𝑘=𝑛 is Hamiltonian Path). Using similar methods as for IS and DS, there is an algorithm determining whether a 𝑘-path exists in 𝑤 𝑂(𝑤) 𝑛 time, if given TD of width w Using this fact we solve 𝑘-path in 𝑘 𝑂(𝑘) 𝑛 time: Pick 𝑠∈𝑉 arbitrarily, perform DFS from 𝑠. If height of DFS-tree ≥𝑘, return YES since path from 𝑠 to some leaf has length at least 𝑘. Otherwise, if the DFS-tree has height ≤𝑘, we use it to find a TD of width at most 𝑘 and we can apply the above algorithm

41 A first application of treewidth
≥𝑘

42 A first application of treewidth
<𝑘 𝑙 1 𝑙 5 𝑙 7 𝑙 2 𝑙 3 𝑙 4 𝑙 6 Let leaves be 𝑙 1 ,…, 𝑙 𝑝 . Create a tree decomposition as follows: T is the path on vertices 𝑋 1 ,…, 𝑋 𝑝 𝑋 𝑖 contains all ancestors of 𝑙 𝑖 in the DFS tree. Covers all vertices. Covers all edges since DFS tree. Third requirement: 𝑇 visits children of 𝑣 consecutively

43 TW of planar graphs with shallow spanning tree
Theorem Let 𝐺 be a planar graph and 𝑆 be a spanning tree of 𝐺 of height ℎ. Then given 𝐺 and 𝑆, a TD of 𝐺 of width at most 3ℎ can be found in polynomial time. Proof idea (not examined): Triangulate Bag for each face Edges in 𝑇 for faces sharing edge not in S Bag contains all verts in face and ancestors in S Covers all edges and faces 𝑇 has no cycle since 𝑆 is spanning. Bags containing vertex 𝑣 are connected since we can walk around faces adjacent to 𝑆[𝑣] 𝑇 connected by previous property since all bags contain root. Each bag ≤3(ℎ+1) since all 3 vertices of face ≤ℎ ancestors. X1={abc} X2={abd} X3={ade} X4={aeg} X5={abcd} X6={acdef} X7={acefh} X8={acegh} X9 ={acdf} X10 ={acfh} X11 ={acghj} X12 ={achi} X13 ={achij} X14 ={agcj} X15 ={acij} X16 ={acg} 1 5 3 4 6 7 8 9 10 11 14 12 13 15 2 16 a b e d f c i h g j a b e d f c i h g j a b e d f c i h g j 1 5 3 4 6 7 8 9 10 11 14 12 13 15 2 16 a b e d f c i h g j a b e d f c i h g j 1 5 3 4 6 7 8 9 10 11 14 12 13 15 2 16 a b e d f c i h g j root To see that the constant works out, the root is accounted for thrice in 3(h+1) so subtract 2 and also subtract one because of the definition of treewidth.

44 Baker’s approach for approximation in planar graphs
Given planar graph 𝐺, 𝜔:𝑉→ℕ and 𝜖>0. Find IS of weight at least 1−𝜖 𝑂𝑃𝑇 in 𝑂 ∗ (2 𝑂(1/𝜖) ) time you have seen 𝑂 ∗ (2 𝑂(1/ 𝜖 2 ) ) time before Pick vertex 𝑠 arbitrarily. Do BFS from 𝑠 Let 𝐿 𝑖 be all vertices at distance 𝑖 Let 𝑘=1/𝜖 Let 𝑉 𝑖 = 𝑗≠𝑖 (𝑚𝑜𝑑 𝑘) 𝐿 𝑗 For 𝑖=1,…,𝑘 Find max weight IS of 𝐺 𝑉 𝑖 s 𝐿 1 𝐿 2 𝐿 3 𝐿 4 𝐿 𝑑

45 Baker’s approach for approximation in planar graphs
Given planar graph 𝐺, 𝜔:𝑉→ℕ and 𝜖>0. Find IS of weight at least 1−𝜖 𝑂𝑃𝑇 in 𝑂 ∗ (2 𝑂(1/𝜖) ) time you have seen 𝑂 ∗ (2 𝑂(1/ 𝜖 2 ) ) time before Pick vertex 𝑠 arbitrarily. Do BFS from 𝑠 Let 𝐿 𝑖 be all vertices at distance 𝑖 Let 𝑘=1/𝜖 Let 𝑉 𝑖 = 𝑗≠𝑖 (𝑚𝑜𝑑 𝑘) 𝐿 𝑗 For 𝑖=1,…,𝑘 Find max weight IS of 𝐺 𝑉 𝑖 : Return max weight found Let 𝑉 𝑖 =𝑉∖ 𝑉 𝑖 . 𝑉 𝑖 partition 𝑉. If 𝐼 is MWIS, ∃𝑖: 𝜔 𝐼∖ 𝑉 𝑖 ≤𝑂𝑃𝑇 Then MWIS of 𝐺 𝑉 𝑖 ≥𝑂𝑃𝑇−𝑂𝑃𝑇/𝑘=𝑂𝑃𝑇 1−𝜖 s 𝐿 1 𝐿 2 𝐿 3 𝐿 4 𝐿 𝑑

46 Baker’s approach for approximation in planar graphs
For a<b<c, 𝐿 𝑏 separates 𝐿 𝑎 from 𝐿 𝑐 by distance property. 𝐺 𝑉 𝑖 splits in cc’s 𝐿 1 … 𝑙 𝑗−1 , 𝐿 𝑗+1 … 𝐿 𝑗+𝑘−1 , 𝐿 𝑗+𝑘+1 … 𝐿 𝑗+2𝑘−1 ,… Find TD of each cc (can later obtain TD of 𝐺[ 𝑉 𝑖 ] form this by adding empty bag to connected the tree) To find TD of each cc: Let 𝑎 be the min. int such that L 𝑎 is in cc Add a vertex 𝑧 adjacent to every vertex of 𝐿 𝑎 This new graph is still planar since we can put 𝑧 at 𝑠’s place at the embedding and the BFS tree from 𝑠 has paths from 𝑠 to 𝐿 𝑎 avoiding vertices from 𝐿 𝑏 with 𝑏>𝑎 Perform BFS from 𝑧 in this graph. Gives tree of height at most 𝑘 by definition of layers. Apply previous thm. Use the 𝑂 ∗ 2 𝑤 time algorithm for MWIS. 𝐿 5 𝐿 4 z

47 Graph Minor 𝐻 is a minor of 𝐺: 𝐻 can be obtained from 𝐺 with edge deletion, vertex deletion and edge contraction Edge contraction: is a minor of d e a b c f g h i a b c f g h de i

48 Graph Minor 𝐻 is a minor of 𝐺: 𝐻 can be obtained from 𝐺 with edge deletion, vertex deletion and edge contraction Edge contraction: is a minor of a f a b c f g h de b d e g c i h i is a minor of 𝐺 iff ??? 𝐺 has a cycle Seen before in L3: Kuratowski’s theorem states that 𝐺 planar iff it has no 𝐾 5 or 𝐾 3,3 as minor.

49 Grid Minors Grid Minor Theorem
For every integer l, every planar graph either has a (𝑙×𝑙)-grid as a minor or treewidth at most 9𝑙. Moreover, there exists a polynomial time algorithm that either finds such a minor model or a TD. Proof uses max-flow min-cut arguments, but beyond scope of the course... Gives 𝑂 ∗ 2 𝑂( 𝑛) -time and 𝑂 ∗ 2 𝑂( 𝑘 ) -time algorithms for many (parameterized) graph problems (see exercises).

50 DFS /BFS reminder DFS(G,s) BFS(G,s) Let S be a stack S.push(s)
WHILE S not empty v= S.pop() If v is not labeled as visited Label v as visited For all neighbors w of v S.push(w) BFS(G,s) Let S be a queue S.push(s) WHILE S not empty v= S.pop() If v is not labeled as visited Label v as visited For all neighbors w of v S.push(w)


Download ppt "Graphs and Algorithms (2MMD30)"

Similar presentations


Ads by Google