Modular Decomposition and Interval Graphs recognition Speaker: Asaf Shapira.

Slides:



Advertisements
Similar presentations
Graph Algorithms Algorithm Design and Analysis Victor AdamchikCS Spring 2014 Lecture 11Feb 07, 2014Carnegie Mellon University.
Advertisements

Polygon Triangulation
Interval Graph Test.
WSPD Applications.
Walks, Paths and Circuits Walks, Paths and Circuits Sanjay Jain, Lecturer, School of Computing.
Bayesian Networks, Winter Yoav Haimovitch & Ariel Raviv 1.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
Comp 122, Spring 2004 Greedy Algorithms. greedy - 2 Lin / Devi Comp 122, Fall 2003 Overview  Like dynamic programming, used to solve optimization problems.
Greedy Algorithms Greed is good. (Some of the time)
Greed is good. (Some of the time)
Approximation, Chance and Networks Lecture Notes BISS 2005, Bertinoro March Alessandro Panconesi University La Sapienza of Rome.
1/44 A simple Test For the Consecutive Ones Property.
Approximating the Domatic Number Feige, Halldorsson, Kortsarz, Srinivasan ACM Symp. on Theory of Computing, pages , 2000.
Complexity ©D Moshkovitz 1 Approximation Algorithms Is Close Enough Good Enough?
GOLOMB RULERS AND GRACEFUL GRAPHS
Lectures on Network Flows
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Discussion #36 Spanning Trees
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Validating Streaming XML Documents Luc Segoufin & Victor Vianu Presented by Harel Paz.
Representing Graphs Wade Trappe. Lecture Overview Introduction Some Terminology –Paths Adjacency Matrix.
CSE 421 Algorithms Richard Anderson Lecture 4. What does it mean for an algorithm to be efficient?
Complexity 1 Mazes And Random Walks. Complexity 2 Can You Solve This Maze?
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 11 Instructor: Paul Beame.
K-Coloring k-coloring: A k-coloring of a graph G is a labeling f: V(G)  S, where |S|=k. The labels are colors; the vertices of one color form a color.
The Art Gallery Problem
Review of Graphs A graph is composed of edges E and vertices V that link the nodes together. A graph G is often denoted G=(V,E) where V is the set of vertices.
Graph Algorithms Using Depth First Search Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms.
Circle Graph and Circular Arc Graph Recognition. 2/41 Outlines Circle Graph Recognition Circular-Arc Graph Recognition.
Minimal Spanning Trees What is a minimal spanning tree (MST) and how to find one.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
Fixed Parameter Complexity Algorithms and Networks.
1 Treewidth, partial k-tree and chordal graphs Delpensum INF 334 Institutt fo informatikk Pinar Heggernes Speaker:
“On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Sets.
Lecture 22 More NPC problems
Approximating the Minimum Degree Spanning Tree to within One from the Optimal Degree R 陳建霖 R 宋彥朋 B 楊鈞羽 R 郭慶徵 R
UNC Chapel Hill Lin/Foskey/Manocha Minimum Spanning Trees Problem: Connect a set of nodes by a network of minimal total length Some applications: –Communication.
Minimum Spanning Trees and Kruskal’s Algorithm CLRS 23.
A Clustering Algorithm based on Graph Connectivity Balakrishna Thiagarajan Computer Science and Engineering State University of New York at Buffalo.
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
5.2 Trees  A tree is a connected graph without any cycles.
Lecture X Disjoint Set Operations
Union-find Algorithm Presented by Michael Cassarino.
1 22c:31 Algorithms Minimum-cost Spanning Tree (MST)
CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 5.
Graph Connectivity This discussion concerns connected components of a graph. Previously, we discussed depth-first search (DFS) as a means of determining.
Great Theoretical Ideas in Computer Science for Some.
Interval Graph Test Wen-Lian Hsu.
Algorithms for hard problems Parameterized complexity Bounded tree width approaches Juris Viksna, 2015.
Network Partition –Finding modules of the network. Graph Clustering –Partition graphs according to the connectivity. –Nodes within a cluster is highly.
CSE 421 Algorithms Richard Anderson Autumn 2015 Lecture 5.
1/44 A simple Test For the Consecutive Ones Property Without PC-trees!
Trees By JJ Shepherd. Introduction Last time we discussed searching and sorting in a more efficient way Divide and Conquer – Binary Search – Merge Sort.
Breadth-First Search (BFS)
Main algorithm with recursion: We’ll have a function DFS that initializes, and then calls DFS-Visit, which is a recursive function and does the depth first.
MA/CSSE 473 Day 36 Student Questions More on Minimal Spanning Trees
Lectures on Network Flows
Graph Algorithms Using Depth First Search
Planarity Testing.
The Art Gallery Problem
The Art Gallery Problem
Lectures on Graph Algorithms: searching, testing and sorting
Richard Anderson Autumn 2016 Lecture 5
Winter 2019 Lecture 11 Minimum Spanning Trees (Part II)
Richard Anderson Winter 2019 Lecture 5
Minimum Spanning Trees
Autumn 2019 Lecture 11 Minimum Spanning Trees (Part II)
Presentation transcript:

Modular Decomposition and Interval Graphs recognition Speaker: Asaf Shapira

We will discuss: Modular Decomposition of graphs. Chordal graphs and Interval graphs. Modular Decomposition of Chordal graphs. Identifying Interval graphs in linear time.

Modular Decomposition: Overview Notations: 1. All the graphs are simple undirected graph. 2. We assume the graphs are connected. 3. Given a subset of vertices, X, we denote by G[X] the induced sub-graph on X. 4. We denote by N(v), the set of neighbors of v, and by N[v], N(v)  v (the neighborhood and closed-neighborhood of v). 5. We write n for |V|, and m for |E|.

Modular Decomposition: Overview What is a module? A module in G, is a set of vertices, X, such that for every vertex, v, not in X, either v is adjacent to every vertex in X, or v is not adjacent to any vertex in X. Notice that all the singleton sets of one vertex, and the set V, are clearly modules. We call them trivial modules. G is prime iff it contains only trivial modules. b d a f c d

Modular Decomposition: Overview cont. Some trivial facts about modules: Claim : If X is a module in G, and Y is a subset of X, then Y is a module of G iff it is a module of G[X]. Claim : If X and Y are overlapping modules, then X \ Y,Y \ X, X  Y, X  Y and X  Y, are also modules. Claim : If X and Y are disjoint modules, then either every member of X is adjacent to every member of Y, or no member of X is adjacent to any member of Y.

Modular Decomposition: Overview What is a modular decomposition? A modular decomposition, is the process of substituting a module of the graph with a marker vertex, and then recursively, finding all the modules in the resulting graph, and in the induced sub graph on the module. b d a f c d

Modular Decomposition: Overview cont. Some trivial facts about modules: A graph may contain an exponential number of modules (consider a clique) thus we can not expect to represent all the modules explicitly. We thus seek to find an efficient implicit representation of the modules. We create a Decomposition Tree, where each internal node, v, represents a module, Xv, and the children of v, represent the modules of G[Xv]. We have V(G) as the root of the tree. We now turn to a formal definition of the Decomposition Tree.

Modular Decomposition: Overview cont. MD(G) (Definition of the modular decomposition of G) If G has one vertex, v, then return v. Let r be a new internal node in the modular decomposition tree. If G is disconnected, then for each connected component, C, make MD(C), a child of r. Finally mark r as degenerate. Else if the complement of G is disconnected, then for every connected component of the complement, C, make MD(C), the child of r. Finally mark r as degenerate. Else for every highest module X, make MD(G[X]) a child of r. Finally mark r as non-degenerate.

Modular Decomposition: Overview cont. Claim : If G and its complement are both connected, then the highest modules, induce a partition of the vertices of G, hence the decomposition tree is well defined and unique. Proof : Assume there are two overlapping highest modules, A, B. Note that: Clearly A and B must cover the vertices of G. As A and B are modules, A must be adjacent to all or none of the vertices in V \ A, thus A is disconnected from V \ A, either in G or in its complement. Let’s see the MD-tree of an n-clique, an n-cycle and an n-Star.

m f l n q p g f d e c b a v i j k

Modular Decomposition: Overview cont. Clearly all the nodes of the tree are modules of G. It can be shown that the union of a set of children of a degenerate node, is also a module of G, and that any module of G that is not a node in the tree, is the union of some children of a degenerate node. We thus have an implicit representation of the modules of G. Notice that keeping in each internal node, the vertices it consists, may require  (n 2 ) space. An alternative solution is to keep in each node, a pointer to a list of its children. This solution requires O(1) memory per node, thus O(n) memory for the entire tree, which is optimal. This solution still enables us to list the vertices of a module X, in optimal O(|X|) time, by enumerating the leafs of its sub tree.

Modular Decomposition: Overview cont. A “wild” algorithm for Modular Decomposition: 1. Create a trivial module X={v}, from an arbitrary vertex v. 2. Add vertices to X, while it is still a module. 3. Replace X, by a marker vertex. 4. Continue recursively, on G[X] and G \ X. Stages (1) and (2) take O( n 3 ), thus we get: T(n) = T(|X|)+T(n-|X|)+O( n 3 ) = O( n 4 )

Modular Decomposition: Overview cont. Current solutions to the problem: 1. There are some rather complicated O(n+m) algorithms for modular decomposition on general graphs. 2. We now turn to describe a simple O(n+m) algorithm, for performing modular decomposition on chordal graphs.

Chordal Graphs: Introduction What is a chordal graph? A graph G=(V,E) is a chordal graph, if it contains no induced chordaless cycle, of size more than 3, that is, if it has no hole of size more than 3.

MD on chordal graphs: Strategy We will identify the modules in three steps: Identify modules that form a clique. Identify modules that form a connected component. Identify modules that form an independent set. We will perform each step in O(n+m), and thus get a linear time algorithm, for modular decomposition on chordal graphs.

Clique modules Finding clique modules: 1. Create an initial set of all the vertices of G. 2. For every vertex v: Partition each list, into neighbors and non-neighbors of v. (assume there is a self edge from v to itself). If we have a set with more than one vertex, it is a clique module. After this stage, we replace each module by a marker vertex.

Connected modules Finding connected modules : We will first perform a linear arrangement of the vertices of G: 1.Sort the vertices of G by their degree (in descending order) 2. Create a list L, of sets with V as the only set in L. 3. For i = 1 to n do v = first element of first set in L remove v  (i) = v split and replace each L j, into L j  N(v), L j \ N(v) put L j  N(v) before L j \ N(v)

abc de fgh L = {d, e, g, b, h, f, a, c}  = d L = {e, g, b, h, f, a} {c}  = d e L = {g, b, h, f} {a} {c}  = d e g L = {h, f} {b} {f} {a} {c}  = d e g h L = {f} {b} {a} {c}  = d e g h f b a c

Linear arrangement Some claims on linear arrangements. Claim : For each module, S, in a chordal graph, either S or N(S) is a clique. Proof : Assume there are two vertices, a and b, in S, that are not connected, and two vertices, c and d, in N(S), that are not connected, then G[{a,b,c,d}] is a cycle of size 4, contradicting the fact that G is chordal. Claim : Let  be a linear arrangement. If N[u]  N[v] then  -1 (u) >  -1 (v). Proof : As |N(v)|>|N(u)|, v is initially put before u. As N[u]  N[v] no vertex can pull u before v, thus v will always stay before u.

Linear arrangement Claim : Let S be a connected module, in a chordal graph with no “clique module”. If  is a linear arrangement on G then: 1.  -1 (u) >  -1 (v),  v  N(S) and u  S. That is all the neighbors of S, are ordered before S. 2. All vertices in S are ordered consecutively. Proof : (1) S is not a clique, thus N(S) is a clique. If v  N(S) and u  S, then N[u]  S  N(s)  N[v]. As N[v]  N[u] (otherwise they form a clique module), we get that N[u]  N[v], thus  -1 (u)>  -1 (v). S v u

Linear arrangement (2) Assume there are x,z  S, and y  S, such that,  -1 (x)  -1 (z’), a contradiction.

Connected modules We maintain a stack of stacks, where for each stack we keep its size, its common neighborhood, and the smallest index on which the vertices disagree. Each stack is a candidate for module. We must enforce two conditions: 1. No vertex in a stack is connected to a vertex in a lower stack (why?) 2. All the vertices in a stack must have the same neighbors outside the stack.

 : d e g h f b a c abc de fgh Connected modules c c c a bbaba c b a c f b a c h f b a c b a c g h f b a c g h f b a c t t b a c t b a c e e t b a c a

Connected modules Complexity of finding connected modules: Ignoring the subroutines, the main loop takes O(n). Each call to CreateStack(v), takes O(|N(v)|), and a total of O(m). The cost of MergeTopStacks is proportional to their neighborhoods (under what assumption?). Any common neighborhood is not larger than any vertex in the stack. Charge the cost of a MergeTopStacks, to the highest vertex at the lower stack, and the lowest vertex in the higher stack. These vertices will never be the the lowest in upper stack, or highest in lower stack, thus they will never be charged more than twice. All MergeTopStacks take O(n+m), and so does the entire stage.

Independent modules After finding all the modules that form a clique, or a connected component, we are left with modules that must be independent sets. Finding modules that are independent sets is similar to finding modules that form a clique, and can be done in O(n+m). The difference is that now, we don’t put an edge from each vertex to itself.

MD on chordal graphs: Creating the Tree How to create the decomposition tree? 1. For each clique module S, put a node in the tree, that has all the members of S, as its children. 2. The same for independent modules. 3. The same for connected modules. 3. For connected modules, first find independent modules in the module. Group each independent module to a new node in the tree under S.

Interval Graphs: Introduction What is an interval graph? An undirected graph, G=(V,E), is an interval graph, if there is a set, F, of n=|V| closed intervals on the real line, F = {I 1,…..,I n } (the interval I i represents the vertex v i ), such that (v i, v j ) is an edge in G, iff the intervals I i and I j intersect. Let’s see an interval graph, and its interval representation….

Interval Graphs: Introduction cont. An interval graph: And its interval representation: b a c d e f b d a e f c

Interval Graphs: Introduction cont. Claim : An interval graph is also a chordal graph. Proof : Assume G is an interval graph, yet it contains a chordalles cycle (v 1, v 2, v 3,…, v k, v 1 ) for k>3. We show that there is no interval representation for the vertices v 1,…,v k, and thus conclude that there is no interval representation of G.

Identifying interval graphs We describe how to check if a prime graph is an interval graph in O(n+m). Together with the O(n+m) algorithm for modular decomposition on chordal graphs, we will get an O(n+m) algorithm for identifying interval graphs. We will use the following claim: Lemma : Given a chordal graph G=(V,E), one can create in O(n+m), a tree, T, such that the nodes of T, are the maximal cliques of G, and for every vertex, v in G, the nodes representing the maximal cliques containing v, create a connected component in T. Let’s see an interval graph, and its clique tree…

Identifying prime interval graphs C1C1 a C2C2 C3C3 C4C4 bg h i e d f c C5C5 C6C6 C1C1 C2C2 C3C3 C4C4 C5C5 C6C6 abab h e a acac hihi eheh abab aegaeg acdacd acefacef The interval model of a graph The tree of maximal cliques

Identifying prime interval graphs C1C1 a C2C2 C3C3 C4C4 bg h i e d f c C5C5 C6C6 We will also use the following lemma: Lemma : A graph G, is a prime interval graph iff, its maximal cliques can be uniquely ordered, such that for every vertex v, the maximal cliques containing v, occur consecutively.

Identifying prime interval graphs Refining a partition: Let A and B, be two sets of maximal cliques, where A is left of B, in a linear maximal clique arrangement. Suppose v is shared by two cliques C a from A, and C b from B. If X, is a set of maximal cliques at the right of A, all cliques in X containing v, must be at the left of those not containing v. AB C1C1 CaCa CbCb X1X1 v C5C5 X2X2 X

Identifying prime interval graphs The main idea is the following: Start from an initial legal partition of the set of maximal cliques. Apply the refinement rule repeatedly, until you are left with sets of size 1. The resulting arrangement should be the unique maximal cliques arrangement. The following initial partition is legal: Let  be linear arrangement of the vertices of G. Partition the set of maximal cliques to those that contain the last vertex in the partition, and those that do not.

Identifying prime interval graphs Putting it together: Find the maximal cliques arrangement. Create an interval representation from the clique arrangement. Verify that the interval representation indeed represents G. Corollary: We can identify prime interval graphs in linear time.

Identifying interval graphs Putting it together: Run the modular decomposition algorithm on G. For each module, S, verify that S is an interval graph. As for each module S, either S or N(S) is a clique, we can always replace the interval of the marker vertex v s, with the interval representation of S. If all the modules (including the last prime graph, representing G) are prime, then G is also prime. Corollary: We can identify interval graphs in linear time.

e non-degenerate v c d q h l m p ki j b fg n a degenerate