Tree Edit Distance Library
This library is an implementation of Zhang and Shasha's algorithm [Zhang89] for calculating tree edit distance.
Usage
- Implement Tree interface.
- Implement EditScore interface for the Tree.
- Make a new TreeEditDistance instance with the EditScore instance, and execute calc method.
Example
Tree tree1 = makeMyTree1(); Tree tree2 = makeMyTree2(); EditScore score = new MyEditScore(); double dist = new TreeEditDistance(score).calc(tree1, tree2); System.out.println("distance: " + dist);
See test programs for more information.
Download
Include via maven:
<dependency> <groupId>de.unistuttgart.ims</groupId> <artifactId>tree-edit-distance</artifactId> <version>0.0.1</version> </dependency>
License
This library is distributed under the new BSD license. See LICENSE file.
Reference
[Zhang89] | Kaizhong Zhang, Dennis Shashs. Simple fast algorithms for the editing distance between trees and related problems. SIAM Journal on Computing, vol. 18, issue 6, 1989. |