Browse > Article
http://dx.doi.org/10.3745/KIPSTA.2004.11A.2.159

A Tree-Compare Algorithm for Similarity Evaluation  

Kim, Young-Chul ((주)뉴스텍시스템즈, 명지전문대학)
Yoo, Chae-Woo (숭실대학교 컴퓨터학부)
Abstract
In the previous researches, tree comparison methods are almost studied in comparing weighted or labeled tree(decorated tree). But in this paper, we propose a tree comparison and similarity evaluation algorithm can be applied to comparison of two normal trees. The algorithm converts two trees into node string using unparser, evaluates similarity and finally return similarity value from 0.0 to 1.0. In the experiment part of this paper, we visually presented matched nodes and unmatched nodes between two trees. By using this tree similarity algorithm, we can not only evaluate similarity between two specific programs or documents but also detect duplicated code.
Keywords
Similarity Evaluation; Tree Compare; Unparser; Node String;
Citations & Related Records
Times Cited By KSCI : 1  (Citation Analysis)
연도 인용수 순위
1 D. Bryant, 'Building Trees, Hunting for Trees, and Comparing Trees,' phD thesis, University of Caterbury, 1997
2 V. C. Bhavsar, H. Boley and L. Yang, 'A Weighted-Tree Similarity Algorithm for Multi-Agent Systems in E-Business Environments,' available at http://www.ruleml.org/indoo/BhavsarBoley Yang-Final.pdf
3 T. H. Cormen, C. E. Leiserson, R. L. Rivest, 'Introduction to Algorithms,' The MIT Press, 1994
4 E. Berk, 'Jlex : A Lexical Analyzer Generator for Java TM,' available at http://www.cs.princeton.edy/~appel/modern/java/JLex/
5 D. Robinson and L. Foulds, 'Comparison of Weighted Labelled Trees,' In lecture notes in mathematics, pp.119-126, Springer-Verlag, Germany, 1979   DOI
6 M. Steel and D. Penny, 'Distributions of tree comparison metrics-some new results,' syst. biol., 42(2), pp.126-141, 1993   DOI
7 Component Web Site available at http://taxonomy.zoology.gla.ac.uk/rod/cpw.html
8 A. H. B. ledsoe and F. H. Sheldon, 'Moecular homology and DNA hybridization,' J. Mol. E vol.30, pp.425-433, 1990   DOI
9 A. W. Cole, 'Prototype Tree Comparison Tools for Describing File Systems,' available at http://www.ldc.upenn.edu.Staff/acole/research/thesis.html, 2002
10 J. Lin, 'JLex Tutorial,' available at http://bmrc.berkeley.edu/courseware/ cs164/spring98/proj/jlex/tutorial.html
11 S. E. Hudson, 'CUP Parser Generator for Java,' available at http://www.cs.princeton.edy/~appel/modern/java/CUP/
12 I. D. Baxter, A. Yahin, L. Moura, M. San'Anna & L. Bier, 'Clone Detection using Abstract Syntax Trees,' In proc. of the international Conference on Software Maintenance, Bethesda, Maryland, pp.368-378, Nov., 1998   DOI
13 M. S. Waterman and T. F. Smith 'On the Similarity of Dendrograms,' journal of theoretical biology, 73, pp.789-800, 1978   DOI