com.github.tmatek.zhangshasha.TreeOperation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zhang-shasha-java Show documentation
Show all versions of zhang-shasha-java Show documentation
A Java implementation of Zhang-Shasha algorithm for ordered tree distance calculation.
Calculates a series of transformations required to transform one tree into another. Every
transformation has an associated cost. The sum of costs of all transformations is minimal - the tree distance.
package com.github.tmatek.zhangshasha;
/**
* Possible tree operations which transform one tree to another:
*
* - {@link #OP_DELETE_NODE}
* - {@link #OP_RENAME_NODE}
* - {@link #OP_INSERT_NODE}
*
*/
public enum TreeOperation {
/**
* Delete an existing node from the tree structure, promoting its children one level up.
*/
OP_DELETE_NODE,
/**
* Rename an existing node in the tree structure to a new label.
*/
OP_RENAME_NODE,
/**
* Insert a new node into the tree structure as a child of parent p
, at specified position
* k
, making m
next siblings children of the inserted node.
*/
OP_INSERT_NODE
}