Then, Table 7 illustrates the total and average run-
ning time (msec.) of determining whether or not
P ⊴ T by CATCATISO* and CATCATISO2* and of
determining whether or not P ⊑ T by CATCATINC.
Table 7: The total and average running time (msec.) of de-
termining whether or not P ⊴ T by CATCATISO* and CAT-
CATISO2* and of determining whether or not P ⊑ T by
CATCATINC.
CATCATISO*/ISO2* CATCATINC
data total ave. total ave.
N-glycans 4,788/4,721 0.02 16,075 0.06
all-glycans 611,103/603,052 0.01 2,221,026 0.04
CSLOGS 13,211,929/13,497,908 0.01 83,129,368 0.05
dblp
1%
73,315,987/73,548,291 0.03 143,584,440 0.05
SwissProt 3,706,628/3,696,157 0.08 7,291.159 0.16
Nasa
−
◦
11/11 0.01 29 0.03
Protein
−
◦
164,107/164,240 0.01 596,332 0.02
University
−
◦
1/1 0.00 9 0.01
As stated in the previous sections, the algorithm
CATCATINC runs in O((h + H)σ) time (Theorem 4)
and the algorithms CATCATISO* and CATCATISO2*
run in O(hHσ) time (Theorem 5). On the other hand,
Table 7 shows that the algorithms CATCATISO* and
CATCATISO2* are much faster than the algorithm
CATCATINC. One of the reasons is that, whereas
the main loop in the algorithm CATCATINC is re-
peated at near to h + H times, the for-loop in the
algorithms CATCATISO* and CATCATISO2* are re-
peated at much smaller than H times.
Furthermore, Table 8 illustrates the number
(#pairs) of pairs (P,T ) such that P ⊴ T and P ⊑
T (Miyazaki et al., 2022) with its ratio (%) in all the
pairs.
Table 8: The number (#pairs) of pairs (P,T ) such that P ⊴ T
and P ⊑ T with its ratio (%) in all the pairs.
P ⊴ T P ⊑ T
data #pairs % #pairs %
N-glycans 17,505 6.67 21,919 8.35
all-glycans 646,170 1.01 907,776 1.42
CSLOGS 1,979,560 0.11 2,277,568 0.13
dblp
1%
364,182,693 13.79 364,184,642 13.79
SwissProt 1,400,455 3.03 1,400,455 3.03
Nasa
−
◦
108 10.23 108 10.23
Protein
−
◦
3,701 0.01 3,701 0.01
University
−
◦
1 0.15 1 0.15
Table 8 shows that, whereas #pairs such that P ⊴ T
is smaller than #pair such that P ⊑ T for N-glycans,
all-glycans, CSLOGS and dblp
1%
, the former is equal
to the latter for SwissProt, Nasa
−
◦
, Protein
−
◦
and
University
−
◦
; Nevertheless, for these data, we can de-
termine P ⊴ T faster than P ⊑ T shown in Table 7.
5 CONCLUSION
In this paper, we have designed the algorithms of
CATCATISO and CATCATISO2 to solve the subcater-
pillar isomorphism between caterpillars and given the
experimental results of comparing them with the sub-
caterpillar isomorphism algorithms of CATTREEISO
and CATTREEISO2 and the caterpillar inclusion al-
gorithm CATCATINC.
Then, the algorithms of CATCATISO and CAT-
CATISO2 are faster than the algorithms of CAT-
TREEISO and CATTREEISO2 for subcaterpillar iso-
morphism between caterpillars. Also, whereas the al-
gorithm CATCATINC is faster than the decision ver-
sions CATCATISO* and CATCATISO2* in theoreti-
cal, the latter is faster than the former in experimental.
Since Theorem 1 for the subtree isomorphism also
holds for unrooted trees, it is a future work to extend
the algorithms in this paper to unrooted subcaterpil-
lar isomorphism between caterpillars. In particular,
it is necessary to investigate whether or not the un-
rooted subcaterpillar isomorphism between caterpil-
lars can avoid to the SETH-hardness of subtree iso-
morphism (Abboud et al., 2018).
REFERENCES
Abboud, A., Backurs, A., Hansen, T. D., v. Williams, V.,
and Zamir, O. (2018). Subtree isomorphism revisited.
ACM Trans. Algo., 14:27.
Gallian, J. A. (2007). A dynamic survey of graph labeling.
Electorn. J. Combin., 14:DS6.
Kilpel
¨
ainen, P. and Mannila, H. (1995). Ordered and un-
ordered tree inclusion. SIAM J. Comput., 24:340–356.
Miyazaki, T., Hagihara, M., and Hirata, K. (2022). Cater-
pillar inclusion: Inclusion problem for rooted labeled
caterpillars. In Proc. ICPRAM ’22, pages 280–287.
Miyazaki, T. and Hirata, K. (2022). Subcaterpillar isomor-
phism: Subtree isomorphism restricted pattern trees to
caterpillars. In Proc. FedCSIS ’22, pages 351–356.
Muraka, K., Yoshino, T., and Hirata, K. (2019). Vertical
and horizontal distances to approximate edit distance
for rooted labeled caterpillars. In Proc. ICPRAM’19,
pages 590–597.
Shamir, R. and Tsur, D. (1999). Faster subtree isomor-
phism. Algorithmica, 33:267–280.
ICPRAM 2023 - 12th International Conference on Pattern Recognition Applications and Methods
94