algorithmic aspects of modular decomposition cours mpri ... › ~habib › documents ›...
TRANSCRIPT
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Algorithmic aspects of modular decompositionCours MPRI 2009–2010
Michel Habib [email protected]://www.liafa.jussieu.fr/~habib
Chateau des rentiers, octobre 2009
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Modules
Modules
For a graph G = (V ,E ), a module is a subet of vertices A ⊆ Vsuch that∀x , y ∈ A, N(x) − A = N(y)− A
Trivial Modules
∅, {x} and V are modules.
Prime Graphs
A graph is prime if it admits only trivial modules.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Examples
Characterisation of Modules
A subset of vertices M of a graph G = (V ,E ) is a module iff∀x ∈ V \M, either M ⊆ N(x) or M ∩ N(x) = ∅
1
6
7
4
2
3
Examples of modules
◮ connected components of G
◮ connected components of G
◮ any vertex subset of thecomplete graph (or the stable)
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Playing with the definition
Duality
A is a module of G implies A is a module of G .
Easy observations
◮ No prime graph with ≤ 3 vertices.
◮ P4 the path with 4 vertices is the only prime on 4 vertices.
◮ P4 is isomorphic to its complement.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Twins and strong modules
Twins
x , y ∈ V are false- (resp. true-) twins if N(x) = N(y) (resp.N(x) ∪ {x} = N(y) ∪ {y}.x , y are false twins in G iff x , y are true twins in G .
Strong modules
A strong module is a module that does not strictly overlap anyother module.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Modular partition
A partition P of the vertex set of a graph G = (V ,E ) is amodular partition of G if any part is a module of G .
1
6
7
8
9
10
11
4
2
3
5
Let P be a modular partition of a graph G = (V ,E ). Thequotient graph G/P is the induced subgraph obtained by choosingone vertex per part of P.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Lemma (MR84)
Let P be a modular partition of G = (V ,E ).X ⊆ P is a module of G/P iff ∪M∈XM is a module of G .
1
6
7
8
9
10
11
4
2
3
5
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Uniqueness decomposition theorem
Modular Decomposition Theorem
Theorem (Gal’67)
Let G = (V ,E ) be a graph with |V | ≥ 4, the three following casesare mutually exclusive :
1. G is not connected,
2. G is not connected,
3. G/M(G) is a prime graph, withM(G ) the modular partitioncontaining the maximal strong modules of G .
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Uniqueness decomposition theorem
As a byproduct, we notice that a prime graph G satisfies :G and G are connected
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Uniqueness decomposition theorem
Modular decomposition tree
Tree
A recursive a this theorem yields a tree T in which :
◮ The root corresponds to V
◮ Leaves are associated to vertices
◮ Each node corresponds to a strong module
There are 3 types of nodes :
Parallel, Series and Prime
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Uniqueness decomposition theorem
Another explanation
The set of strong modules is nested into an inclusion tree (calledthe modular decomposition tree MD(G ) of G ).
1 2 3 4 5 6 7 8 9 10 11�� �� ��������������������������������������
1
2
3
4
5
6
7
8
9
10
11
1 9852 43 6 7 1110
8 9 10 11
2 3
2 3 4
6 7 10 11
����
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Partitive Families
Partitive Families
Lemma
If M and M ′ are two overlapping modules then
◮ (i) M \M ′is a module
◮ (ii) M ∩M ′ is a module
◮ (iii) M ∪M ′ is a module
◮ (iv) M∆M ′ is a module
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Partitive Families
CHM81
The set of all modules of an undirected graph (resp. a directedgraph)constitutes a partitive family (resp. a weak partitive family).
Uniqueness decomposition theorem
Partitive (resp. weakly partitive) families admit a decompositiontree with two (resp. three) types of nodes :
◮ degenerate (also called fragile)
◮ prime
◮ (resp. linear)
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Partitive Families
This tree representation theorem for partitive (resp. weaklypartitive) families F ⊆ 2|X |, yields an encoding of these families inO(|X |).
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Partitive Families
Modular Decomposition Theorem for Directed Graphs
Theorem (CHM81)
Let G = (V ,E ) be a directed graph with |V | ≥ 4, the fourfollowing cases are mutually exclusive :
1. G is not connected, Parallel node
2. G is not connected, Series node
3. G ∗ is not strongly connected, Linear node
4. G/M(G) is a prime graph, withM(G ) the modular partitioncontaining the maximal strong modules of G , Prime node
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Structural Aspects of Prime graphs
Prime graphs are nested
Folklore Theorem
Let G be a prime graph (|G | ≥ 4), then G contains a P4.
Theorem Schmerl, Trotter, Ille 91 . . .
Let G be a prime graph (|G | = n ≥ 4), then G contains a primegraph on n − 1 vertices or a prime graph on n − 2 vertices.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Structural Aspects of Prime graphs
A simple proof
A stronger statement A. Cournier, P. Ille, 1991
For a prime graph there is at most one vertex not contained in aP4.
Proof
If ∃x ∈ V that does not belong to a P4 then N(x) is a stable set.If ∃x 6= y ∈ V that does not belong to a P4,wlog assume xy /∈ E (else we consider G )But then y ∈ N(x) and therefore : N(y) ⊆ N(x).By symmetry x , y must be twins, a contradiction.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Structural Aspects of Prime graphs
The previous result need no hypothesis on the cardinality of thegraphsuch as the given proof.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Basic Definitions on Modules
Structural Aspects of Prime graphs
In fact if there is such a vertex x ∈ V ,x is adjacent to the middle vertices of a P4.(Such a subgraph is called a bull).
A bull is isomorphic to its complement.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Historical Notes
Historical notesThe big list of published algorithms for modular decomposition(N.B. Perhaps some items are missing . . . please give me themissing references)
◮ Cowan, James, Stanton 1972 O(n4)◮ Maurer 1977 O(n4) directed graphs◮ Blass 1978 O(n3)◮ Habib, Maurer 1979 O(n3)◮ Habib 1981 O(n3) directed graphs◮ Corneil, Perl, Stewart 1981, O(n + m) cograph recognition.◮ Cunningham 1982 O(n3) directed graphs◮ Buer, Mohring 1983 O(n3)◮ McConnell 1987 O(n3)◮ McConnell, Spinrad 1989 O(n2) incremental◮ Adhar, Peng 1990 O(log2n),O(nm) proc. parallel, cographs,
CRCW-PRAM
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Historical Notes
◮ Lin, Olariu 1991 O(logn),O(nm) proc. parallel, cographs,EREW-PRAM
◮ Spinrad 1992 O(n + malpha(m, n))◮ Cournier, Habib 1993 O(n + malpha(m, n))◮ Ehrenfeucht, Gabow, McConnell, Spinrad 1994 O(n3)
2-structures◮ Ehrenfeucht, Harju, Rozenberg 1994 O(n2) 2-structures,
incremental◮ McConnell, Spinrad 1994 O(n + m)◮ Cournier, Habib 1994 O(n + m)◮ Bonizzoni, Della Vedova 1995 O(n3k−5) Committee
decomposition for hypergraphs◮ Dahlhaus 1995 O(log2n),O(n + m) proc. parallel, cographs,
CRCW-PRAM◮ Dahlhaus 1995 O(log2n),O(n + m) proc. parallel,
CRCW-PRAM
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Historical Notes
◮ Habib, Huchard, Sprinrad 1995 O(n + m) inheritance graphs◮ McConnell 1995 O(n2) 2-structures, incremental◮ Capelle, Habib 1997 O(n + m) if a factoring permutation is
given◮ Dahlhaus, Gustedt, McConnell 1997 O(n + m)◮ Dahlhaus, Gustedt, McConnell 1999 O(n + m) directed graphs◮ Habib, Paul, Viennot 1999 O(n + mlogn) via a factoring
permutation◮ McConnell, Spinrad 2000 O(n + mlogn)◮ Habib, Paul 2001 O(n + m) cographs via a factoring
permutation◮ Capelle, Habib, Montgolfier 2002 O(n + m) directed graphs if
a factoring permutation is provided.◮ Shamir, Sharan 2003 O(n + m) cographs, fully-dynamic◮ McConnell, Montgolfier 2003 O(n + m) directed graphs◮ Habib, Montgolfier, Paul 2003 O(n + m) computes a factoring
permutation
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Historical Notes
◮ McConnell, de Montgolfier 2003 O(n + m) Interval graphsand dimension k orders
◮ Brestcher, Corneil, Habib, Paul, 2006 O(n + m) Cographs viaLexBFS.
◮ . . .
◮ But also, Uno, Yagura, 2000 O(n) to decompose permutationgraphs when a layout is provided.
◮ Bergeron, Chauve, de Montgolfier, Raffinot 2006
◮ A simple linear time algorithm for modular decomposition . . .M. Tedder, D. Corneil, M. Habib, C. Paul presented at ICALP2008
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Historical Notes
Why it is so important ?
[Jerry Spinrad’ book 03]
The new [linear time] algorithm [MS99] is currently too complex todescribe easily [...] The first O(n2) partitioning algorithms weresimilarly complex ; I hope and believe that in a number of years thelinear algorithm can be simplified as well.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Historical Notes
Applications of modular decomposition
◮ A very natural operation to define on discrete structures,searching regularities.
◮ A structure theory for comparability graphs
◮ A compact encoding using module contraction and if we keepat each prime node the structure of the prime graph.
◮ Divide and conquer paradigm can be applied to solveoptimization problems. For example to test isomorphism.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Historical Notes
◮ A very basic graph algorithmic problem (similar to graphisomorphism problem).
◮ A better understanding of graph algorithms and their datastructures.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Bottom up Techniques
Minimal Modules
Minimal module containing a set
For every A ⊆ V there exists a unique minimal module containingA
Proof :
Since the module family is partitive and therefore closed under ∩.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Bottom up Techniques
Splitters
Definition
A splitter for a A ⊆ V , is a vertex z /∈ As.t. ∃x , y ∈ A with zx ∈ E and zy /∈ E .
Modules
A ⊆ V is a module iff A does not have any splitter.
Usefull lemma
If z is a splitter for a A ⊆ V , then any module containing A mustalso contain z .
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Bottom up Techniques
Submodularity
Let us denote by s(A) the number of splitters of a set A, then s isa submodular function.
Definition
A function is submodular if∀A,B ⊆ Ef (A ∪ B) + f (A ∩ B) ≤ f (A) + f (B)
This is the basis idea of Uno and Yagura’s algorithm for themodular decomposition of permutation graphs in O(n).
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Bottom up Techniques
Bottom-up Techniques
Sketch of the algorithm
For each pair of vertices x , y ∈ VCompute the minimal module m(x , y) containing x and y .
Closure with splitters
While there exists a splitter add it to the set.
Complexity
O(n2.(n + m))
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Bottom up Techniques
Primality testing
One can derive a primality test since if there exists a non trivialmodule, it contains at least two vertices.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Bottom up Techniques
For some problems Bottom-Up techniques are the best known.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Bottom up Techniques
Origins : Golumbic, Kaplan, Shamir 1995
Input : G1 = (V ,E1) and G2 = (V ,E2) 2 undirected graphs suchthat E1 ⊆ E2 and Π be a graph property.Results : a sandwich graph Gs = (V ,Es) satisfying property Π andsuch that E1 ⊆ Es ⊆ E2.Edges of E1 are forced, those of E2 are optional ones, but those ofE3 = E2 are forbidden.
Unfortunately most cases are NP-complete, as for example of Π
◮ Gs being comparability, chordal, strongly chordal, . . .
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Bottom up Techniques
Only few polynomial cases
◮ cographs Golumbic, Kaplan, Shamir (1995)
◮ sandwich module Cerioli, Everett, de Figueiredo, Klein (1998). . .
Natural question
Find efficient algorithms for these polynomial cases.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Bottom up Techniques
Sandwich module problem
Input : G1 = (V ,E1) and G2 = (V ,E2) 2 undirected graphs suchthat E1 ⊆ E2.Result : a sandwich graph Gs = (V ,Es) having a non trivialmodule and such that E1 ⊆ Es ⊆ E2.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Bottom up Techniques
Minimal Sandwich Module
Splitter
For a subset A ⊆ V , a splitter is a vertex z /∈ As.t. ∃x , y ∈ A with zx ∈ E1 and zy /∈ E2 (or equivalently zy ∈ E3)A splitter is also called bias vertex.
Algorithm
The computation of a minimal sandwich module can be done inO(n2.(n + m1 + m3)).
Hard to do better with this idea, using a bottom up approach.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Top down techniques
An O(n + mlogn) algorithm
Input: A partition P of the vertex set V of a graph G
Output: The coarsest modular partition Q smaller than P
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Top down techniques
begin
Let Z be the largest part of P ;Q ← P ; K ← {Z} ; L← {X | X 6= Z,X ∈ P};while L ∪ K 6= ∅ do
if there exists X ∈ L then S ← X and L← L \ {X};else
1 Let X be the first part K and x arbitrarily selected in X ;S ← {x} and K ← K \ {X};
foreach vertex x ∈ S do
foreach part Y 6= X such that N(x) ⊥ Y do
2 Replace in Q, Y by Y1 = Y ∩ N(x) and Y2 = Y \ N(x);Let Ymin (resp. Ymax) be the smallest part (resp. largest)among Y1 and Y2;if Y ∈ L then L← L ∪ {Ymin,Ymax} \ {Y};else
L← L ∪ {Ymin};if Y ∈ K then Replace Y by Ymax in K ;else Add Ymax at the end of K ;
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Factoring Permutation
Factoring Permutation
A factoring permutation of a graph G = (V ,E ) is a permutationof V in which any strong module of G is a factor. [CH 97]
3
2 3 4 5 6 7 8 9 10 11
1
5
6
7
8
9
10
11
4
2
1
1
5
6
8
9
4
2
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Factoring Permutation
◮ From modular decomposition tree to factoring permutation.Just take a left-right ordering of the leaves of the tree.
◮ From a factoring permutation to the modular decompositiontree.Only O(n2) possible strong modules.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Factoring Permutation
Splitter interpretation
Starting with the partition {N(x), {x},N(x)}, we maintain thefollowing invariant :It exists a factoring permutation smaller than the current partition.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Factoring Permutation
Generic Refinement Algorithm
Input : P a partition and S a set of pivotsWhile S 6= ∅Choose S ∈ SP = Refine(S ,P)add all new generated parts to S
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Factoring Permutation
This technique is very powerfull not only for graph algorithms.First used by Corneil for Isomorphism Algorithms 1970Hopcroft Automata minimisation 1971Cardon and Crochemore string sorting 1981J. Spinrad Graph Partitionning (generic tool) 1986Paigue, Tarjan 1987 (generic tool presented on three problems). . .
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Factoring Permutation
Applications
◮ QUICKSORT
◮ Minimal deterministic automaton Hopcroft O(nlogn) 1971.O(n) ?
◮ Relational coarset partition Paige, Tarjan O(nlogn) 1987
◮ Coarsest functional partition Paigue, Tarjan O(nlogn) 1987improved to O(n) by Paigue, Tarjan, Bonic 1985 andChrochemore 1982.
◮ String sorting O(nlogn)
◮ Doubly Lexicographic ordering Paige Tarjan 1987 O(LlogL),where L = #ones in the matrix using a 2-dimensionalrefinement technique. O(L) ?
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Factoring Permutation
Many other applications on graphs
◮ Interval graph recognition O(n + m) using parttion refinementon maximal cliques, 1-consecutiveness property O(n + m),Habib, McConnell, Paul and Viennot 2000.
◮ Modular decomposition,
◮ Cograph recognition O(n + m), Habib, Paul 2000.
◮ Transitive orientation
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Factoring Permutation
Partition refinement techniques are kind of dual to Union-Finddata structures.
◮ x and y belong to the same part → Union-Find
◮ x and y cannot belong to the same part → Partitionrefinement
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Factoring Permutation
Vertex splitting
Also called vertex partitionningUse N(x) as a pivot set.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Factoring Permutation
A linear algorithm ?
We have seen a simple algorithms in O(n + mlogn) in which theneighbourhood of a given vertex can be used to refine the partitionat most logn times.How to improve this to a constant number ?
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Factoring Permutation
Three explored directions
◮ Ehrenfeucht et al approach
◮ Using Factoring Permutation
◮ Using LexBFS (as for cographs)
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Ehrenfeucht et al approach
Ehrenfeucht et al approach
M(G , v) is composed by {v} and the maximal modules of G notcontaining v .
����
series
v v
parallel
prime
series
series
parallel
series
������������
����
�������� ����
���� ����
���� ����
���� ����
��������
����
����
������������ ����
���� ���� ����
Principle of the Ehrenfeucht et al.’s algorithm
1. Compute M(G , v)
2. Compute MD(G/M(G ,v))
3. For each X ∈M(G , v) compute MD(G [X ])
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Ehrenfeucht et al approach
ComputingM(G , v) via Partition Refinement
Splitter again
If z is a splitter of A ⊆ V then any strong module contained in Ais either contained in N(z) ∩ A or in A− N(z).
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Ehrenfeucht et al approach
Computation ofM(G , v)
⇒ O(n + m log n) time using vertex partitioning algorihtm.
v
N(v) N(v)
xv
yv x
zv
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Ehrenfeucht et al approach
How to reconstruct the modular decomposition tree from thepartiton M(G , v) ?The most difficult step in many algorithms.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Ehrenfeucht et al approach
Computation of MD(G/M(G ,v))
◮ The modules of G/M(G ,v) are linearly nested :any non-trivial module contains v
◮ The forcing graph F(G , v) has edge −→xy iff y separates x and v
6
1
2
3 4 5
v
3 4 5
6
3
6
45
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Modular Decomposition Algorithms
Ehrenfeucht et al approach
Complexity
◮ [Ehrenfeucht et al.’94] gives a O(n2) complexity.
◮ [MS00] gives a very simple O(n + m log n) algorithm based onvertex partitioning.
◮ [DGM’01] proposes a O(n + m.α(n,m)) and a morecomplicated O(n + m) implementation.
Other algorithms
◮ [CH94] and [MS94] present the first linear algorithms.
◮ [MS99] present a new linear time algorithm which extends totransitive orientation.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
Cographs
Recursive Definition
The class of cographs is the smallest class of graphs containing G0
and closed under series and parallel compositions.
Characterisation Theorem
A graph is a cograph iff it does not contain a P4.
Obvious
With the structure of prime graphs.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An example
e
Parallèle
Série Série Série Série
b
c
d
u
v
a
z
yx
w Parallèle Parallèle
Série
Parallèle
d wy u
e
z
ax
v
c b
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
Comments
◮ In other words, the modular decomposition tree of a cographhas only series and parallel nodes.
◮ Despite its structural simplicity it is not so obvious to build alinear time algorithm to recognize cographs.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
Brute Force Algorithm
Using the decomposition theorem, we only have to compute atmost n times some connected components of G or its complement.O(n.(n + m)) complexity.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
Cotree
Definition
The modular decomposition tree of a cograph is called a cotree.
Properties of the cotree
◮ Vertices of the cotree can be labelled with 0 (parallel) and 1(series).
◮ From G to G just exchange 0’s and 1’s.
◮ xy ∈ E iff LCA(x , y) in the cotree is labelled with 1
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
A simplicial scheme for cographs
G is a cograph iff it exists an ordering of the verticess.t. xi has a twin (false or true) in G{xi+1, . . . xn}
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
3 approaches for a linear time algorithm
1. Corneil, Perl, Stewart 1981, O(n + m) cograph recognition.Incremental : add a vertex x at each step and update the treein O(d(x)).
2. Habib, Paul 2001 : Using partition refinement and a factoringpermutation
3. Brestcher, Corneil, Habib, Paul, 2006 , using 2 consecutiveLexBFS searches
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on factoring permutation
Factoring permutation (of cographs) via vertex partitionning
At each step, the partition can be refined into a factoringpermutation.
���������������������� ���� v
series
parallel
parallel
parallel
parallel
parallel
series
seriesseriesseries
����
series
���� ������������������������
parallel
parallel
����
series
���������������������������������������������� ����
������������������������������������������ ����
������ ������������������������������������ ����
������ ������������������������������������ ����
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on factoring permutation
1. Best known complexity : O(n + m log n) and O(n + m) forcographs
2. Recent algorithmic results around this notion [UY00][BXHP05] [BCdMR05]
3. For some graph families, computing MD(G ) from a factoringpermutation costs O(n) time
4. Generalization for other decomposition like for example thesplit decomposition ?...
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
The best Algorithm Using LexBFS
A cograph recognition algorithm [BCHP03]
1. σ ← LexBFS(G )
2. σ ← LexBFS−(G , σ)
3. If σ and σ both have the NS-property then
3.1 Answer ”G is a cograph”3.2 Build MD(G)
4. Else Output a P4
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
1
0
1 11
0
1
0
0e
wy
b
u v
ec
d
x a
a
z
x
z d
u
v
y
wc b
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Computing a LexBFS ordering σ
ex y w z u v a d c b
e
a
z
x
u
v
y
w
b
d
c
e
x y w z u v a d c b e
x y w z u v a d c b
e
b
c
d
a
v
u
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Computing σ=LexBFS−(G , σ)
vx
x y w z u v a d c b e
a d c b e y w z u
e
y
w
b
c
d
a
z
x
v
u
v
u v a d c b e
a d c b e
a d c b e
y w z u v
y w z u
x
x
x y w z
e
b
c
d
a
v
u
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
w
1
0
1 11
0
1
0
0
x y w z u v a d bc e
x a d e c b z y u v
e
w
b
c
d
a
z
x
wy
y
u v
e
x a
v
u
z d
c b
Lemma
M(G , x) is composed by the slices Si(x) of σ and Sj(x) of σ.
Theorem
If G is a cograph, then MD(G ) can be retrieved from the slicestructure of σ and σ.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Data: a module M of G ;
Result: the cotree of G (M)
if M = {s} then T (M,G )← sTake a vertex s ∈ M and compute :LexBFS(s,G ) = [s,N(s),S1(s), . . . ,Sk(s)]LexBFS(s,G ) = [s,N(s),S1(s), . . . Sh(s)]if N(s) = ∅ (resp. N(s) = ∅ ) ; then
T (M,G )← s⊕
T (S1(s),G )(resp. T (M,G )← s
⊗T (S1(s),G ))
Else Let us consider two vertices : a ∈ S1(s) et b ∈ S1(s)if ab ∈ E then
T (M,G ) ← s⊕
T (S1(s),G )⊗
T (S1(s),G )⊕
T (S2(s),G ). . .
Else T (M,G )← s⊗
T (S1(s),G )⊕
T (S1(s),G )⊗
T (S2(s),G ) . . .
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Elements de preuve de l’algorithme
1. Soit S une couche lexicographique de LexBFS σ sur G , alorsla restriction de σ a S est un LexBFS de G (S).
2. Il n’existe pas d’arete entre les Si(x). Les sommets d’un Si(x)ont donc les memes voisins a l’exterieur, et les Si(x) sontdonc des modules de G .
3. Les Si (resp. Si) sont des modules maximaux de G − x .
4. Les Si verifient une condition d’inclusion des voisinages quijustifie les formules de la fonction T .
5. Le deuxieme parcours en − permet d’assurer la recursivite. Eneffet Si(x) est un module facteur de σ, d’apres le lemme celapermet de garantir que les parcours de G et G vontcommencer par le meme sommet de Si(x).
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Preprocessing
Data: a graph G ;
Result: A pair of LexBFS
Take x a vertex in G and computeσ = LexBFS(x ,G ) and σ− = LexBFS−(x ,G )and for each vertex of x of G , we contruct the lists Succ(x)containing the first vertices with respect to σ of the Si(x)′s (i.e.Succ(x) = minσS1(x), next.Succ(x) = minσS2(x) and so on ).Same definition for Succ(x) using σ.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
The optimised version
Data: s the first vertex of a module M of G wrt σ ;
Result: the cotree of G (M)
if Succ(s) = Nil and Succ(s) = Nil then
t(s,G )← s
if Succ(s) = Nil (resp. Succ(s) = Nil ) ; then
t(s,G )← s⊕
t(Succ(s),G )(resp. t(s,G )← s
⊗t(Succ(s),G ))
if Succ(s)Succ(s) ∈ E then
t(s,G )← s⊕
t(Succ(s),G )⊗
t(Succ(s),G )⊕
t(next.Succ(s),G ). . .
Else t(s,G )← s⊗
t(Succ(s),G )⊕
t(Succ(s),G )⊗
t(next.Succ(s),G )
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Couches lexicographiques
On appelle couche lexicographique d’un LexBFS un ensemble desommets qui a une etape du parcours sont equivalents. Seul unchoix arbitraire ou une regle de tie-break permet de les separer.
Initialement l’ensemble des sommets du graphe constitue unecouche lexicographique. A chaque etape de l’algorithme, lessommets non explores sont partitionnes en coucheslexicographiques. Un gestion de ces couches a l’aide d’unalgorithme de partitionnement permet une implementation simpleet efficace d’un LexBFS.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Remarque
Tant qu’aucun sommet d’un module M n’a ete explore, lessommets de M appartiennent tous a une meme couchelexicographique du LexBFS.
Lemme
Soit M un module ”fort”qui est un facteur de σ, alors M est aussiun facteur de σ− et les deux facteurs commencent par le memesommet.
Definition
On notera lorsque le voisinage du sommet x de depart du parcoursa ete totalement explore, S1(x), . . . Sk(x) les coucheslexicographiques de son non-voisinage (i.e. les sommets ayant lesmemes voisins dans l’ensemble {x} ∪ N(x)).
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
L’algorithme
◮ Initialisations :Calculs de σ = LexBFS(x ,G ) et σ − = LexBFS−(x ,G ) et despartitions associees.
◮ Pour obtenir le coarbre il suffit d’appeler la fonction T (M,G ),fonction recursive definie ci-apres pour un module M de G , etqui calcule le coarbre du sous-graphe G (M).
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Elements de preuve de l’algorithme
1. Soit S une couche lexicographique de LexBFS σ sur G , alorsla restriction de σ a S est un LexBFS de G (S).
2. Il n’existe pas d’arete entre les Si(x). Les sommets d’un Si(x)ont donc les memes voisins a l’exterieur, et les Si(x) sontdonc des modules de G .
3. Les Si (resp. Si) sont des modules maximaux de G − x .
4. Les Si verifient une condition d’inclusion des voisinages quijustifie les formules de la fonction T .
5. Le deuxieme parcours en − permet d’assurer la recursivite. Eneffet Si(x) est un module facteur de σ, d’apres le lemme celapermet de garantir que les parcours de G et G vontcommencer par le meme sommet de Si(x).
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Preprocessing
Data: a graph G ;
Result: A pair of LexBFS
Take x a vertex in G and computeσ = LexBFS(x ,G ) and σ− = LexBFS−(x ,G )and for each vertex of x of G , we contruct the lists Succ(x)containing the first vertices with respect to σ of the Si(x)′s (i.e.Succ(x) = minσS1(x), next.Succ(x) = minσS2(x) and so on ).Same definition for Succ(x) using σ.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Interpretation de cet algorithme
Ce qu’il faut retenir de ce mecanisme a deux parcours
Pour chaque sommet x premier sommet explore par le LexBFSd’un module de G , le parcours sur G ordonne N(x), tandis que ledeuxieme parcours sur G ordonne le voisinage N(x).Les deux parcours LexbFS gerent sur les ensembles Si (resp. Si) dela meme facon leurs cas d’egalite (tie-break).
Remarque
L’arbre propose par l’algorithme n’est pas necessairementcanonique (i.e. il peut y avoir deux noeuds 0 (resp. 1) consecutifs).
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Generalisation to arbitrary graphs ?
1. There are many similarities between two-LexBFS-sweepalgorithm and the linear implementation of Ehrenfeucht etal.’s algorithm [DGM01]
2. LexBFS is useful for the transitive orientation problem. Couldit lead to a simple linear time algorithm for this problem ?
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Retour sur ces caracterisations
Caracterisation [Dirac 1961 ]
Un graphe est triangule ss’il possede un ordre d’eliminationsimplicial.A vertex is simplicial iff its neighbourhood is a clique (completegraph).
Caracterisation LexBFS [Rose, Tarjan et Lueker 1976]
Un graphe G est triangule ssi tout ordre ”inverse” LexBFS de Gest un ordre d’elimination simplicial.
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Umbrellas
When restricted to cographs, LexBFS orderings can be shown to beumbrella-free. An umbrella of an ordering σ is a triple of verticesx , y , z such that x <σ y <σ z where xz ∈ E , xy /∈ E and yz /∈ E .
Characterisation
G is a cograph iff Any LexBFS ordering σ of a cograph G isumbrella-free
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Jeu des differences
Characterisation
G is a cograph iff Any LexBFS σ of a cograph G is umbrella-free(there does not exist x <σ y <σ z such that xz ∈ E , xy /∈ E andyz /∈ E ).
Characterisation LexBFS [Rose, Tarjan et Lueker 1976]
A graph G is chordal iff Any LexBFS ordering σ of G is a simplicialelimination scheme
Algorithmic aspects of modular decomposition Cours MPRI 2009–2010
Cographs
An algorithm based on LexBFS
Generalisation to arbitrary graphs ?
1. There are many similarities between two-LexBFS-sweepalgorithm and the linear implementation of Ehrenfeucht etal.’s algorithm [DGM01]
2. LexBFS is useful for the transitive orientation problem. Couldit lead to a simple linear time algorithm for this problem ?