timtadh/zhang-shasha

Can this code handle trees that have the same child but different parents?

adamalfian opened this issue · 1 comments

for example, I have a tree design where there are two parent nodes that have relations to the same child node. can this code handle this problem?

@adamalfian most likely no. What you have is a rooted directed acyclic graph not a tree. You will likely need either a different algorithm or to transform your graph into a tree by duplicated the subtrees that are pointed to by multiple parents.