Cours II-2 Cours MPRI 2008–2009
Cours II-2Cours MPRI 2008–2009
Michel [email protected]
http://www.liafa.jussieu.fr/~habib
Rue du chateau des rentiers, septembre 2008
Cours II-2 Cours MPRI 2008–2009
Schedule
Chordal graphsParcours en largeur lexicographique LexBFS
Interval graphs
Sur les algorithmes de graphes
Graph Representations
Treewidth
Cours II-2 Cours MPRI 2008–2009
Schedule
Chordal graphsParcours en largeur lexicographique LexBFS
Interval graphs
Sur les algorithmes de graphes
Graph Representations
Treewidth
Cours II-2 Cours MPRI 2008–2009
Schedule
Chordal graphsParcours en largeur lexicographique LexBFS
Interval graphs
Sur les algorithmes de graphes
Graph Representations
Treewidth
Cours II-2 Cours MPRI 2008–2009
Schedule
Chordal graphsParcours en largeur lexicographique LexBFS
Interval graphs
Sur les algorithmes de graphes
Graph Representations
Treewidth
Cours II-2 Cours MPRI 2008–2009
Schedule
Chordal graphsParcours en largeur lexicographique LexBFS
Interval graphs
Sur les algorithmes de graphes
Graph Representations
Treewidth
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Chordal graphsParcours en largeur lexicographique LexBFS
Interval graphs
Sur les algorithmes de graphes
Graph Representations
Treewidth
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Recognition
Definition
A graph is chordal iff it has no chordless cycle of length ≥ 4.
Characterisation [Dirac 1961 ]
A graph is chordal iff it admits a simplicial elimination scheme.A vertex is simplicial iff its neighbourhood is a clique (completegraph).
LexBFS Characterisation [Rose, Tarjan et Lueker 1976]
A graph is chordal iff any LexBFS ordering of G provides asimplicial elimination scheme.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Recognition
Definition
A graph is chordal iff it has no chordless cycle of length ≥ 4.
Characterisation [Dirac 1961 ]
A graph is chordal iff it admits a simplicial elimination scheme.A vertex is simplicial iff its neighbourhood is a clique (completegraph).
LexBFS Characterisation [Rose, Tarjan et Lueker 1976]
A graph is chordal iff any LexBFS ordering of G provides asimplicial elimination scheme.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Recognition
Definition
A graph is chordal iff it has no chordless cycle of length ≥ 4.
Characterisation [Dirac 1961 ]
A graph is chordal iff it admits a simplicial elimination scheme.A vertex is simplicial iff its neighbourhood is a clique (completegraph).
LexBFS Characterisation [Rose, Tarjan et Lueker 1976]
A graph is chordal iff any LexBFS ordering of G provides asimplicial elimination scheme.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Minimal Separators
A subset of vertices S is a minimal separator if Gif there exist a, b ∈ G such that a and b are not connected inG − S .and S is minimal for inclusion with this property .
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Consequences
G has a linear number of maximal cliques.Computing a maximum clique ω(G ) is polynomial.Computing χ(G ) also
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Maximal Clique trees
A maximal clique tree (sometimes clique tree) is a tree T thatsatisfies the following three conditions :
I Vertices of T are associated with the maximal cliques of G
I Edges of T correspond to minimal separators.
I For any vertex x ∈ G , the cliques containing x yield a subtreeof T .
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Maximal Clique trees
A maximal clique tree (sometimes clique tree) is a tree T thatsatisfies the following three conditions :
I Vertices of T are associated with the maximal cliques of G
I Edges of T correspond to minimal separators.
I For any vertex x ∈ G , the cliques containing x yield a subtreeof T .
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Maximal Clique trees
A maximal clique tree (sometimes clique tree) is a tree T thatsatisfies the following three conditions :
I Vertices of T are associated with the maximal cliques of G
I Edges of T correspond to minimal separators.
I For any vertex x ∈ G , the cliques containing x yield a subtreeof T .
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Theorem
Dirac 1961, Fulkerson, Gross 1965, Gavril 1974, Rose, Tarjan,Lueker 1976.
(0) G is chordal.
(i) G has a simplicial elimination scheme
(ii) Every minimal separator is a clique
(iii) G admits a maximal clique tree.
(iv) G is the intersection graph of subtrees in a tree.
(v) Any LexBFS provides a simplicial elimination scheme.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Chordal graphsParcours en largeur lexicographique LexBFS
Interval graphs
Sur les algorithmes de graphes
Graph Representations
Treewidth
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Chordal graphsParcours en largeur lexicographique LexBFS
Interval graphs
Sur les algorithmes de graphes
Graph Representations
Treewidth
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Parcours en largeur lexicographique (LexBFS)
Donnees: Un graphe G = (V ,E ) et un sommet source s
Resultat: Un ordre total σ de VAffecter l’etiquette ∅ a chaque sommetlabel(s)← {n}pour i ← n a 1 faire
Choisir un sommet v d’etiquette lexicographique max.σ(i)← vpour chaque sommet non-numerote w ∈ N(v) faire
label(w)← label(w).{i}fin
fin
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Maximal clique Graph
Definition
For a chordal graph G we define its Maximal clique graph denotedby C(G) whose vertices are the maximal cliques of G and we putan edge between two maximal cliques C ,C ′ if C ∩ C ′ is a minimalseparator.
I Note that this is not the intersection graph of the maximalcliques of G
I Exercise : Is C(G) chordal ? What is the size of C(G) in termsof n and m ? Same question for a maximal clique tree.
I Any maximal clique tree is a spanning tree of C(G).
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Maximal clique Graph
Definition
For a chordal graph G we define its Maximal clique graph denotedby C(G) whose vertices are the maximal cliques of G and we putan edge between two maximal cliques C ,C ′ if C ∩ C ′ is a minimalseparator.
I Note that this is not the intersection graph of the maximalcliques of G
I Exercise : Is C(G) chordal ? What is the size of C(G) in termsof n and m ? Same question for a maximal clique tree.
I Any maximal clique tree is a spanning tree of C(G).
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Maximal clique Graph
Definition
For a chordal graph G we define its Maximal clique graph denotedby C(G) whose vertices are the maximal cliques of G and we putan edge between two maximal cliques C ,C ′ if C ∩ C ′ is a minimalseparator.
I Note that this is not the intersection graph of the maximalcliques of G
I Exercise : Is C(G) chordal ? What is the size of C(G) in termsof n and m ? Same question for a maximal clique tree.
I Any maximal clique tree is a spanning tree of C(G).
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Maximal clique Graph
Definition
For a chordal graph G we define its Maximal clique graph denotedby C(G) whose vertices are the maximal cliques of G and we putan edge between two maximal cliques C ,C ′ if C ∩ C ′ is a minimalseparator.
I Note that this is not the intersection graph of the maximalcliques of G
I Exercise : Is C(G) chordal ? What is the size of C(G) in termsof n and m ? Same question for a maximal clique tree.
I Any maximal clique tree is a spanning tree of C(G).
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
An example
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Simplicial elimination schemes
1. Choose a maximal clique tree T
2. While T is not empty doSelect a vertex x ∈ F − S in a leaf F of T ;F ← F − x ;If F = S delete F ;
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Simplicial elimination schemes
1. Choose a maximal clique tree T
2. While T is not empty doSelect a vertex x ∈ F − S in a leaf F of T ;F ← F − x ;If F = S delete F ;
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Canonical simplicial elimination scheme
1. Choose a maximal clique tree T
2. While T is not empty doChoose a leaf F of T ;Select successively all vertices in F − Sdelete F ;
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Canonical simplicial elimination scheme
1. Choose a maximal clique tree T
2. While T is not empty doChoose a leaf F of T ;Select successively all vertices in F − Sdelete F ;
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Size of a maximal clique tree in a chordal graph
I Let G = (V ,E ) be a chordal graph.
I G admits at most |V | maximal cliques and therefore the treeis also bounded by |V | (vertices and edges).
I But some vertices can be repeated in the cliques. If weconsider a simplicial elimination ordering the size of a givenmaximal clique is bounded by the neighbourhood of the firstvertex of the maximal clique.
I Therefore any maximal clique tree is bounded by |V |+ |E |.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Size of a maximal clique tree in a chordal graph
I Let G = (V ,E ) be a chordal graph.
I G admits at most |V | maximal cliques and therefore the treeis also bounded by |V | (vertices and edges).
I But some vertices can be repeated in the cliques. If weconsider a simplicial elimination ordering the size of a givenmaximal clique is bounded by the neighbourhood of the firstvertex of the maximal clique.
I Therefore any maximal clique tree is bounded by |V |+ |E |.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Size of a maximal clique tree in a chordal graph
I Let G = (V ,E ) be a chordal graph.
I G admits at most |V | maximal cliques and therefore the treeis also bounded by |V | (vertices and edges).
I But some vertices can be repeated in the cliques. If weconsider a simplicial elimination ordering the size of a givenmaximal clique is bounded by the neighbourhood of the firstvertex of the maximal clique.
I Therefore any maximal clique tree is bounded by |V |+ |E |.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Size of a maximal clique tree in a chordal graph
I Let G = (V ,E ) be a chordal graph.
I G admits at most |V | maximal cliques and therefore the treeis also bounded by |V | (vertices and edges).
I But some vertices can be repeated in the cliques. If weconsider a simplicial elimination ordering the size of a givenmaximal clique is bounded by the neighbourhood of the firstvertex of the maximal clique.
I Therefore any maximal clique tree is bounded by |V |+ |E |.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Size of CS(G )
Considering a star on n vertices,shows |CS(G )| ∈ O(n2)Not linear in the size of G
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
CS(G ) is not chordal !
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
CS(G ) is not chordal !
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
In fact CS(G ) is dually chordal (almost chordal)and CS(CS(G )) is chordal.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Claim 1
CS(G ) is a good tool to study the structure ofchordal graphs.
To prove structural properties of maximal clique trees.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Combinatorial structure of CS(G )
Lemma 1 : M.H and C. Paul 95
If C1,C2,C3 is a cycle in CS(G ), with S12,S23 and S23 be theassociated minimal separators then two of these three separatorsare equal and included in the third.
Lemma 2 : M.H. and C. Paul 95
Let C1,C2,C3 be 3 maximal cliques, ifC1 ∩ C2 = S12⊂S23 = C2 ∩ C3 then it yields a triangle in CS(G )
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Combinatorial structure of CS(G )
Lemma 1 : M.H and C. Paul 95
If C1,C2,C3 is a cycle in CS(G ), with S12,S23 and S23 be theassociated minimal separators then two of these three separatorsare equal and included in the third.
Lemma 2 : M.H. and C. Paul 95
Let C1,C2,C3 be 3 maximal cliques, ifC1 ∩ C2 = S12⊂S23 = C2 ∩ C3 then it yields a triangle in CS(G )
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Theorem : Blayr and Payton 93
Maximal clique trees are exactly the maximum spanning trees ofCS(G ).
The weight of an edge being the size of the minimal separator itrepresents.
I CS(G ) is the union of all maximal clique trees of G .
I From one maximal clique tree to another there always exists apath of exchanges on triangles.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Theorem : Blayr and Payton 93
Maximal clique trees are exactly the maximum spanning trees ofCS(G ).
The weight of an edge being the size of the minimal separator itrepresents.
I CS(G ) is the union of all maximal clique trees of G .
I From one maximal clique tree to another there always exists apath of exchanges on triangles.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Theorem : Blayr and Payton 93
Maximal clique trees are exactly the maximum spanning trees ofCS(G ).
The weight of an edge being the size of the minimal separator itrepresents.
I CS(G ) is the union of all maximal clique trees of G .
I From one maximal clique tree to another there always exists apath of exchanges on triangles.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Applications
I Maximal Cardinality Search can be seen as a Prim algorithmfor computing maximal spanning tree of CS(G ).
I LexBFS as an example of Maximal Inclusion Search.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Applications
I Maximal Cardinality Search can be seen as a Prim algorithmfor computing maximal spanning tree of CS(G ).
I LexBFS as an example of Maximal Inclusion Search.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Others simplicial elimination scheme
1. Maximal cardinality search
2. Minimal inclusion search (MIS)
3. Others ? How to generate all simplicial elimination schemes ?
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Others simplicial elimination scheme
1. Maximal cardinality search
2. Minimal inclusion search (MIS)
3. Others ? How to generate all simplicial elimination schemes ?
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Others simplicial elimination scheme
1. Maximal cardinality search
2. Minimal inclusion search (MIS)
3. Others ? How to generate all simplicial elimination schemes ?
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Maximal Cardinality Search : MCS
Donnees: Un graphe G = (V ,E ) et un sommet source s
Resultat: Un ordre total σ de VAffecter l’etiquette 0 a chaque sommetlabel(s)← {n}pour i ← n a 1 faire
Choisir un sommet v d’etiquette maximumσ(i)← vpour chaque sommet non-numerote w ∈ N(v) faire
label(w)← label(w) + 1fin
fin
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Maximal Inclusion Search : MIS
Donnees: Un graphe G = (V ,E ) et un sommet source s
Resultat: Un ordre total σ de VAffecter l’etiquette ∅ a chaque sommetlabel(s)← {n}pour i ← n a 1 faire
Choisir un sommet v d’etiquette maximaleσ(i)← vpour chaque sommet non-numerote w ∈ N(v) faire
label(w)← label(w) ∪ {i}fin
fin
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
Theorem
G is chordal graph iff any MIS produces a simplicial eliminationscheme.
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
I How to implement MIS search in linear time ?
I 2 known linear implementations : LexBFS, MCS
Cours II-2 Cours MPRI 2008–2009
Chordal graphs
Parcours en largeur lexicographique LexBFS
I How to implement MIS search in linear time ?
I 2 known linear implementations : LexBFS, MCS
Cours II-2 Cours MPRI 2008–2009
Interval graphs
Chordal graphsParcours en largeur lexicographique LexBFS
Interval graphs
Sur les algorithmes de graphes
Graph Representations
Treewidth
Cours II-2 Cours MPRI 2008–2009
Interval graphs
Characterisation Theorem for interval graphs
(0) G = (V ,E ) is interval graph.
(i) G has ...
(ii) It exists a total ordering τ of the vertices of V s.t.∀x , y , z ∈ G with x ≤τ y ≤τ z and xz ∈ E thenxy ∈ E .
(iii) G has a maximal clique path. (A maximal clique pathis just a maximal clique tree T, reduced to a path).
(iv) G is the intersection graph of a family of intervals ofthe real line
Cours II-2 Cours MPRI 2008–2009
Interval graphs
To recognize an interval graph, we just have to compute amaximal clique tree and check if it is a path ?
Cours II-2 Cours MPRI 2008–2009
Interval graphs
Cours II-2 Cours MPRI 2008–2009
Interval graphs
Cours II-2 Cours MPRI 2008–2009
Interval graphs
Many linear time algorithms already proposed for interval graphrecognition ....using nice algorithmic tools :graph searches, modular decomposition, partition refinement,PQ-trees . . .
Cours II-2 Cours MPRI 2008–2009
Interval graphs
Linear time recognition algorithms for interval graphs
I Booth and Lueker 1976, using PQ-trees.
I Korte and Mohring 1981 using LexBFS and ModifiedPQ-trees.
I Hsu and Ma 1995, using modular decomposition and avariation on Maximal Cardinality Search.
I Corneil, Olariu and Stewart SODA 1998, using a series ofLexBFS.
I M.H, McConnell, Paul and Viennot 2000, using LexBFS andpartition refinement on maximal cliques.
Cours II-2 Cours MPRI 2008–2009
Interval graphs
Linear time recognition algorithms for interval graphs
I Booth and Lueker 1976, using PQ-trees.
I Korte and Mohring 1981 using LexBFS and ModifiedPQ-trees.
I Hsu and Ma 1995, using modular decomposition and avariation on Maximal Cardinality Search.
I Corneil, Olariu and Stewart SODA 1998, using a series ofLexBFS.
I M.H, McConnell, Paul and Viennot 2000, using LexBFS andpartition refinement on maximal cliques.
Cours II-2 Cours MPRI 2008–2009
Interval graphs
Linear time recognition algorithms for interval graphs
I Booth and Lueker 1976, using PQ-trees.
I Korte and Mohring 1981 using LexBFS and ModifiedPQ-trees.
I Hsu and Ma 1995, using modular decomposition and avariation on Maximal Cardinality Search.
I Corneil, Olariu and Stewart SODA 1998, using a series ofLexBFS.
I M.H, McConnell, Paul and Viennot 2000, using LexBFS andpartition refinement on maximal cliques.
Cours II-2 Cours MPRI 2008–2009
Interval graphs
Linear time recognition algorithms for interval graphs
I Booth and Lueker 1976, using PQ-trees.
I Korte and Mohring 1981 using LexBFS and ModifiedPQ-trees.
I Hsu and Ma 1995, using modular decomposition and avariation on Maximal Cardinality Search.
I Corneil, Olariu and Stewart SODA 1998, using a series ofLexBFS.
I M.H, McConnell, Paul and Viennot 2000, using LexBFS andpartition refinement on maximal cliques.
Cours II-2 Cours MPRI 2008–2009
Interval graphs
Linear time recognition algorithms for interval graphs
I Booth and Lueker 1976, using PQ-trees.
I Korte and Mohring 1981 using LexBFS and ModifiedPQ-trees.
I Hsu and Ma 1995, using modular decomposition and avariation on Maximal Cardinality Search.
I Corneil, Olariu and Stewart SODA 1998, using a series ofLexBFS.
I M.H, McConnell, Paul and Viennot 2000, using LexBFS andpartition refinement on maximal cliques.
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Chordal graphsParcours en largeur lexicographique LexBFS
Interval graphs
Sur les algorithmes de graphes
Graph Representations
Treewidth
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Notation
For a finite loopless undirected graph G = (V ,E )V set of verticesE edges set|V | = n and |E | = m
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Some exercises
1. Algorithme lineaire qui teste l’isomorphisme de deux arbres
2. Calcul du diametre d’un arbre
3. Ecrire un algorithme qui verifie l’existence d’une clique ayant∆ + 1 sommets dans un graphe de degre maximum ∆ ?
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Some exercises
1. Algorithme lineaire qui teste l’isomorphisme de deux arbres
2. Calcul du diametre d’un arbre
3. Ecrire un algorithme qui verifie l’existence d’une clique ayant∆ + 1 sommets dans un graphe de degre maximum ∆ ?
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Some exercises
1. Algorithme lineaire qui teste l’isomorphisme de deux arbres
2. Calcul du diametre d’un arbre
3. Ecrire un algorithme qui verifie l’existence d’une clique ayant∆ + 1 sommets dans un graphe de degre maximum ∆ ?
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Exercices
1. On considere un graphe G dont la clique maximum a pourcardinal 2k, montrer qu’il existe une partition des sommets endeux sous-ensembles A,B tels ω(G (A)) = ω(G (B)) ?Peut-on calculer cette partition en temps polynomial (si onpart d’une clique maximum de G ) ?
2. Quelle est la complexite d’un algorithme de routage ? Parexemple RIP dans Internet.
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Exercices
1. On considere un graphe G dont la clique maximum a pourcardinal 2k, montrer qu’il existe une partition des sommets endeux sous-ensembles A,B tels ω(G (A)) = ω(G (B)) ?Peut-on calculer cette partition en temps polynomial (si onpart d’une clique maximum de G ) ?
2. Quelle est la complexite d’un algorithme de routage ? Parexemple RIP dans Internet.
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Solution de l’exercice
I Ecrire un algorithme qui verifie l’existence d’une clique ∆ + 1sommets dans un graphe de degre maximum ∆ ?
I Une solutionSoit S l’ensemble des sommets de degre ∆ du graphe.Tant qu’il existe a ∈ S ayant un voisin hors de S , eliminer ade S .Les composantes connexes de taille exactement ∆ + 1 sontdes bonnes reponses.
I L’algorithme est en O(n + m).
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Solution de l’exercice
I Ecrire un algorithme qui verifie l’existence d’une clique ∆ + 1sommets dans un graphe de degre maximum ∆ ?
I Une solutionSoit S l’ensemble des sommets de degre ∆ du graphe.Tant qu’il existe a ∈ S ayant un voisin hors de S , eliminer ade S .Les composantes connexes de taille exactement ∆ + 1 sontdes bonnes reponses.
I L’algorithme est en O(n + m).
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Solution de l’exercice
I Ecrire un algorithme qui verifie l’existence d’une clique ∆ + 1sommets dans un graphe de degre maximum ∆ ?
I Une solutionSoit S l’ensemble des sommets de degre ∆ du graphe.Tant qu’il existe a ∈ S ayant un voisin hors de S , eliminer ade S .Les composantes connexes de taille exactement ∆ + 1 sontdes bonnes reponses.
I L’algorithme est en O(n + m).
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Bornes sur le nombre d’aretes
Graphes sans triangles
Montrer que si G n’a pas de triangle alors
|E | ≤ |V |24
Graphes planaires
Montrer que si un graphe est planaire simple (i.e. sans boucle niaretes multiples) alors :|E | ≤ 3|V | − 6
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Bornes sur le nombre d’aretes
Graphes sans triangles
Montrer que si G n’a pas de triangle alors
|E | ≤ |V |24
Graphes planaires
Montrer que si un graphe est planaire simple (i.e. sans boucle niaretes multiples) alors :|E | ≤ 3|V | − 6
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Research Problems
I Find a linear-time algorithm that minimizes a deterministicautomaton.
I Find a linear-time algorithm which computes a doublylexicographic ordering of a 0-1 matrix, i.e. an ordering of thecolumns and the lines for which lines and columns appear tobe lexicographically ordered.
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Research Problems
I Find a linear-time algorithm that minimizes a deterministicautomaton.
I Find a linear-time algorithm which computes a doublylexicographic ordering of a 0-1 matrix, i.e. an ordering of thecolumns and the lines for which lines and columns appear tobe lexicographically ordered.
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Example of a doubly lexicographic ordering
C1 C2 C3 C4 C5
L1 1 0 1 0 1
L2 0 1 0 1 1
L3 1 1 0 1 1
L4 0 0 0 0 1
L5 0 1 1 0 0
C3 C1 C4 C5 C2
L4 0 0 0 1 0
L1 1 1 0 1 0
L5 1 0 0 0 1
L2 0 0 1 1 1
L3 0 1 1 1 1
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
Example of a doubly lexicographic ordering
C1 C2 C3 C4 C5
L1 1 0 1 0 1
L2 0 1 0 1 1
L3 1 1 0 1 1
L4 0 0 0 0 1
L5 0 1 1 0 0
C3 C1 C4 C5 C2
L4 0 0 0 1 0
L1 1 1 0 1 0
L5 1 0 0 0 1
L2 0 0 1 1 1
L3 0 1 1 1 1
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
I Such an ordering always exists
I Best algorithm to compute one :Paige and Tarjan [1987] proposed an O(LlogL) whereL = n + m + e for a matrix with n lines, m columns and e nonzero values, using partition refinement.
I For undirected graphs, such an ordering of the symmetricincidence matrix, yields an ordering of the vertices which hasnice properties.
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
I Such an ordering always exists
I Best algorithm to compute one :Paige and Tarjan [1987] proposed an O(LlogL) whereL = n + m + e for a matrix with n lines, m columns and e nonzero values, using partition refinement.
I For undirected graphs, such an ordering of the symmetricincidence matrix, yields an ordering of the vertices which hasnice properties.
Cours II-2 Cours MPRI 2008–2009
Sur les algorithmes de graphes
I Such an ordering always exists
I Best algorithm to compute one :Paige and Tarjan [1987] proposed an O(LlogL) whereL = n + m + e for a matrix with n lines, m columns and e nonzero values, using partition refinement.
I For undirected graphs, such an ordering of the symmetricincidence matrix, yields an ordering of the vertices which hasnice properties.
Cours II-2 Cours MPRI 2008–2009
Graph Representations
Chordal graphsParcours en largeur lexicographique LexBFS
Interval graphs
Sur les algorithmes de graphes
Graph Representations
Treewidth
Cours II-2 Cours MPRI 2008–2009
Graph Representations
I Implicit hypothesis : the memory words have k bits withk > dlog(|V |)e
I To be sure, consider the bit encoding level
Cours II-2 Cours MPRI 2008–2009
Graph Representations
I Implicit hypothesis : the memory words have k bits withk > dlog(|V |)e
I To be sure, consider the bit encoding level
Cours II-2 Cours MPRI 2008–2009
Graph Representations
I Adjacency listsO(|V |+ |E |) memory wordsAdjacency test : xy is an arc in O(|N(x)|)
I Adjacency MatrixO(|V |2) memory words (can be compressed)Adjacency test : xy is an arc in O(1)
I Customized representations, a pointer for each arc . . .
Cours II-2 Cours MPRI 2008–2009
Graph Representations
I Adjacency listsO(|V |+ |E |) memory wordsAdjacency test : xy is an arc in O(|N(x)|)
I Adjacency MatrixO(|V |2) memory words (can be compressed)Adjacency test : xy is an arc in O(1)
I Customized representations, a pointer for each arc . . .
Cours II-2 Cours MPRI 2008–2009
Graph Representations
I Adjacency listsO(|V |+ |E |) memory wordsAdjacency test : xy is an arc in O(|N(x)|)
I Adjacency MatrixO(|V |2) memory words (can be compressed)Adjacency test : xy is an arc in O(1)
I Customized representations, a pointer for each arc . . .
Cours II-2 Cours MPRI 2008–2009
Graph Representations
For some large graphs, the Adjacency matrix, is not easy to obtainand manipulate.But the neighbourhood of a given vertex can be obtained. (WEBGraph)
Cours II-2 Cours MPRI 2008–2009
Graph Representations
Quicksands
I To compute this invariant or this property of a given graph Gone needs to ”see”( or visit) every edge at least once.
I False statement as for example the computation of twins resp.connected components on G knowing G .
Cours II-2 Cours MPRI 2008–2009
Graph Representations
Quicksands
I To compute this invariant or this property of a given graph Gone needs to ”see”( or visit) every edge at least once.
I False statement as for example the computation of twins resp.connected components on G knowing G .
Cours II-2 Cours MPRI 2008–2009
Graph Representations
Exercice
Comment allier les avantages des deux representations ?liste d’adjacence : construction en O(n + m)Matrices d’adjacence : acces a un arc en O(1)
Espace O(n2) mais en gardant la possibilite d’ecrire desalogrithmes lineaires ?
Cours II-2 Cours MPRI 2008–2009
Graph Representations
Exercice
Comment allier les avantages des deux representations ?liste d’adjacence : construction en O(n + m)Matrices d’adjacence : acces a un arc en O(1)
Espace O(n2) mais en gardant la possibilite d’ecrire desalogrithmes lineaires ?
Cours II-2 Cours MPRI 2008–2009
Graph Representations
Auto-complemented representations
Initial Matrix
1 2 3 4
1 1 1 1 0
2 0 0 1 0
3 1 0 1 1
4 1 0 0 0
Tagged Matrix
1 2 3 4
1 0 1 0 0
2 1 0 0 0
3 0 0 0 1
4 0 0 1 0
Cours II-2 Cours MPRI 2008–2009
Graph Representations
Auto-complemented representations
Initial Matrix
1 2 3 4
1 1 1 1 0
2 0 0 1 0
3 1 0 1 1
4 1 0 0 0
Tagged Matrix
1 2 3 4
1 0 1 0 0
2 1 0 0 0
3 0 0 0 1
4 0 0 1 0
Cours II-2 Cours MPRI 2008–2009
Graph Representations
I At most 2n tags (bits).O(n + m′) with m′ << m.Dalhaus, Gustedt, McConnell 2000
I What can be computed using such representations ?Example : strong connected components of G , knowing G ?
Cours II-2 Cours MPRI 2008–2009
Graph Representations
I At most 2n tags (bits).O(n + m′) with m′ << m.Dalhaus, Gustedt, McConnell 2000
I What can be computed using such representations ?Example : strong connected components of G , knowing G ?
Cours II-2 Cours MPRI 2008–2009
Graph Representations
I Find a minimum sized representation
I If G is undirected a minimum is unique.
Cours II-2 Cours MPRI 2008–2009
Graph Representations
I Find a minimum sized representation
I If G is undirected a minimum is unique.
Cours II-2 Cours MPRI 2008–2009
Graph Representations
What is an elementary operation for a graph ?
I Traversing an edge or Visiting the neighbourhood ?
I It explains the very few lower bounds known for graphalgorithms on a RAM Machine.
I Our graph algorithms must accept any auto-complementedrepresentation.Partition Refinement
Cours II-2 Cours MPRI 2008–2009
Graph Representations
What is an elementary operation for a graph ?
I Traversing an edge or Visiting the neighbourhood ?
I It explains the very few lower bounds known for graphalgorithms on a RAM Machine.
I Our graph algorithms must accept any auto-complementedrepresentation.Partition Refinement
Cours II-2 Cours MPRI 2008–2009
Graph Representations
What is an elementary operation for a graph ?
I Traversing an edge or Visiting the neighbourhood ?
I It explains the very few lower bounds known for graphalgorithms on a RAM Machine.
I Our graph algorithms must accept any auto-complementedrepresentation.Partition Refinement
Cours II-2 Cours MPRI 2008–2009
Treewidth
Chordal graphsParcours en largeur lexicographique LexBFS
Interval graphs
Sur les algorithmes de graphes
Graph Representations
Treewidth
Cours II-2 Cours MPRI 2008–2009
Treewidth
k-trees
Recursive Definition
A clique with k+1 vertices is a k-tree. If G is a k-tree, then weobtain another k-tree G ′ by adding a new vertex and joining thisvertex to a k-clique of G .
Clearly a k-tree is a chordal graph.1-trees =ordinary trees2-trees = series-parallel networks
Cours II-2 Cours MPRI 2008–2009
Treewidth
Partial k-trees
A partial k-tree is a partial subgraph of a k-tree (deleting edgesand vertices)
Definition
Treewith(G)= least integer k s.t. G is a partial k-tree.
Cours II-2 Cours MPRI 2008–2009
Treewidth
Cours II-2 Cours MPRI 2008–2009
Treewidth
Cours II-2 Cours MPRI 2008–2009
Treewidth
Cours II-2 Cours MPRI 2008–2009
Treewidth
Tree decomposition
G = (V ,E ) has a tree decomposition D = (S ,T )S is a collection of subsets of V , T a tree whose vertices areelements of S such that :
(0) The union of elements in S is V
(i) ∀e ∈ E , ∃i ∈ I with e ∈ G (Si ).
(ii) ∀x ∈ V , the elements of S containing x form asubtree of T .
Definition
Decomp(G ) = MinD(MaxSi∈S{|Si | − 1})
Cours II-2 Cours MPRI 2008–2009
Treewidth
Tree decomposition
G = (V ,E ) has a tree decomposition D = (S ,T )S is a collection of subsets of V , T a tree whose vertices areelements of S such that :
(0) The union of elements in S is V
(i) ∀e ∈ E , ∃i ∈ I with e ∈ G (Si ).
(ii) ∀x ∈ V , the elements of S containing x form asubtree of T .
Definition
Decomp(G ) = MinD(MaxSi∈S{|Si | − 1})
Cours II-2 Cours MPRI 2008–2009
Treewidth
Tree decomposition
G = (V ,E ) has a tree decomposition D = (S ,T )S is a collection of subsets of V , T a tree whose vertices areelements of S such that :
(0) The union of elements in S is V
(i) ∀e ∈ E , ∃i ∈ I with e ∈ G (Si ).
(ii) ∀x ∈ V , the elements of S containing x form asubtree of T .
Definition
Decomp(G ) = MinD(MaxSi∈S{|Si | − 1})
Cours II-2 Cours MPRI 2008–2009
Treewidth
Tree decomposition
G = (V ,E ) has a tree decomposition D = (S ,T )S is a collection of subsets of V , T a tree whose vertices areelements of S such that :
(0) The union of elements in S is V
(i) ∀e ∈ E , ∃i ∈ I with e ∈ G (Si ).
(ii) ∀x ∈ V , the elements of S containing x form asubtree of T .
Definition
Decomp(G ) = MinD(MaxSi∈S{|Si | − 1})
Cours II-2 Cours MPRI 2008–2009
Treewidth
Cours II-2 Cours MPRI 2008–2009
Treewidth
Equivalences
1. ∀G , Treewidth(G ) = Decomp(G )
2. Treewidth(G ) = MinH triangulation of G{ω(H)− 1}3. Computing treewidth is NP-hard.
Cours II-2 Cours MPRI 2008–2009
Treewidth
Equivalences
1. ∀G , Treewidth(G ) = Decomp(G )
2. Treewidth(G ) = MinH triangulation of G{ω(H)− 1}
3. Computing treewidth is NP-hard.
Cours II-2 Cours MPRI 2008–2009
Treewidth
Equivalences
1. ∀G , Treewidth(G ) = Decomp(G )
2. Treewidth(G ) = MinH triangulation of G{ω(H)− 1}3. Computing treewidth is NP-hard.
Cours II-2 Cours MPRI 2008–2009
Treewidth
Other definitions of trewidth in terms of cop-robber games, usinggraph grammars ....But it turns out that this parameter is a fundamental parameterfor graph theory.