Algorithms and Networks

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

Shortest Paths and Treewidth Algorithms and Networks.
Minimum Vertex Cover in Rectangle Graphs
Presented By: Saleh A. Almugrin * Based and influenced by many works of Hans L. Bodlaender, * Based and influenced by many works of Hans.
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Lauritzen-Spiegelhalter Algorithm
Graph Isomorphism Algorithms and networks. Graph Isomorphism 2 Today Graph isomorphism: definition Complexity: isomorphism completeness The refinement.
Presented by Yuval Shimron Course
1 Steiner Tree on graphs of small treewidth Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
1 Partition Into Triangles on Bounded Degree Graphs Johan M. M. van Rooij Marcel E. van Kooten Niekerk Hans L. Bodlaender.
Junction Trees And Belief Propagation. Junction Trees: Motivation What if we want to compute all marginals, not just one? Doing variable elimination for.
Online Social Networks and Media. Graph partitioning The general problem – Input: a graph G=(V,E) edge (u,v) denotes similarity between u and v weighted.
Approximation Algorithms Chapter 5: k-center. Overview n Main issue: Parametric pruning –Technique for approximation algorithms n 2-approx. algorithm.
CS774. Markov Random Field : Theory and Application Lecture 17 Kyomin Jung KAIST Nov
Probabilistic networks Inference and Other Problems Hans L. Bodlaender Utrecht University.
Advanced Topics in Algorithms and Data Structures 1 Rooting a tree For doing any tree computation, we need to know the parent p ( v ) for each node v.
16:36MCS - WG20041 On the Maximum Cardinality Search Lower Bound for Treewidth Hans Bodlaender Utrecht University Arie Koster ZIB Berlin.
FPT algorithmic techniques: Treewidth (1)
Welcome to the TACO Project Finding tree decompositions Hans L. Bodlaender Institute of Information and Computing Sciences Utrecht University.
2-Layer Crossing Minimisation Johan van Rooij. Overview Problem definitions NP-Hardness proof Heuristics & Performance Practical Computation One layer:
Coloring Algorithms and Networks. Coloring2 Graph coloring Vertex coloring: –Function f: V  C, such that for all {v,w}  E: f(v)  f(w) Chromatic number.
Steiner trees Algorithms and Networks. Steiner Trees2 Today Steiner trees: what and why? NP-completeness Approximation algorithms Preprocessing.
1 Refined Search Tree Technique for Dominating Set on Planar Graphs Jochen Alber, Hongbing Fan, Michael R. Fellows, Henning Fernau, Rolf Niedermeier, Fran.
Treewidth Algorithms and Networks. Treewidth2 Overview Historic introduction: Series parallel graphs Dynamic programming on trees Dynamic programming.
Constant Factor Approximation of Vertex Cuts in Planar Graphs Eyal Amir, Robert Krauthgamer, Satish Rao Presented by Elif Kolotoglu.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Fixed Parameter Complexity Algorithms and Networks.
Kernel Bounds for Structural Parameterizations of Pathwidth Bart M. P. Jansen Joint work with Hans L. Bodlaender & Stefan Kratsch July 6th 2012, SWAT 2012,
Approximating Minimum Bounded Degree Spanning Tree (MBDST) Mohit Singh and Lap Chi Lau “Approximating Minimum Bounded DegreeApproximating Minimum Bounded.
1 Treewidth, partial k-tree and chordal graphs Delpensum INF 334 Institutt fo informatikk Pinar Heggernes Speaker:
TCP Traffic and Congestion Control in ATM Networks
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Euler paths and tours.
1 Steiner Tree Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Chapter 10 Graph Theory Eulerian Cycle and the property of graph theory 10.3 The important property of graph theory and its representation 10.4.
Computing Branchwidth via Efficient Triangulations and Blocks Authors: F.V. Fomin, F. Mazoit, I. Todinca Presented by: Elif Kolotoglu, ISE, Texas A&M University.
Trees Dr. Yasir Ali. A graph is called a tree if, and only if, it is circuit-free and connected. A graph is called a forest if, and only if, it is circuit-free.
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
Algorithms for hard problems Parameterized complexity Bounded tree width approaches Juris Viksna, 2015.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
1 Schnyder’s Method. 2 Motivation Given a planar graph, we want to embed it in a grid We want the grid to be relatively small And we want an efficient.
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
The Theory of NP-Completeness
Steiner trees: Approximation Algorithms
P & NP.
Graphs and Algorithms (2MMD30)
Algorithms for Finding Distance-Edge-Colorings of Graphs
Hans Bodlaender, Marek Cygan and Stefan Kratsch
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
Parameterized complexity Bounded tree width approaches
12. Graphs and Trees 2 Summary
Algorithms and networks
Exact Inference Continued
Algorithms and Complexity
Graph Algorithms Using Depth First Search
Structural graph parameters Part 2: A hierarchy of parameters
Richard Anderson Lecture 25 NP-Completeness
Coping With NP-Completeness
Algorithms and networks
Boi Faltings and Martin Charles Golumbic
Introduction Wireless Ad-Hoc Network
Boi Faltings and Martin Charles Golumbic
Tree -decomposition * 竹内 和樹 * 藤井 勲.
Miniconference on the Mathematics of Computation
Exact Inference Continued
The Theory of NP-Completeness
Clustering.
Trevor Brown DC 2338, Office hour M3-4pm
Variable Elimination Graphical Models – Carlos Guestrin
Coping With NP-Completeness
Presentation transcript:

Algorithms and Networks Treewidth Algorithms and Networks © Hans L. Bodlaender

Overview Historic introduction: Series parallel graphs Dynamic programming on trees Dynamic programming on series parallel graphs Treewidth Dynamic programming on graphs of small treewidth Finding tree decompositions Treewidth

Computing the Resistance With the Laws of Ohm 1789-1854 R1 R2 R1 R2 Two resistors in series Two resistors in parallel Treewidth

Repeated use of the rules 6 6 5 2 2 1 7 Has resistance 4 1/6 + 1/2 = 1/(1.5) 1.5 + 1.5 + 5 = 8 1 + 7 = 8 1/8 + 1/8 = 1/4 Treewidth

A tree structure 5 P 7 6 2 S S P P 5 7 1 1 6 2 6 2 6 2 Treewidth

Carry on! Internal structure of graph can be forgotten once we know essential information about it! 6 2 5 1 7 4 ¼ + ¼ = ½ Treewidth

Using tree structures for solving hard problems on graphs 1 Network is ‘series parallel graph’ 196*, 197*: many problems that are hard for general graphs are easy for Trees Series parallel graphs Many well-known problems e.g.: NP-complete Linear / polynomial time computable Treewidth

Weighted Independent Set Independent set: set of vertices that are pair wise non-adjacent. Weighted independent set Given: Graph G=(V,E), weight w(v) for each vertex v. Question: What is the maximum total weight of an independent set in G? NP-complete Treewidth

Weighted Independent Set on Trees On trees, this problem can be solved in linear time with dynamic programming. Choose root r. For each v, T(v) is subtree with v as root. Write A(v) = maximum weight of independent set S in T(v) B(v) = maximum weight of independent set S in T(v), such that v Ï S. Treewidth

Recursive formulations If v is a leaf: A(v) = w(v) B(v) = 0 If v has children x1, … , xr: A(v) = max{ w(v) + B(x1) + … + B(xr) , A(x1) + … A(xr) } B(v) = A(x1) + … A(xr) Treewidth

Linear time algorithm Compute A(v) and B(v) for each v, bottom-up. E.g., in postorder Constructing corresponding sets can also be done in linear time. Treewidth

Second example: Weighted dominating set A set of vertices S is dominating, if each vertex in G belongs to S or is adjacent to a vertex in S. Problem: given a graph G with vertex weights, what is the minimum total weight of a dominating set in G? Again, NP-complete, but linear time on trees. Treewidth

Subproblems C(v) = minimum weight of dominating set S of T(v) D(v) = minimum weight of dominating set S of T(v) with v Î S. E(v) = minimum weight of a set S of T(v) that dominates all vertices, except possibly v. Treewidth

Recursive formulations If v is a leaf, … If v has children x1, … , xr: C(v) = the minimum of: w(v) + E(x1) + … + E(xr) C(x1) + … + C(xi-1) + D(xi) + C(xi+1) + … + C(xr), over all i, 1 £ i £ r. D(v) = w(v) + E(x1) + … + E(xr) E(v) = min { w(v) + E(x1) + … + E(xr), C(x1) + … + C(xr) } Treewidth

Gives again a linear time algorithm Compute bottom up (e.g., postorder), and use another type of dynamic programming for the values C(v). Constructing sets can also be done in linear time Treewidth

Generalizing to series parallel graphs A 2-terminal graph is a graph G=(V,E) with two special vertices s and t, its terminals. A 2-terminal (multi)-graph is series parallel, when it is: A single edge (s,t). Obtained by series composition of 2 series parallel graphs Obtained by parallel composition of 2 series parallel graphs Treewidth

Series composition s1 s1 s2 + s2=t1 s2 t1 t2 t2 Treewidth

Parallel composition s1 s2 s1=s2 s1 + t1 t2 t1=t2 t1 Treewidth

Series Parallel Graphs have an SP-tree 5 P 7 6 2 S S P P 5 7 1 1 6 2 6 2 6 2 Treewidth

G(i) Associate to each node i of SP tree a 2-terminal graph G(i). 5 6 7 1 6 2 6 2 Treewidth

Maximum weighted independent set for series parallel graphs G(i), say with terminals s and t AA(i) = maximum weight of independent set S of G(i) with s Î S, t Î S BA(i) = maximum weight of independent set S of G(i) with s Ï S, t Î S AB(i) = maximum weight of independent set S of G(i) with s Î S, t Ï S BB(i) = maximum weight of independent set S of G(i) with s Ï S, t Ï S Treewidth

Maximum weighted independent set of series parallel graphs 2 Computing AA, AB, BA, BB for Leaves of SP-tree: trivial Series, parallel composition: case analysis, using values for sub-sp-graphs G(i1), G(i2) E.g., series operation, s’ terminal between i1 and i2 AA(i) = max {AA(i1)+AA(i2) – w(s’), AB(i1) + BA(i2) } O(1) time per node of SP-tree: O(n) total. Treewidth

Many generalizations Many other problems Other classes of graphs to which we can assign a tree-structure, including Graphs of treewidth k, for small k. Treewidth

Idea of treewidth (intuition) k-terminal graph: G=(V,E,T) |T|=k Operations on l-terminal graphs with l <= k Take a 1-terminal graph with one vertex Add a new terminal vertex with edges only to (some of) the terminal vertices Make a terminal vertex `normal’ Join two k-terminal graphs by `gluing’ Treewidth is (plus/minus 1) number of terminals needed to build graph Treewidth

Join (“gluing”) = + Treewidth

Tree decomposition A tree decomposition: g a Tree with a vertex set associated to every node. For all edges {v,w}: there is a set containing both v and w. For every v: the nodes that contain v form a connected subtree. h b c f e d a a g c f a g h b c f d c e Treewidth

Tree decomposition A tree decomposition: g a Tree with a vertex set associated to every node. For all edges {v,w}: there is a set containing both v and w. For every v: the nodes that contain v form a connected subtree. h b c f e d a a g c f a g h b c f d c e Treewidth

Treewidth (definition) g a h Width of tree decomposition: Treewidth of graph G: tw(G)= minimum width over all tree decompositions of G. b c f e d a a g c f a g h b c f d c e a b c e f d g h Treewidth

Some graphs have small treewidth Appearing in some applications (e.g., probabilistic networks) Trees have treewidth 1 Series Parallel graphs have treewidth 2. … Treewidth

Trees have treewidth one Choose a root r Take Xr = {r}, and for each other node i: Xi = {i, parent(i)} T with these bags gives a tree decomposition of width 2 a b e a c d b a e a c b d b Treewidth

Algorithms using tree decompositions Step 1: Find a tree decomposition of width bounded by some small k. Heuristics. O(f(k)n) in theory. Fast O(n) algorithms for k=2, k=3. By construction, e.g., for trees, sp-graphs. Step 2. Use dynamic programming, bottom-up on the tree. Treewidth

If both v and w not in Xi, then Separator property w i If both v and w not in Xi, then v and w are not adjacent v Treewidth

Nice tree decompositions Rooted tree, and four types of nodes i: Leaf: leaf of tree with |Xi| = 1. Join: node with two children j, j’ with Xi = Xj = Xj’. Introduce: node with one child j with Xi = Xj È {v} for some vertex v Forget: node with one child j with Xi = Xj - {v} for some vertex v There is always a nice tree decomposition with the same width. Treewidth

Transformation to a nice tree decomposition Step 1: Choose an arbitrary vertex as root Step 2: Ensure that each node has at most 2 children: Xi Xi Xi Xj(q) Xi … Xj(1) Xj(2) Xj(q) … Xj(1) Xj(2) Treewidth

Transformation to a nice tree decomposition Step 3: Turn binary nodes in join nodes Xi Xi Xj(1) Xj(2) Xi Xi Xj(1) Xj(2) Treewidth

Transformation to a nice tree decomposition Step 4: Nodes with one child get a series of introduce and forget nodes Xi Above, introduce vertices in Xi that are not in Xj Xi Xj Below, forget vertices in Xj that are not in Xi Xj Treewidth

Transformation to a nice tree decomposition Step 5: Ensure that leaf bags have size 1, by adding introduce nodes: v1 v2 … vr v1 v2 … vr v1 v2 … vr … Done! v1 v2 v1 Treewidth

Define G(i) Nice tree decomposition. For each node i, G(i) subgraph of G, formed by all nodes in sets Xj, with j=i or j a descendant of i in tree. Notate: G(i) = ( V(i), E(i) ). Treewidth

G(i) is a graph with one vertex Leaf nodes Let i be a leaf node. Say Xi = {v}. v G(i) is a graph with one vertex Treewidth

Join nodes = + Let i be a join node with children j1, j1. Example of how G(i) is build from G(j1) and G(j1): = + Treewidth

Introduce nodes Let i be a node with child j, with Xi = Xj È {v}. One new `terminal’ vertex which can only be adjacent to other terminal vertices v Treewidth

Forget nodes Let i be a node with child j, with Xi = Xj - {v}. Same graph; one terminal vertex now is a normal vertex v v Treewidth

Maximum weighted independent set on graphs with treewidth k For node i in tree decomposition, S Í Xi write R(i, S) = maximum weight of independent set W of G(i) with W Ç Xi = S, – ¥ if such W does not exist We now see how to compute a table R(i,…) for all types of nodes Treewidth

G(i) is a graph with one vertex Leaf nodes Let i be a leaf node. Say Xi = {v}. R(i,{v}) = w(v) R(i, Æ ) = 0 v G(i) is a graph with one vertex Treewidth

Join nodes = + Let i be a join node with children j1, j2. R(i, S) = R(j1, S) + R(j2, S) – w(S). = + Treewidth

Introduce nodes Let i be a node with child j, with Xi = Xj È {v}. Let S Í Xj. R(i,S) = R(j,S). If v not adjacent to vertex in S: R(i,SÈ{v})=R(j,S) + w(v) If v adjacent to vertex in S: R(i,S È {v}) = – ¥. v Treewidth

Forget nodes Let i be a node with child j, with Xi = Xj - {v}. Let S Í Xi. R(i,S) = max (R(j,S), R(j,S È {v})) v v Treewidth

Maximum weighted independent set on graphs with treewidth k For node i in tree decomposition, S Í Xi write R(i, S) = maximum weight of independent set W of G(i) with W Ç Xi = S, – ¥ if such W does not exist Compute for each node i, a table with all values R(i, …). Each such table can be computed in O(2k) time when treewidth at most k. Gives O(n) algorithm when treewidth is (small) constant. Treewidth

Frequency assignment problem Given: Graph G=(V,E) Frequency set F(v) Í N for all v Î V Cost function c(e,r,s) , e = {v,w}, r a frequency of v, s a frequency of w Question Find a function g with For all v Î V: g(v) Î F(v) The total sum over all edges e={v,w} of c(e,g(v),g(w)) is as small as possible Work by Arie Koster et al. Treewidth

Frequency assignment when treewidth is small Suppose sets F(v) are small Suppose G has small treewidth Algorithm exploits tree decomposition What tables are we computing? Leaf: trivial Introduce: … Forget: projection Join: sum but subtract double terms Treewidth

General method Compute a tree decomposition Works for many problems E.g., with minimum degree heuristic Make it nice Use dynamic programming Works for many problems Courcelle: those that can be formulated in monadic second order logic Practical: TSP, frequency assignment, problems on planar graphs like dominating set, probabilistic inference Treewidth

A lemma Let ({Xi | i Î I},T) be a tree decomposition of G. Let Z be a clique in G. Then there is a j Î I with Z Í Xj. Proof: Take arbitrary root of T. For each v Î Z, look at highest node containing v. Look at such highpoint of maximum depth. Treewidth

The minimum degree heuristic A heuristic for treewidth Works often well The minimum degree heuristic If G has one vertex: take a tree decomposition with one bag. Otherwise Recursive step: Take vertex v of minimum degree Make neighbors of v a clique Remove v, and recurse on rest of G Add v with neighbors to tree decomposition In practice: iterative, not recursive N(v) N(v) v N(v) Treewidth

Other heuristics Minimum fill-in heuristic Similar to minimum degree heuristic, but takes vertex with smallest fill-in: Number of edges that must be added when the neighbours of v are made a clique Other choices of vertices, refining, using separators, … Treewidth

Representation as permutation A correspondence between tree decompositions and permutations of the vertices Repeat: remove superfluous leaf bag, or take vertex that appears in 1 leaf bag and no other bag Make neighbours of v = p(1) into a clique; recursively make tree decomposition of graph – v; add bag with v and neighbours Used in heuristics, and local search methods (e.g., taboo search, simulated annealing) and genetic algorithms There are important connections to Gauss elimination Treewidth

Connection to Gauss eliminating Consider Gauss elimination on a symmetric matrix For n by n matrix M, let GM be the graph with n vertices, and edge (i,j) if Mij ¹ 0 If we eliminate a row and corresponding column, effect on G is: Make neighbors of v a clique Remove v Treewidth

Application: Probabilistic networks Lauritzen-Spiegelhalter algorithm for inference on probabilistic networks (belief networks) uses a tree decomposition of the moralized form of the network Underlying several modern decision support networks Treewidth

Treewidth

Conclusions Dynamic programming for graphs with tree-like structure Works for a large collection of problems, as long as there is (and we can find) such a structure… Treewidth