A Compact Representation for Chordal Graphs

A Compact Representation for Chordal Graphs
Lilian Markenzon
Núcleo de Computação Eletrônica
Universidade Federal do Rio de Janeiro, Brasil
Paulo Renato da Costa Pereira
Seção de Engenharia de Sistemas
Instituto Militar de Engenharia, Brasil
May 2008
Basic Definitions
z
A graph G is said to be chordal when every cycle of length at least 4 has a
chord.
z
A clique is a subset of V that induces a complete subgraph of G.
z
A vertex v is said to be simplicial in G when Adj(v) is a clique of G.
z
σ = 〈v1, ..., vn〉 is a perfect elimination ordering (peo) when vi is simplicial
in the induced subgraph G[{vi, ..., vn}], 1 ≤ i ≤ n.
z
G is a chordal graph IFF admits a peo.
z
A total ordering of the maximal cliques Q1, …, Ql has the running
intersection property (RIP) if for each clique Qj, 2 ≤ j ≤ l, there exists a
clique Qi, 1 ≤ i ≤ j-1, such that, Qj ∩ (Q1∪ … ∪ Qj-1) ⊂ Qi.
Basic Definitions
A graph G is said to be chordal when every cycle of length at
least 4 has a chord.
4
1
5
7
2
6
3
Basic Definitions
z
A clique is a subset of V that induces a complete subgraph of G.
z
A vertex v is said to be simplicial in G when Adj(v) is a clique of G.
z
σ = 〈v1, ..., vn〉 is a perfect elimination ordering (peo) when vi is simplicial
in the induced subgraph G[{vi, ..., vn}], 1 ≤ i ≤ n.
1
2
8
7
9
4
5
3
6
Basic Definitions
z
A clique is a subset of V that induces a complete subgraph of G.
z
A vertex v is said to be simplicial in G when Adj(v) is a clique of G.
z
σ = 〈v1, ..., vn〉 is a perfect elimination ordering (peo) when vi is simplicial
in the induced subgraph G[{vi, ..., vn}], 1 ≤ i ≤ n.
1
2
8
7
9
4
5
3
6
Basic Definitions
z
σ = 〈9, 1, 8, 7, 6, 2, 5, 3, 4〉
z
1 is simplicial in G[ {1, 8, 7, 6, 2, 5, 3, 4} ]
8
1
2
4
7
5
3
6
Basic Definitions
z
G is a chordal graph IFF admits a peo.
A total ordering of the maximal cliques Q1, …, Ql has the running
intersection property (RIP) if for each clique Qj, 2 ≤ j ≤ l, there exists
a clique Qi, 1 ≤ i ≤ j-1, such that, Qj ∩ (Q1 ∪ … ∪ Qj-1) ⊂ Qi.
z
Let Q1 = {a,b,c,d}, Q2 = {e,f,a,b}, Q3 = {g,h,f}, Q4 = {b,f,k} be a
RIP ordering of the maximal cliques maximal of a chordal graph G.
z Q2 ∩ (Q1) ⊂ Q1
z Q3 ∩ (Q1 ∪ Q2) ⊂ Q2
z Q4 ∩ (Q1 ∪ Q2 ∪ Q3) ⊂ Q2
z
Representing Chordal Graphs
Let G = (V,E) be a connected chordal graph.
z
Traditional representation: adjacency lists
z
Another representation: maximal cliques
– The determination of E is not efficient
– Adjacency query is not efficient
A New Representation of Chordal Graphs
Goals
z
To reduce the computer storage
z
To recognize structural properties
z
To study these properties in a different way
Compact Representation
Let G = (V,E) be a chordal graph and Q1, …, Ql the
maximal cliques of G with a RIP ordering.
The compact representation of G is the sequence of
pairs CR(G) = [(Pj,Sj)], 1 ≤ j ≤ l, such that
z
S1 = ∅,
z
Sj = Qj ∩ (Q1∪ … ∪ Qj-1) and
z
Pj = Qj – Sj.
Compact Representation
z
Q1 = {a,b,c,d}, Q2 = {e,f,a,b}, Q3 = {g,h,f},
Q4 = {b,f,k}
CR1(G) = [ ({a,b,c,d}, ∅), ({e,f}, {a,b}), ({g,h}, {f}), ({k}, {b,f}) ]
z
Q1 = {f,g,h},
Q2 = {a,b,e,f}, Q3 = {c,d,a,b}, Q4 = {b,f,k}
CR2(G) = [ ({f,g,h}, ∅), ({a,b,e}, {f}), ({c,d}, {a,b}), ({k}, {b,f}) ]
d
a
e
g
c
b
f
h
k
Properties
Let G = (V,E) a chordal graph and its compact representation
CR(G) = [(P1,S1), (P2,S2), …, (Pl,Sl)].
Property 0. Qi= Pi∪ Si, 1 ≤ i ≤ l are the maximal cliques of G.
Property 1. [Pl, Pl-1, …, P1] is a peo of G.
z
CR1(G) = [ ({a,b,c,d}, ∅), ({e,f}, {a,b}), ({g,h}, {f}), ({k}, {b,f}) ]
peo = [k,g,h,e,f,a,b,c,d]
z
CR2(G) = [ ({f,g,h}, ∅), ({a,b,e}, {f}), ({c,d}, {a,b}), ({k}, {b,f}) ]
peo = [k,c,d,a,b,e,f,g,h]
Properties
Property 2. There is an associated clique-tree T = (VT,ET) such
that the edges are the pairs (Qj,Qi), for 2 ≤ j ≤ l and i is obtained by
i = max{t | Sj ∩ Pt ≠ ∅}.
CR1(G) = [ ({a,b,c,d}, ∅), ({e,f}, {a,b}), ({g,h}, {f}), ({k}, {b,f}) ]
Properties
Property 2. There is an associated clique-tree T = (VT,ET) such
that the edges are the pairs (Qj,Qi), for 2 ≤ j ≤ l and i is obtained by
i = max{t | Sj ∩ Pt ≠ ∅}.
CR1(G) = [ ({a,b,c,d}, ∅), ({e,f}, {a,b}), ({g,h}, {f}), ({k}, {b,f}) ]
{a,b,c,d}
Properties
Property 2. There is an associated clique-tree T = (VT,ET) such
that the edges are the pairs (Qj,Qi), for 2 ≤ j ≤ l and i is obtained by
i = max{t | Sj ∩ Pt ≠ ∅}.
CR1(G) = [ ({a,b,c,d}, ∅), ({e,f}, {a,b}), ({g,h}, {f}), ({k}, {b,f}) ]
{a,b,c,d}
{a,b}
{a,b,e,f}
Properties
Property 2. There is an associated clique-tree T = (VT,ET) such
that the edges are the pairs (Qj,Qi), for 2 ≤ j ≤ l and i is obtained by
i = max{t | Sj ∩ Pt ≠ ∅}.
CR1(G) = [ ({a,b,c,d}, ∅), ({e,f}, {a,b}), ({g,h}, {f}), ({k}, {b,f}) ]
{a,b,c,d}
{a,b}
{a,b,e,f}
{f}
{f,g,h}
Properties
Property 2. There is an associated clique-tree T = (VT,ET) such
that the edges are the pairs (Qj,Qi), for 2 ≤ j ≤ l and i is obtained by
i = max{t | Sj ∩ Pt ≠ ∅}.
CR1(G) = [ ({a,b,c,d}, ∅), ({e,f}, {a,b}), ({g,h}, {f}), ({k}, {b,f}) ]
{a,b,c,d}
{a,b}
{a,b,e,f}
{b,f}
{b,f,k}
{f}
{f,g,h}
Properties
S ⊂ V is a separator of G if two vertices in the same connected component of G are
in two distinct connected components of G[V – S].
S ⊂ V is a vertex separator for non-adjacent vertices u and v (a uv-separator) if the
removal of S from the graph separates u and v into distinct connected
components. When the pair of vertices remains unspecified, we refer to S as a
vertex separator.
Property 3.
z
{S2, S3, …, Sl} is the multiset of the minimal vertex separators.
z
V – (S2 ∪ S3 ∪ … ∪ Sl) is the set of simplicial vertices of G.
Properties: the adjacency query
Property 4. Let u ∈ Pi and v ∈ Pj. The vertices u and
v are adjacent in G if and only if
z
i = j or
z
i < j and u ∈ Sj or
z
i > j and v ∈ Si.
Obtaining the edges
Let pi = | Pi | and si = | Si |.
l
Property 5.
m = ∑( pi si + pi ( pi −1) / 2)
i =1
Algorithm
Step 1: Insert all the edges of P1;
Step 2: for i = 2, …, l:
Insert all the edges of Pi;
% p1(p1 – 1)/2 edges
% pi(pi – 1)/2 edges
Insert edges {u,v} such that u ∈ Si and v ∈ Pi; % pi.si edges
Complexity: O(m)
Some Results
Let Q* be the set of maximal cliques, S* the multiset of
minimal vertex separators , α =
∑| S |
and β =
Q∈Q *
S∈S *
l
From Property 3 α = ∑ si and from Property 0
i =1
Theorem 2.
Corollary 2.
∑| Q | .
l
β = ∑ ( pi + si )
α<m
β<n+m
i =1
Generating the Compact Representation
Let [v1, …, vn] be a peo obtained by a lex-bfs (lexicographic breath-first search).
Algorithm
k ← 1; P1 ← {vn}; S1 ← ∅;
for j = n–1, …, 1:
X ← Adj(vj) ∩ {vj+1, …, vn};
if X = Pk ∪ Sk then
Pk ← Pk ∪ {vj};
% clique Qk is enlarged
else
k ← k+1;
% new maximal clique
Pk ← {vj};
Sk ← X;
Memory Saving
Traditional representation: n + 2m
Appropriate representation: n + m
Compact representation: n + α
l
n +α
=
n+m
2∑ pi + si
i =1
l
∑ p ( p + 2s − 1)
i =1
i
i
i
d
a
e
g
c
b
f
h
k
n = 9, m = 25, α = 5
Saving = 58,8%
Some Examples
All graphs have 6 cliques of cardinality 5.
z Each graph Gi has 5 minimal vertex separators of cardinality i.
z
CR(G1) = [({a,b,c,d,e},∅), ({f,g,h,i},{e}), ({j,k,l,m},{i}), ({n,o,p,q},{m}),
({r,s,t,u}, {q}), ({v,x,y,z}, {u}) ]
CR(G2) = [({a,b,c,d,e},∅), ({f,g,h},{d,e}), ({i,j,k},{g,h}), ({l,m,n},{j,k}),
({o,p,q}, {m,n}), ({r,s,t}, {p,q}) ]
CR(G3) = [({a,b,c,d,e},∅), ({f,g},{c,d,e}), ({h,i},{e,f,g}), ({j,k},{g,h,i}),
({l,m}, {i,j,k}), ({n,o}, {k,l,m}) ]
CR(G4) = [({a,b,c,d,e},∅), ({f},{b,c,d,e}), ({g},{c,d,e,f}), ({h},{d,e,f,g}),
({i}, {e,f,g,h}), ({j}, {f,g,h,i}) ]
Saving1 = 64,7%
Saving2 = 57,1%
Saving3 = 50%
Saving4 = 25%
Applications: to recognize k-trees
Let G = (V,E) a chordal graph and its compact representation
CR(G) = [(P1,S1), (P2,S2), …, (Pl,Sl)].
Theorem 3. G is a k-tree IFF | P1 | = k + 1,
| Pi | = 1 and | Si | = k, for 2 ≤ i ≤ l.
Applications: to recognize planar chordal graphs
Let G = (V,E) a chordal graph and its compact representation
CR(G) = [(P1,S1), (P2,S2), …, (Pl,Sl)].
Theorem 4. G is planar IFF for 1 ≤ i ≤ l:
z
| Pi | + | Si | ≤ 4 and
z
if | Si | = 3 then Sj ≠ Sj, for 2 ≤ j ≤ l and i ≠ j.
Conclusions
z
Obtaining the representation efficiently
z
Saving memory
z
Obtaining structural properties immediately
– Maximal cliques
– Peo
– Minimal Vertex Separators
– Simplicial vertices
z
Testing if an edge exists and obtaining m efficiently
z
Making easier the development of applications