Table 1 shows the number λ(c) of layout types for
each possible cf-type c of a naphthalene ring. Among
the layout-types in L(c) for each cf-type c, we intro-
duce some total order, and denote by L
i
(c) the i-th
layout-type in L(c). In this paper, we assume that a
complete list of all layout types of each cf-type for
a naphthalene ring is available, where the total num-
ber of layout types is 23,911. An efficient method
for generating all layout types of a geometrical ob-
ject with two axial symmetries including naphthalene
ring has been discussed by He and Nagamochi (He
and Nagamochi, 2015).
Table 1: The number λ(c) of layout types for each possible
cf-type c of a naphthalene ring.
c λ(c) c λ(c)
(0,0,0,0,0,0,0,1) 1 (1,0,0,0,0,0,1,0) 2
(0,1,0,0,0,1,0,0) 10 (2,0,0,0,0,1,0,0) 14
(0,0,1,0,1,0,0,0) 14 (1,1,0,0,1,0,0,0) 42
(3,0,0,0,1,0,0,0) 84 (0,0,0,2,0,0,0,0) 22
(1,0,1,1,0,0,0,0) 70 (0,2,0,1,0,0,0,0) 114
(2,1,0,1,0,0,0,0) 210 (4,0,0,1,0,0,0,0) 420
(0,1,2,0,0,0,0,0) 140 (2,0,2,0,0,0,0,0) 280
(1,2,1,0,0,0,0,0) 420 (3,1,1,0,0,0,0,0) 840
(5,0,1,0,0,0,0,0) 1680 (0,4,0,0,0,0,0,0) 648
(2,3,0,0,0,0,0,0) 1260 (4,2,0,0,0,0,0,0) 2520
(6,1,0,0,0,0,0,0) 5040 (8,0,0,0,0,0,0,0) 10080
In the rest of this section, we discuss the structure
of isomorphism in tree representations.
Let T be a tree representation with virtual na
atoms of valence 8, which we restore naphthalene
rings to obtain a naphthalene isomer of T. Note that
E
T
(v,w) is a bridge of T for each pair of adjacent ver-
tices v,w ∈ V(T), and T[v, w] is the induced subtree
of T rooted at v such that V(T[v,w]) consists of v and
the vertices reachable from w without visiting v. Ev-
ery vertex v in T is shared by |N
T
(v)| subtrees T[v,w]
with w ∈ N
T
(v). For a subtree T
′
= T[v,w] for ver-
tices v ∈ V and w ∈ N(v) in T, restoration of T
′
is an
operation of expanding the na-vertices z (6= v) in T
′
into naphthalene rings H
z
to obtain a chemical graph
G
v
rooted at v, where v may be a na-vertex. Let G(T
′
)
be the set of tree-like graphs G
v
obtained by restoring
a subtree T
′
of T.
Our aim is to generate all isomers in G(T) from
a given tree representation T, supposing that we
know the cf-type c
v
of the coterie-family for the set
{G[v
i
,w
i
] | v
i
∈ V(H
v
), w
i
∈ N
G
(v
i
)} of subgraphs
around the naphthalene ring H
v
restored from each
na-vertex v in T. Since distinct isomers are caused by
different layout-types around naphthalene rings after
restoration of T, an isomer G ∈ G(T) can be specified
by a layout-type L[v] ∈ L(c
v
) of each na-vertex v in
T. Throughout the paper, we assume that non-rooted-
isomorphic subgraphs in {G[v
i
,w
i
] | v
i
∈ V(H
v
), w
i
∈
N
G
(v
i
)} can be arranged in some total order based
on their topological structure, and we assign indices
R
1
i
,R
2
i
,. .. to the coteries with the same size i accord-
ing to the order so that choosing a layout-type in
L(c
v
) uniquely determines the relative positions of all
the subgraphs in {G[v
i
,w
i
] | v
i
∈ V(H
v
), w
i
∈ N
G
(v
i
)}
around the naphthalene ring H
v
. However, when we
change a layout-type L[v] ∈ L(c
v
) for some na-vertex
v in T, the cf-type c
u
of some other na-vertex u may
change. To avoid such inconvenience in generating
all isomers in G(T), we designate a vertex in T as the
root and systematically compute the number of iso-
mers of some subtrees of T by a dynamic program-
ming, where all isomers of T will be generated by
backtracking the computation.
Let G(T[v,w]) denote the set of isomers obtained
from the tree T[v,w] by restoring all na-vertices z (6=
v) in T[v,w] into naphthalene rings H
z
. Clearly if
T[v,w] and T[v,w
′
] are rooted-isomorphic for w,w
′
∈
N
T
(v), then G(T[v,w]) = G(T[v,w
′
]). Conversely
T[v,w] and T[v,w
′
] are not rooted-isomorphic for
w,w
′
∈ N
T
(v), then G(T[v,w]) ∩ G(T[v,w
′
]) =
/
0.
Let us treat a given tree representation T as a tree
rooted at a vertex v
0
, where the root is chosen as a
topologically unique vertex in T such as “center” or
“centroid.” It is known that every tree has either a
vertex or an edge removal of which leaves no com-
ponent with more than ⌊n/2⌋ vertices. The former
vertex is called unicentroid and the latter bicentroid.
We choose the unicentroid of T as the root v
0
of T,
where if T has the bicentroid (v
′
,v
′′
), then we remove
the edge connecting v and v
′
and insert a virtual vertex
v with the two neighbors v
′
and v
′′
as the unicentroid
in the resulting tree. For each vertex v in a rooted
tree representation T = (V,E), let Ch(v) ⊆ N
T
(v) de-
note the set of children of v, where Ch(v) =
/
0 if v is
a leaf vertex of T. When v is not the root of T, let
p(v) ∈ N
T
(v) denote the parent of v. By the topolog-
ical uniqueness of the root v
0
, we see that for each
non-root vertex v, tree T[v,w] with w ∈ Ch(v) is not
rooted-isomorphic to tree T[v,p(v)].
The set Ch(v) of children of a vertex v in T
is decomposed into sets Ch
1
(v),Ch
2
(v),... ,Ch
t
(v)
such that the subtrees T[v,u] and T[v,u
′
] are rooted-
isomorphic if and only if u, u
′
∈ Ch
i
(v) for some i.
Fig. 4 illustrates the rooted-isomorphic decomposi-
tions of child sets of a tree presentation T. Note that
for a given tree presentation T rooted at a vertex v
0
,
we can compute the rooted-isomorphic decomposi-
tion {Ch
i
(v) | i = 1,2, .. .,t
v
} for all vertices v ∈ V in
polynomialtime in the size of T by expressing all sub-
trees T[v,u], u ∈ Ch(v) for each v ∈ V(T) as canoni-