Linear-Time Algorithms for
Tree Root Problems
國立台灣大學 資訊工程學系
呂學一 (Hsueh-I Lu)
http://www.csie.ntu.edu.tw/~hil/
Coauthors
國立中正大學
資訊工程學系
張貿翔教授
大葉大學, 4/28-29 2006
中央研究院
資訊科學研究所
高明達教授
第二十三屆組合數學與計算理論研討會
2
To appear in
SWAT 2006, Riga, Latvia
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
3
Outline
Introduction
Algorithm 1: for the p-th tree-root problem
– p is even
– p is odd (sketch)
Algorithm 2: for the tree-root problem
(sketch)
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
4
The p-th tree root problem
F Input:
I a graph G = (V; E);
I a positive integer p.
F Output:
I A tree T on V
such that T p = G.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
5
p-th power
distance(u; v) · p
u
大葉大學, 4/28-29 2006
v
第二十三屆組合數學與計算理論研討會
6
T
2
T
8
8
7
7
3
3
5
5
6
6
2
2
1
1
4
4
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
7
The 2nd Tree Root Problem
8
8
7
7
3
3
5
5
6
6
2
2
1
1
4
4
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
8
The p-th tree root problem
F Input:
I a graph G = (V; E);
I a positive integer p.
F Output:
I A tree T on V
such that T p = G.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
9
Best previous algorithm
An O(jV j3 )-time algorithm by Kearney and Corneil,
appeared in Journal of Algorithms, 1998.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
10
For the case of p = 2
Lin and Skiena,
– SIAM Journal on Discrete Mathematics, 1995.
– A linear-time algorithm.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
11
Our first algorithm
For any input graph G = (V; E) and any positive
integer p, our algorithm solves the p-th tree root
problem in O(jV j + jE j) time.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
12
The tree root problem
F Input:
I a graph G = (V; E);
F Output:
I a tree T on V and
I a positive integer p
such that T p = G.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
13
Best previous algorithm
An O(jV j4 )-time algorithm by Kearney and Corneil,
appeared in Journal of Algorithms, 1998.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
14
Our second algorithm
For any input graph G = (V; E), our algorithm solves
the tree root problem in O(jV j + jE j) time.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
15
Related work
Motwani and Sudan
– Discrete Applied Math, 1994.
– Computing roots of graph is NP-hard.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
16
Bipartite Roots
L. C. Lau [SODA 2004]
– Square bipartite roots can be found in
polynomial time.
– Finding cubic bipartite roots is NP-complete.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
17
Lau and Corneil
SIAM J. on Discrete Math, 2004.
– P-time algorithms for recognizing
powers of proper interval graphs.
– NP-completeness for recognizing
squares
of chordal graphs,
squares of split graphs, and
chordal graphs that admit square roots.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
18
Planar graphs
Lin and Skiena,
– SIAM Journal on Discrete Mathematics, 1995.
– A linear-time algorithm for computing square
roots of planar graphs
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
19
Our algorithm for the
p-th tree root problem
Case 1: p is even
Case 2: p is odd (sketch)
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
20
Observation #1
Tree powers are chordal graphs
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
21
Chordal graph
De¯nition A graph G is chordal if any simple
k-cycle of G with k > 3 has a chord.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
22
Tree powers are chordal
8
8
7
7
3
3
5
5
6
6
2
2
1
1
4
4
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
23
Recognizing chordal graphs
Linear-time recognition algorithms
– Rose, Tarjan, and Leuker, SIAM J. Computing
1976.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
24
Step 1
Ensure in linear time that the input
graph is chordal.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
25
Observation #2
T2h has a unique clique tree.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
26
Clique trees of graphs
De¯nition A clique tree of a graph G is a tree T on
the maximal cliques of G such that for every vertex
v of G, the maximal cliques of G containing v induce
a subtree in T .
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
27
Example 1
i
g
h
a
b
h, b
b, f
g, i
f
b, e, f
c
d
e
a, b
c, d
b, d, f
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
28
Example 2
i
g
h
a
b
h, b
b, f
g, i
f
b, e, f
c
d
e
a, b
c, d
b, d, f
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
29
Example 3 The cliques containing f
i
g
h
h, b
a
b
b, f
g, i
f
b, e, f
c
d
e
a, b
c, d
b, d, f
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
30
Clique trees of chordal graphs
Theorem [Gavril 1974, Buneman 1974] A graph is
chordal if and only if it admits a clique tree.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
31
Our observation
For any positive integer h and any tree T ,
F the chordal graph T 2h admits a unique
clique tree; and
F the unique clique tree of T 2h has to be
isomorphic to the h-centroid T (h) of T .
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
32
h-centroid T(h) of T
F Let T (0) = T .
F For any h ¸ 1, let T (h) be the
tree obtained from T by deleting
the leaves of T .
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
33
T=T(0), T(1), T(2)
8
7
7
3
5
5
5
6
2
2
1
4
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
34
For example, h = 1
8
T2
admits a unique
clique tree which is
isormophic to the 1centroid T (1) of T .
7
3
5
6
2
1
4
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
35
T
2
T
8
8
7
7
3
3
5
5
6
6
2
2
1
1
4
4
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
36
Max cliques of T2
{5, 7, 8}
{2, 4, 5, 6, 7}
{1, 2, 3, 5}
8
5, 7, 8
7
2, 4, 5
6, 7
3
5
6
1, 2, 3, 5
2
1
4
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
37
The unique clique tree of T2
{5, 7, 8}
{2, 4, 5, 6, 7}
{1, 2, 3, 5}
8
5, 7, 8
7
2, 4, 5
6, 7
3
5
6
1, 2, 3, 5
2
1
4
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
38
Isomorphic to T(1)
{5, 7, 8}
{2, 4, 5, 6, 7}
{1, 2, 3, 5}
8
5, 7, 8
7
2, 4, 5
6, 7
3
5
6
1, 2, 3, 5
2
1
4
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
39
Step 2
Determine the shape of T (h) from the
unique clique tree of G = T 2h , which is
obtainable in linear time (see, e.g., Hsu
and Ma, SIAM J. Computing, 1999.)
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
40
Observation #3
The maximal cliques of T2h
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
41
Maximal cliques of T2h
The maximal clique corresponding
to node v of T 2h in the isomorphism
consists of the nodes of T whose distance to v in T is no more than h
(i.e., nbr T (v; h)).
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
42
The clique tree of T2
8
5, 7, 8
7
2, 4, 5
6, 7
3
5
6
1, 2, 3, 5
2
1
4
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
43
The nodes of T(h)
T
Let be the unique clique tree of T 2h .
If v is the node corresponding to maximal clique K of T 2h , then the maximal
cliques of T 2h containing v are those,
each of whose distance to K in T is at
most h, i.e., nbr T (K; h).
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
44
The clique tree of T2
8
5, 7, 8
7
2, 4, 5
6, 7
3
5
6
1, 2, 3, 5
2
1
4
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
45
Step 3
Determine T (h) by performing the following step
for each maximal clique K of G to identify the
node v corresponding to K in the isomorphism
between T (h) and the clique tree T of G:
F Let v be an arbitrary node G such that the
maximal cliques in nbr T (K; h) are exactly
the maximal cliques of G that contain v.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
46
The clique tree of T2
8
5, 7, 8
7
2, 4, 5
6, 7
3
5
6
1, 2, 3, 5
2
1
4
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
47
喘口氣、再繼續
What
we have?
– We know how to compute T(h).
What
remains?
– We have to determine the rest of T.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
48
Maximal cliques of T2h
The maximal clique corresponding
to node v of T 2h in the isomorphism
consists of the nodes of T whose distance to v in T is no more than h
(i.e., nbr T (v; h)).
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
49
The clique tree of T2
8
5, 7, 8
7
2, 4, 5
6, 7
3
5
6
1, 2, 3, 5
2
1
4
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
50
The nodes of T(h-1)-T(h)
Let T be the unique clique tree of T 2h .
Let v be the node corresponding to maximal clique
K of T 2h .
If u a node in T (h ¡ 1) ¡ T (h) whose distance to v in
T is 1, then the maximal cliques of T 2h containing u
are exactly those in nbr T (K; h ¡ 1).
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
51
The clique tree of T2
8
5, 7, 8
7
2, 4, 5
6, 7
3
5
6
1, 2, 3, 5
2
1
4
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
52
The nodes of T(i)-T(i+1)
Let T be the unique clique tree of T 2h .
Let v be the node corresponding to maximal clique
K of T 2h .
If u is a node of T (i) ¡ T (i+ 1) whose distance to v in
T is h ¡ i, then the maximal cliques of T 2h containing
u are exactly those in nbr T (K; i).
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
53
Illustration
distanceT (u; v) = h ¡ i
u
v
nbr T (h) (v; i).
T
nbr T (K; i).
T
2 T (i) ¡ T (i + 1)
K
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
54
Coordinate
Let u be a node of T . If
F v is the node of T (h) closest to u in T ; and
F the distance between u and v in T is h ¡ i,
then (v; i) is the coordinate of u in T
For instance,
F (u; h) is the coordinate of each node u in T (h), and
F the coordinate of each leaf of T has the form (v; 0) for
some node v in T (h).
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
55
The coordinate of u in T is (v; i).
distanceT (u; v) = h ¡ i
T
u
v
2 T [h]
2 T (i) ¡ T (i + 1)
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
56
For example, h=1
F (z; 1) is the coordinate of node z.
F (y; 1) is the coordinate of node y.
F (y; 0) is the coordinate of nodes c and d.
F (x; 0) is the coordinate of nodes a and b.
e
7
z
b
5
y
d
2
x
a
c
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
57
“Recover” T from T(h)
If we have the coordinate of each node in T ,
then we can \recover} T from T (h):
F If (v; i) with i < h is the coordinate of
node u in T , then add an edge between
u and a node whose coordinate in T is
(v; i + 1).
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
58
Candidate coordinates
We cannot be sure of the coordinate of each node u
of T ¡ T (h). We can only its candidate coordinates
as follows.
F Let K1 ; : : : ; K` be the maximal cliques of T 2h
that contain u.
F Let vj be the node of T (h) that corresponds to
Tj .
F If fK1 ; : : : ; K` g = nbr T (Kj ; i), then (vj ; i) is a
possible coordinate of u in T .
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
59
Step 4
For each node u of G not in T (h), determine
all the possible coordinates of u in T .
(We show that this step can be implemented
to run in linear time.)
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
60
Illustration
distanceT (u; v) = h ¡ i
u
v
nbr T (h) (v; i).
T
nbr T (K; i).
T
2 T (i) ¡ T (i + 1)
K
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
61
The challenge
In order to recover T from T (h), we have
to overcome the problem that there could be
more than one possible coordinate for a node
not in T (h).
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
62
h=3
a
b
y
z
x
e
d
c
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
63
3 nodes with unique coordinates
a: (y, 0); c: (x, 0), d: (x, 1)
a
b
y
z
x
e
d
c
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
64
b: (y, 1) and (x, 2)
e: (y, 1) and (x, 2)
a
b
y
z
x
e
d
c
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
65
Our solution
Let the level `(u) of u be the largest integer ` such
that u has a candidate coordinate (¢; `).
Let x(u) be an arbitrary node of T (h) such that
(x(u); `(u)) is a candidate coordinate of u.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
66
Our solution
F Sort the nodes of T ¡ T (h) in the increasing order of
their levels. Let ui be the i-th node in the list.
F If x(ui ) is still unmarked, we then mark x(ui ) and do
the following steps for each j = `(ui ) to h:
I Let (x(ui ); j) be the chosen coordinate for an arbitrarily node without a chosen coordinate such that
(x(ui ); j) is one of its candidate coordinate.
F For each node without chosen coordinate, we arbitrarily assign one of its candidate coordinates as its
chosen coordinate.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
67
Our algorithm for the
p-th tree root problem
Case 1: p is even
Case 2: p is odd (sketch)
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
68
Duality (even p odd p)
Maximal clique
Minimal vertex separator.
Unique clique tree of T2h
Unique vertex separator tree of T2h+1.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
69
Our algorithm for the
tree root problem
Case 1: the unknown p is even (sketch)
Case 2: the unknown p is odd (omitted)
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
70
Theorem
Let J consist of the even numbers j such that there are
¤
¤
nodes with candidate coordinates (v ; j=2), where v is
a center of T (h). Let d be the diameter of T (h). Let D
be the number of dominating nodes of T 2h . Let
8
<
max J
if D = 0;
¤
p = : d + D ¡ 1 if 1 · D · 2;
2dd=2e + 2 if D ¸ 3:
¤
Then, T 2h admits a p -th tree root.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
71
Acknowledgement
Part of the materials in this talk are
modified from Prof. Ming-Tat Ko’s slides.
大葉大學, 4/28-29 2006
第二十三屆組合數學與計算理論研討會
72
Linear-Time Algorithms for
Tree Root Problems
國立台灣大學 資訊工程學系
呂學一 (Hsueh-I Lu)
http://www.csie.ntu.edu.tw/~hil/
© Copyright 2026 Paperzz