How to modify preorder tree traversal algorithm to handle nodes with multiple parents?

Posted by poldo on Stack Overflow See other posts from Stack Overflow or by poldo
Published on 2010-04-21T09:01:25Z Indexed on 2010/04/21 10:43 UTC
Read the original article Hit count: 257

Filed under:
|

I've been searching for a while now and can't seem to find an alternative solution. I need the tree traversal algorithm in such a way that a node can have more than 1 parent, if it's possible (found a great article here: Storing Hierarchical Data in a Database). Are there any algorithms so that, starting from a root node, we can determine the sequence and dependencies of nodes (currently reading topological sorting)?

© Stack Overflow or respective owner

Related posts about algorithm

Related posts about tree-traversal