Introduction to Treewidth
Total Page:16
File Type:pdf, Size:1020Kb
Introduction to Treewidth Marcin Pilipczuk most slides by Łukasz Kowalik some slides by Marek Cygan and Michał Pilipczuk Algorytmika, 11.05.2020r. Marcin Pilipczuk (UW) Introduction to treewidth 1 / 34 Treewidth Marcin Pilipczuk (UW) Introduction to treewidth 2 / 34 The book Contained in Chapter 7 of http://parameterized-algorithms.mimuw.edu.pl Marcin Pilipczuk (UW) Introduction to treewidth 3 / 34 I Principle of dynamic programming. NP-hard in general, tractable in many special cases. Easy exercise: linear-time algorithm on trees. Motivation of treewidth Independent Set: given a graph with vertex weights, find the maximum weight of a subset of vertices that are pairwise non-adjacent. Marcin Pilipczuk (UW) Introduction to treewidth 4 / 34 I Principle of dynamic programming. Easy exercise: linear-time algorithm on trees. Motivation of treewidth Independent Set: given a graph with vertex weights, find the maximum weight of a subset of vertices that are pairwise non-adjacent. NP-hard in general, tractable in many special cases. Marcin Pilipczuk (UW) Introduction to treewidth 4 / 34 I Principle of dynamic programming. Motivation of treewidth Independent Set: given a graph with vertex weights, find the maximum weight of a subset of vertices that are pairwise non-adjacent. NP-hard in general, tractable in many special cases. Easy exercise: linear-time algorithm on trees. Marcin Pilipczuk (UW) Introduction to treewidth 4 / 34 Motivation of treewidth Independent Set: given a graph with vertex weights, find the maximum weight of a subset of vertices that are pairwise non-adjacent. NP-hard in general, tractable in many special cases. Easy exercise: linear-time algorithm on trees. I Principle of dynamic programming. Marcin Pilipczuk (UW) Introduction to treewidth 4 / 34 I A[u]: maximum weight of an IS in Tu. I B[u]: maximum weight of an IS in Tu that contains u. I C[u]: maximum weight of an IS in Tu that excludes u. I A[u] = max(B[u]; C[u]). P I B[u] = w(u) + v2chld(u) C[v]. P I C[u] = v2chld(u) A[v]. I Tu is the subtree rooted at u. Compute dynamic programming tables: Recursive formulas: Answer: A[r]. u Weighted Independent Set on trees Root the tree in an arbitrary vertex r. Marcin Pilipczuk (UW) Introduction to treewidth 5 / 34 I A[u]: maximum weight of an IS in Tu. I B[u]: maximum weight of an IS in Tu that contains u. I C[u]: maximum weight of an IS in Tu that excludes u. I A[u] = max(B[u]; C[u]). P I B[u] = w(u) + v2chld(u) C[v]. P I C[u] = v2chld(u) A[v]. Compute dynamic programming tables: Recursive formulas: Answer: A[r]. Weighted Independent Set on trees Root the tree in an arbitrary vertex r. I Tu is the subtree rooted at u. u Marcin Pilipczuk (UW) Introduction to treewidth 5 / 34 I A[u] = max(B[u]; C[u]). P I B[u] = w(u) + v2chld(u) C[v]. P I C[u] = v2chld(u) A[v]. I A[u]: maximum weight of an IS in Tu. I B[u]: maximum weight of an IS in Tu that contains u. I C[u]: maximum weight of an IS in Tu that excludes u. Recursive formulas: Answer: A[r]. Weighted Independent Set on trees Root the tree in an arbitrary vertex r. I Tu is the subtree rooted at u. Compute dynamic programming tables: u Marcin Pilipczuk (UW) Introduction to treewidth 5 / 34 I A[u] = max(B[u]; C[u]). P I B[u] = w(u) + v2chld(u) C[v]. P I C[u] = v2chld(u) A[v]. I B[u]: maximum weight of an IS in Tu that contains u. I C[u]: maximum weight of an IS in Tu that excludes u. Recursive formulas: Answer: A[r]. Weighted Independent Set on trees Root the tree in an arbitrary vertex r. I Tu is the subtree rooted at u. Compute dynamic programming tables: I A[u]: maximum weight of an IS in Tu. u Marcin Pilipczuk (UW) Introduction to treewidth 5 / 34 I A[u] = max(B[u]; C[u]). P I B[u] = w(u) + v2chld(u) C[v]. P I C[u] = v2chld(u) A[v]. I C[u]: maximum weight of an IS in Tu that excludes u. Recursive formulas: Answer: A[r]. Weighted Independent Set on trees Root the tree in an arbitrary vertex r. I Tu is the subtree rooted at u. Compute dynamic programming tables: I A[u]: maximum weight of an IS in Tu. I B[u]: maximum weight of an IS in Tu that contains u. u Marcin Pilipczuk (UW) Introduction to treewidth 5 / 34 I A[u] = max(B[u]; C[u]). P I B[u] = w(u) + v2chld(u) C[v]. P I C[u] = v2chld(u) A[v]. Recursive formulas: Answer: A[r]. Weighted Independent Set on trees Root the tree in an arbitrary vertex r. I Tu is the subtree rooted at u. Compute dynamic programming tables: I A[u]: maximum weight of an IS in Tu. I B[u]: maximum weight of an IS in Tu that contains u. I C[u]: maximum weight of an IS in Tu that excludes u. u Marcin Pilipczuk (UW) Introduction to treewidth 5 / 34 I A[u] = max(B[u]; C[u]). P I B[u] = w(u) + v2chld(u) C[v]. P I C[u] = v2chld(u) A[v]. Answer: A[r]. Weighted Independent Set on trees Root the tree in an arbitrary vertex r. I Tu is the subtree rooted at u. Compute dynamic programming tables: I A[u]: maximum weight of an IS in Tu. I B[u]: maximum weight of an IS in Tu that contains u. I C[u]: maximum weight of an IS in Tu that excludes u. Recursive formulas: u Marcin Pilipczuk (UW) Introduction to treewidth 5 / 34 P I B[u] = w(u) + v2chld(u) C[v]. P I C[u] = v2chld(u) A[v]. Answer: A[r]. Weighted Independent Set on trees Root the tree in an arbitrary vertex r. I Tu is the subtree rooted at u. Compute dynamic programming tables: I A[u]: maximum weight of an IS in Tu. I B[u]: maximum weight of an IS in Tu that contains u. I C[u]: maximum weight of an IS in Tu that excludes u. Recursive formulas: I A[u] = max(B[u]; C[u]). u Marcin Pilipczuk (UW) Introduction to treewidth 5 / 34 P I C[u] = v2chld(u) A[v]. Answer: A[r]. Weighted Independent Set on trees Root the tree in an arbitrary vertex r. I Tu is the subtree rooted at u. Compute dynamic programming tables: I A[u]: maximum weight of an IS in Tu. I B[u]: maximum weight of an IS in Tu that contains u. I C[u]: maximum weight of an IS in Tu that excludes u. Recursive formulas: I A[u] = max(B[u]; C[u]). P I B[u] = w(u) + v2chld(u) C[v]. u Marcin Pilipczuk (UW) Introduction to treewidth 5 / 34 Answer: A[r]. Weighted Independent Set on trees Root the tree in an arbitrary vertex r. I Tu is the subtree rooted at u. Compute dynamic programming tables: I A[u]: maximum weight of an IS in Tu. I B[u]: maximum weight of an IS in Tu that contains u. I C[u]: maximum weight of an IS in Tu that excludes u. Recursive formulas: I A[u] = max(B[u]; C[u]). P I B[u] = w(u) + v2chld(u) C[v]. P I C[u] = v2chld(u) A[v]. u Marcin Pilipczuk (UW) Introduction to treewidth 5 / 34 Weighted Independent Set on trees Root the tree in an arbitrary vertex r. I Tu is the subtree rooted at u. Compute dynamic programming tables: I A[u]: maximum weight of an IS in Tu. I B[u]: maximum weight of an IS in Tu that contains u. I C[u]: maximum weight of an IS in Tu that excludes u. Recursive formulas: I A[u] = max(B[u]; C[u]). P I B[u] = w(u) + v2chld(u) C[v]. P I C[u] = v2chld(u) A[v]. Answer: A[r]. u Marcin Pilipczuk (UW) Introduction to treewidth 5 / 34 Independent Set on trees: Why does the DP work? Very limited dependence between vertices Essential information about subtree stored in a compact way. u Marcin Pilipczuk (UW) Introduction to treewidth 6 / 34 Generalizations of paths and trees path pathlike Pathwidth Graph of small pathwidth is path-like. We hope that problems tractable on paths are also tractable on graphs of small pathwidth. Marcin Pilipczuk (UW) Introduction to treewidth 7 / 34 Generalizations of paths and trees tree treelike Treewidth Graph of small treewidth is tree-like. We hope that problems tractable on trees are also tractable on graphs of small treewidth. Marcin Pilipczuk (UW) Introduction to treewidth 7 / 34 Generalizations of paths and trees tree treelike Treewidth Graph of small treewidth is tree-like. We hope that problems tractable on trees are also tractable on graphs of small treewidth. Marcin Pilipczuk (UW) Introduction to treewidth 7 / 34 Introduction Crucial property of small pathwidth/treewidth graphs: separators. Marcin Pilipczuk (UW) Introduction to treewidth 8 / 34 Introduction Crucial property of small pathwidth/treewidth graphs: separators. Marcin Pilipczuk (UW) Introduction to treewidth 8 / 34 Introduction Crucial property of small pathwidth/treewidth graphs: separators. Marcin Pilipczuk (UW) Introduction to treewidth 8 / 34 Introduction Crucial property of small pathwidth/treewidth graphs: separators. Marcin Pilipczuk (UW) Introduction to treewidth 8 / 34 Introduction Crucial property of small pathwidth/treewidth graphs: separators.