60
Cours 3 : MPRI 2014–2015 Cours 3 : MPRI 2014–2015 Michel Habib [email protected] http://www.liafa.univ-Paris-Diderot.fr/ ~ habib 29 septembre 2014

Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Cours 3 :MPRI 2014–2015

Michel [email protected]

http://www.liafa.univ-Paris-Diderot.fr/~habib

29 septembre 2014

Page 2: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Last course questions

1. How to decide if one vertex is the end vertex of some BFScould be NP-complete ?

2. How do you prove :G cographs ←− G without induced P4 ?

Page 3: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Schedule of this course

End vertices

Huge graphs

Lower bounds for diameter computations

P4 free graphs and cographs

Page 4: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

End vertices

End vertices

Huge graphs

Lower bounds for diameter computations

P4 free graphs and cographs

Page 5: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

End vertices

Influence of the tie-break rule on the end-vertex problemPierre Charbit, Michel Habib, Antoine MamcarzDiscrete Mathematics & Theoretical Computer Science, Vol 16, No2 (2014).

http://www.dmtcs.org/dmtcs-ojs/index.php/dmtcs/

article/view/2519

Page 6: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

End vertices

End-vertex problem for a search S :Input : A graph G = (V ,E ), and a vertex t.Question : Is there σ an S-ordering of V such that σ(n) = t ?

Page 7: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

End vertices

S = {s};for i = 1 . . . n do

if S does not contain any unnumbered vertex thenPick any unnumbered vertex v of V ;

endelse

Pick any unnumbered vertex v of S ;endσ(i) = v ;S = S ∪ N(v);

endreturn(σ);

Algorithm 1: Generic search(G ,s)

Page 8: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

End vertices

Tie-break

S = {s};for i = 1 . . . n do

if S does not contain any unnumbered vertex thenPick any unnumbered vertex v of V ;

endelse

Pick any unnumbered vertex v of S ;endσ(i) = v ;S = S ∪ N(v);

endreturn(σ);

Page 9: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

End vertices

I All classical search differ from generic search by their tie-breakrule.

I DFS (Stack), BFS(Queue), Dijkstra (Heap), . . .

Page 10: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

End vertices

End-vertex results BFS LBFS DFS LDFS MNS

All Graphs NPC NPC NPC NPC ?(P)

Bipartite NPC ?(NPC ) ?(NPC ) ?(NPC ) ?(P)

Weakly Chordal NPC NPC NPC NPC ?(P)

Chordal ?(NPC ) ?(NPC ) NPC ? P

Split P P NPC P P

Str. Chordal Split P P NPC P P

Path Graphs ? ?(P) NPC ? P

Page 11: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

End vertices

BFS

Donnees: Un graphe G = (V ,E ) et un sommet source s

Resultat: Un ordre total σ de VInitialiser la file S a spour i ← 1 a n faire

Extraire le sommet v de la tete de la file Sσ(i)← vpour chaque sommet non-numerote w ∈ N(v) faire

si w n’est pas dans S alorsAjouter w en fin de la file S

finfin

fin

Algorithm 2: Parcours en largeur

Page 12: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

End vertices

Theorem

Given a bipartite graph G and a vertex v of G , it is NP-completeto decide if there exists an execution of BFS on G such that v isthe end-vertex.

Reduction direct from 3-SAT

Page 13: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

End vertices

For every n ∈ N we define a graph Gn, which has one specialvertex rn called the root. It is constructed recursively as follows :

I G0 is the graph with one vertex r0.

I Gn is constructed from Gn−1 by first adding three vertices :the new root rn, and its two neighbours yn and yn, that arealso adjacent to rn−1. Finally we attach a path of 2n − 1 newvertices to yn (respectively yn) and label its end-vertex xn(respectively xn).

Page 14: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

End vertices

r2

y2 y2

r1

y1 y1

x2 x1 r0 x1 x2

Figure: The graph G2.

Page 15: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

End vertices

Proposition 1

Gn is a bipartite graph that has (2n + 1)(n + 1) vertices that allare at distance at most 2n from rn. There are 2n + 1 vertices atdistance exactly 2n from rn, and these are x1, x1, x2, x2, . . . , xn, xnand r0.

The following proposition is central to the reduction and concernsthe order that we obtain on those 2n + 1 vertices when we do aBFS starting at the root.

Proposition 2

Consider an order on the vertices of Gn given by an execution of aBFS starting at rn. For each 1 ≤ i ≤ n at most one of xi and xi isbefore r0. Moreover each of the 2n choices of one among xi and xifor each i, can be obtained as the set of vertices that appear beforer0 for some BFS order of Gn.

Page 16: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

End vertices

End of the proof

1. We just add to the previous gadjet, the incidence bipartiteclauses–variables and a pending edge r0t.

2. There is a BFS ending at t iff the SAT instance is satisfiable.

Page 17: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

End vertices

BFS versus LL

I Level Layered search visits the vertices according to theirdistance to the starting vertex.

I The end vertex problem is polynomial for LL.

I Many authors make no difference between BFS and LL(even Cormen, Leiserson and Rivest in their book :Introduction to algorithms).

I LL+ ends at a vertex with minimum degree from the previouslayer.

Page 18: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Huge graphs

End vertices

Huge graphs

Lower bounds for diameter computations

P4 free graphs and cographs

Page 19: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Huge graphs

1. To handle huge graphs we already have : graph searches.

2. But BFS is not so easy to program in a distributedenvironment.

3. For example, using Map - Reduce operations as popularizedby Google.

4. Hot topic to find good way to handle huge graphs in adistributed system.

5. In 2010 Google proposes a language named Pregel.Another one Giraf for the Hadoop platform (available free)

Page 20: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Huge graphs

I Some hope : Layered search is not so bad.

I We have some theoretical results on LL

I We do not know if BFS is really needed ?

Page 21: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Huge graphs

Restricted Families of Graphs

No induced cycles of length >3

No asteroidal triples

No asteroidal triples and

The intersection graph of intervals of a line

No induced cycles of length >4

asteroidal triple a,b,c

bc

a

Page 22: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Huge graphs

Theoretical aspects

I D. Corneil, F. Dragan, M. Habib, C. Paul, Diameterdetermination on restricted families of graphs, DiscreteApplied Mathematic, Vol 113(2-3) : 143-166 (2001).

I * D. Corneil, F. Dragan, Ekkehard Kohler, On the power ofBFS to determine a graph’s diameter Networks 42(4) :209-222 (2003).

I V. Chepoi, F. Dragan, B. Estellon, M. Habib, Y. Vaxes,Diameters, centers, and approximating trees ofdelta-hyperbolic geodesic spaces and graphs, ACMSymposium on Computational Geometry 2008 : 59-68.

I V. Chepoi, F. Dragan, B. Estrellon, M. Habib, Y. Vaxes et Y.Xiang Additive Spanners and Distance and Routing LabelingSchemes for Hyperbolic Graphs, Algorithmica 62-(3-4)(2012) 713-732.

Page 23: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Huge graphs

Answers to Frequently Asked Questions

I We can really compute the exact value of the diameter for biggraphs.

Page 24: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Huge graphs

I For practical algorithms the rules are not exactly the samethat for classical algorithms in which only worst casecomplexity matters.

I But we can have fun !

Page 25: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Huge graphs

”While theoretical work on models of computation and methodsfor analyzing algorithms has had enormous payoffs, we are notdone. In many situations, simple algorithms do well. We don’tunderstand why ! Developing means for predicting the performanceof algorithms and heuristics on real data and on real computers isa grand challenge in algorithms.”Challenges for Theory of Computing by :CONDON, EDELSBRUNNER, EMERSON, FORTNOW, HABER,KARP, LEIVANT, LIPTON, LYNCH, PARBERRY,PAPADIMITRIOU, RABIN, ROSENBERG, ROYER, SAVAGE,SELMAN, SMITH, TARDOS, AND VITTER,Report for an NSF-sponsored workshop on research in theoreticalcomputer science.

Page 26: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Huge graphs

So we need to understand

I Why few sweeps are enough to give a good lower bound inmost cases ?

I Some partial results for the 2-sweep method in : MichalParnas and Dana Ron,Testing the diameter of graphs,Random Structure and Algorithms, 2002.

I Progress in this direction for iFub algorithm.

I For which graphs one can avoid to use O(n) BFS’s tocompute the diameter ?

Page 27: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Huge graphs

General method used so far

1. Find a linear time algorithm proved for a wide class of graphscontaining trees, chordal graphs, . . .(Most of these algorithms are based on graph searches)

2. So the study of graph classes could be useful for applications !

3. Make an heuristic out of this algorithm applicable on arbitrarygraphs

4. Provide certificates for partial solutions

Page 28: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Huge graphs

I Computation of δ-hyperbolicity of graphs. A Gromov’sparameter which measures the distance to a tree in a metricway. Polynomial to compute but not linearly.

I Develop similar heuristics for computing BetweennessCentrality or other centrality parameters used in biology orsocial networks analysis.

I Community detection in networks.

Page 29: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Lower bounds for diameter computations

End vertices

Huge graphs

Lower bounds for diameter computations

P4 free graphs and cographs

Page 30: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Lower bounds for diameter computations

Chordal graphs and split graphs

Page 31: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Lower bounds for diameter computations

Disjoint sets problem

Disjoint sets problem

A finite set X , F a collection {S1, . . . ,Sk} of subsets of X .∃i , j ∈ [1, k] such that Si ∩ Sj = ∅ ?

Linearity

Can this problem be solved in linear time ?Size of the problem : |X |+ k +

∑i=ki=1 |Si |

size of the incidence bipartite graph

Page 32: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Lower bounds for diameter computations

SETH : Strong Exponential Time Hypothesis

SETH

There is no algorithm for solving the k-SAT problem with nvariables in O((2− ε)n) where ε does not depend on k .

Page 33: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Lower bounds for diameter computations

Let us consider an instance I of k − SAT with 2n boolean variablesx1, . . . , x2n, and a set C of m clauses C1, . . .Cm, we build aninstance of Disjoint-set problem as follows :

I The gound set X is the set of clauses + 2 extras vertices a, b.

I We consider now A,B the sets of all truth assigments ofx1, . . . , xn, and xn+1, . . . x2n, respectively.

I For each truth t assigment in A (resp. in B) we defineSt = {C ∈ C such that t does not satisfy C} ∪ {a} (resp.∪{b}).

Page 34: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Lower bounds for diameter computations

I The sets S ′s defined with A (resp. B) always intersectbecause of a (resp. b).

I If there exists Su,Sv that do not intersect. This means thatfor each clause Ci of I , if Ci /∈ Su, then the truth vassignment satisfies Ci .Similarly if Ci /∈ Sv , then the truth u assignment satisfies Ci .

I Therefore :I is satisfiable iff exist 2 disjoint sets Su,Sv .

Page 35: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Lower bounds for diameter computations

Complexity issues

I Size of the k − SAT instance is bounded by :K = 2n + m + km

I Size of the Disjoint set instance :N = 2n+1 + m + 2 verticesand at most M = m2n+1 edges.

I To compute this instance we need to evaluate the m,k-clauses for each half-truth assigment.Can be done in O(K ), so in the whole : O(2n+1K ).

I If there exists an algorithm for the Disjoint set problem in lessthan O(NM1−ε)it would imply an algorithm for k − SAT in less thanO((2− ε)2n) contradiction the SETH.

Page 36: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Lower bounds for diameter computations

Consequences

Practically there is no hope to design a linear time algorithm for :

1. Disjoint set problem

2. Diameter computations for chordal graphs and split graphs

3. And many other related problems . . . such as betweennesscentrality

4. but not all O(mn) problems as for example transitive closure,existence of a triangle . . .

Page 37: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

Lower bounds for diameter computations

Research Problem

I Since sparse graphs are not available for the above reduction.

I Can we compute in linear time the diameter of planar graphs ?

I This class contains all grids !

I Hot subject

Page 38: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

End vertices

Huge graphs

Lower bounds for diameter computations

P4 free graphs and cographs

Page 39: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

Cographs properties

Characterisation Theorem

The two following statements are equivalent

1. The smallest class of graphs containing G0 = K1 and closedunder series and parallel compositions.They can be represented via a tree (called a cotree) usingthese operations, the leaves being the vertices.

2. The class of graphs which do not contain a P4 (path of length3 with 4 vertices) as an induced subgraph.

Easy induction

With the cotree representation. a

a. Proof valid only in the finite case !

Page 40: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

Cographs an interesting class of graphs

y

w

v

u

b

d

c

a

z

x

R

xa

zd

cb

w yv u

0

1

0

1

a)

1

0

b)

0

11

Figure: a) A cograph G . b) An embedding of the cotree TG of G .

Page 41: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

Proof of the theorem

Hereditary

Using both definitions every induced subgraph of a cograph is acograph.

−→ Easy induction

With the cotree representation, one can easily notice that no P4

can be created by these 2 operations. a

a. Proof valid only in the finite case !

Page 42: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

←− Not so easy

Or easy with some knowledge about modular graph decomposition

Page 43: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

Sketch for the proof

I Definitions of Modules and Prime Graphs

I Algebraic properties of modules

I Modular decomposition theorem

I Prime graphs contains P4

Page 44: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

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)− AThe problem with this definition : must we check all subsets A ?

Trivial Modules

∅, {x} and V are modules.

Prime Graphs

A graph is prime if it admits only trivial modules.

Page 45: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

Examples

Characterization 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

I connected components of G

I connected components of G

I any vertex subset of thecomplete graph (or the stable)

Page 46: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

I Modular decomposition (algorithmic aspects)

I But also an operation on graphs : Modular compositiona graph grammar with a simple rule : replace a vertex by agraph

I Very natural notion, (re)discovered under many names invarious combinatorial structuressuch as :clan, homogeneous set, . . .

I An important tool in graph theory

Page 47: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

Playing with the definition

Duality

A is a module of G implies A is a module of G .

Easy observations

I No prime undirected graph with ≤ 3 vertices (false fordirected graphs, as a directed triangle shows it)

I P4 the path with 4 vertices is the only prime on 4 vertices.

I P4 is isomorphic to its complement.

Page 48: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

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 .Classes of twins are particular modules (stable sets for false twinsand complete for true twins).

Strong modules

A strong module is a module that does not strictly overlap anyother module.

Page 49: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

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.

Page 50: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

Partitive Families

Lemma

If M and M ′ are two overlapping modules then

I (i) M \M ′is a module

I (ii) M ∩M ′ is a module

I (iii) M ∪M ′ is a module

I (iv) M∆M ′ is a module

I A family satisfying (i) - (iv) is called a partitive family

I A family satisfying (i) - (iii)) is called a weak partitive family

Page 51: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

Modular Decomposition Theorem

Theorem (Gallai 1967)

Let G = (V ,E ) be an undirected graph with |V | ≥ 4, the threefollowing cases are mutually exclusive :

1. G is not connected,

2. G is not connected,

3. G/M(G) is a prime graph, with M(G ) the modular partitioncontaining the maximal strong modules of G.

Page 52: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

Sketch of the proof

G (resp. G ) disconnected corresponds to the parallel (resp. series)nodes of the cotree.Let us assume that G and G are connected.Let us consider two maximal (under inclusion) modules : A,B thatoverlap.Since A ∪ B is a module it must be trivial, and thereforeA ∪ B = V (G ).Then A−B,A∩B,B −A is a modular partition and G or G is notconnected, a contradiction.Therefore the maximal modules are strong modules, partitionsV (G ), yielding a modular partition.The quotient graph is necessarily prime, because of the maximality.

Page 53: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

As a byproduct, we notice that a prime graph G satisfies :G and G are connected

Page 54: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

Modular decomposition tree

Tree

A recursive a this theorem yields a tree T in which :

I The root corresponds to V

I Leaves are associated to vertices

I Each node corresponds to a strong module

There are 3 types of nodes :

Parallel, Series and Prime

Page 55: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

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

��

Page 56: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

Prime graphs are nested

Folklore Theorem

Let G be a prime graph (|G | ≥ 4), then G contains a P4.

Theorem Schmerl, Trotter, Ille 1991 . . .

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.

Page 57: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

A simple proof of Folklore theorem

A stronger statement, Cournier, Ille, 1991

For a prime graph there is at most one vertex not contained in aP4.

Proof

As a prime graph G is necessarily connected and if ∃x ∈ V thatdoes not belong to a P4. Every connected component of N(x) is amodule, therefore N(x) must be a stable set.If ∃x 6= y ∈ V that does not belong to a P4,wlog assume xy /∈ E (else use G )But then y ∈ N(x) and therefore : N(y) ⊆ N(x).By symmetry x , y have the same neighbourhood and must be falsetwins, a contradiction.

Page 58: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

Nota Bene : this result also holds for infinite graphs !So does our previous proof.

Page 59: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

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.

Page 60: Cours 3 : MPRI 2014 2015habib/Documents/cours_3-2014.pdf · Cours 3 : MPRI 2014{2015 End vertices For every n 2Nwe de ne a graph G n, which has one special vertex r n called the root

Cours 3 : MPRI 2014–2015

P4 free graphs and cographs

←−

Let G be without induced P4, and consider its modulardecomposition tree. Since every prime node contains at least a P4.There is only series and parallel nodes in this tree. Thiscorresponds exactly to the recursive definition of cographs.