
Yonatan Itai March 2020 Treewidth/Pathwidth Seminar on Exact Exponential Algorithms • Definitions & motivation • Treewidth • Pathwidth • Dynamic programming examples on What are we graphs with bounded pathwidth going to talk • Maximum cut about? • Counting perfect matchings • Bounding a graph’s pathwidth • Independent set of size 푖 • Trees • Upper-bound in graphs of maximum degree 3 Why is the notion of treewidth/pathwidth interesting? • It is fundamental in graph theory and graph algorithms • Intuitively: measures the “similarity” of the graph to a tree/path • Multiple applications in exact algorithms on graphs • We can solve hard problems faster on graphs with bounded treewidth/pathwidth using dynamic programming Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Tree Decomposition Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Tree Decomposition Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Tree Decomposition Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Tree Decomposition Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Tree Decomposition Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Tree Decomposition Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Tree Decomposition Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Tree Decomposition Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Path Decomposition • The path decomposition of a graph is a tree decomposition with tree T being a path • A path decomposition is often denoted by listing the successive sets: • The width of a path decomposition is max • The pathwidth of a graph 퐺, denoted by 푝푤(퐺), is the minimum width of a path decomposition Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Path Decomposition Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Nice Path Decomposition • A path decomposition (푋1, 푋2, … , 푋푟) of a graph 퐺 is nice if: • |푋1| = |푋푟| = 1 • For every 푖 ∈ {1,2, … , 푟 − 1} there is a vertex v of G such that either 푋푖+1 = 푋푖 ∪ {푣} or 푋푖+1 = 푋푖\{푣} • Given a path decomposition of a graph 퐺 of width 푘, a nice path decomposition of the same width can be constructed in a linear time Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Nice Path Decomposition Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Path Decomposition – Another Definition • Every vertex of the graph is an interval in ℝ • For every edge (푢, 푣) in the graph, there must be an intersection between the intervals of 푢 and 푣 The width is the maximum number of overlapping intervals minus 1 Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Path Decomposition – Another Definition A,B,C A,C,D C,D,E C,D,F F,G Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Path Decomposition – Another Definition A A,B A,B,C A,C A,C,D C,D C,D,E C,D C,D,F C,F FF F,G G Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Maximum Cut Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Maximum Cut • The naïve solution – enumerate all possible cuts • There are 2푛 cuts, so the time complexity is 풪∗(2푛) • What about graphs with bounded pathwidth? Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Maximum Cut • We’re given a graph 퐺 and its path decomposition of width 푘 • Our goal: find a maximum cut in 풪∗(2푘) • More Formally: Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Maximum Cut • We can transform in linear time the given path decomposition to a nice path decomposition of width 푘: 푃 = (푋1, 푋2, … , 푋푟) • For 푖 ∈ {1,2, … , 푟}, we denote 푖 푉푖 = ራ 푋푗 푗=1 • Note that 푉푟 = 푉 Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Maximum Cut • We want to use dynamic programming • How can we partition our problem into smaller sub-problems? • Consider some 푋푖, and every partition of it into sets (퐴, 퐵) • We want to compute the maximum size of a cut in 퐺 푉푖 • The maximum is taken over all cuts (퐴′, 퐵′), s.t 퐴 ⊆ 퐴′ and 퐵 ⊆ 퐵′ • Denote it 푐푖(퐴, 퐵) • The maximum cut size in 퐺 is max{푐푟 퐴, 퐵 : 퐴, 퐵 is a partition of 푋푟} Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 푉푖 (A,B,C,D,E) 푋푖 A A,B A,B,C A,C A,C,D C,D C,D,E C,D C,D,F C,F FF F,G G D C E A B Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Maximum Cut • Our dynamic programming algorithm – for every 푖: • Compute 푐푖(퐴, 퐵) for every partition (퐴, 퐵) of 푋푖 • 푖 = 1: • 푋1 = 푣 for some 푣 ∈ 푉 • Only 2 possible partitions: (∅, 푣 ) and ( 푣 , ∅) • The size of a cut in both is 0 • 푖 > 1: We consider 2 cases • 푋푖 = 푋푖−1 ∪ 푣 for some 푣 ∈ 푉 • 푋푖 = 푋푖−1 \ 푣 for some 푣 ∈ 푉 Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Maximum Cut • 푋푖 = 푋푖−1 ∪ 푣 for some 푣 ∈ 푉 • We note that all neighbors of 푣 in 푉푖 are in 푋푖−1 ∩ 푋푖 = 푋푖−1 푉푖 푋1 푋2 푋푖−2 푋푖−1 푋푖 푋푟 푋푖−1 ∪ 푣 • Consider 푢, a neighbor of 푣 which is in 푉푖−1\X푖−1 • There exists 푗 < 푖 − 1 s.t 푢 ∈ 푋푗 • Also, as 푢, 푣 are neighbors, there must be a 푘 > 푖 s.t 푢 ∈ 푋푘 • But 푢 ∉ 푋푖−1, thus the sets containing it are not in the same connected sub-path Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 푉푖 (A,B,C,D,E) 푋푖 A A,B A,B,C A,C A,C,D C,D C,D,E C,D C,D,F C,F FF F,G G Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Maximum Cut • 푋푖 = 푋푖−1 ∪ 푣 for some 푣 ∈ 푉 • We note that all neighbors of 푣 in 푉푖 are in 푋푖−1 ∩ 푋푖 = 푋푖−1 • Then for every partition (퐴, 퐵) of 푋푖 푐푖−1(퐴\ {푣}, 퐵) + 퐶푈푇({푣}, 퐵), if 푣 ∈ 퐴 푐푖(퐴, 퐵) = ቊ 푐푖−1 퐴, 퐵\ 푣 + 퐶푈푇 푣 , 퐴 , if 푣 ∉ 퐴 Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 푉푖 (A,B,C,D,E) 푋푖 A A,B A,B,C A,C A,C,D C,D C,D,E C,D C,D,F C,F FF F,G G D C E B A Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Maximum Cut • 푋푖 = 푋푖−1\ 푣 for some 푣 ∈ 푉 • We notice that in this case 푉푖 = 푉푖−1 • For every partition (퐴, 퐵) of 푋푖 • 푋푖−1 has 2 partitions that “respect” (퐴, 퐵) • Hence: 푐푖 퐴, 퐵 = max{푐푖−1 퐴 ∪ 푣 , 퐵 , 푐푖−1(퐴, 퐵 ∪ 푣 ) Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 푉푖 (A,B,C,D,E) 푋푖 A A,B A,B,C A,C A,C,D C,D C,D,E C,D C,D,F C,F FF F,G G D C E Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Maximum Cut – Complexity • For every 푖 ∈ {1, … , 푟} 푋푖 • There are 2 partitions (퐴, 퐵) of 푋푖 • 푐푖(퐴, 퐵) can be computed in 풪 |푋푖| • We store the computation for every partition (we need the computatioms for 푖 − 1 when we do the computations for 푖) • Total running time: 푟 푋푖 푘 ∗ 푘 풪 2 |푋푖| = 풪 2 ⋅ 푘 ⋅ 푛 = 풪 (2 ) 푖=1 • Total space used: 풪∗ 2푘 Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Counting Perfect Matchings • Reminder – we talked last week about perfect matchings in bipartite graphs • A matching 푀 of a graph 퐺 = 푉, 퐸 is perfect if 푀 is an edge cover of 퐺 1 a 2 b 3 c 4 d Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Counting Perfect Matchings • Example of a perfect matching in non-bipartite graph: Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Counting Perfect Matchings • For bipartite graphs – inclusion/exclusion algorithm • Time: 풪∗ 2푛 • Space: Polynomial • We haven’t seen an algorithm for the general case • We can use dynamic programming algorithm to count perfect matchings in a general graph with bounded pathwidth: Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Counting Perfect Matchings • We can transform in linear time the given path decomposition to a nice path decomposition of width 푘: 푃 = (푋1, 푋2, … , 푋푟) • For 푖 ∈ {1,2, … , 푟}, we denote 푖 푉푖 = ራ 푋푗 푗=1 • Note that 푉푟 = 푉 Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Counting Perfect Matchings • Consider some 푋푖, and every partition of it into sets (퐴, 퐵) • We’ll compute the number of matchings 푀 in 퐺 푉푖 such that: • 푀 covers every vertex of 푉푖 \B • 푀 doesn’t cover any of the vertices of 퐵 • Denote it 푚푖(퐴, 퐵) • The number of perfect matchings in 퐺 is 푚푟 푋푟, ∅ Definitions & Counting perfect Bounding Pathwidth when Maximum Cut motivation matchings pathwidth Δ = 3 Counting Perfect Matchings • Our dynamic programming algorithm – for every 푖: • Compute 푚푖(퐴, 퐵) for every partition (퐴, 퐵) of 푋푖 • 푖 = 1: • 푋1 = 푣 for some 푣 ∈ 푉 • Only
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages72 Page
-
File Size-