Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
User Journal

Journal Elwood P Dowd's Journal: Digraphs stored in a database

So there's this neat article on Modified Preorder Tree Traversal for storing hierarchical data in a database. It's of no use to me because I don't have any hierarchies to store in databases. I only ever work with digraphs. Does anyone know of any similarly handy algorithms for storing/retreiving digraphs? They're mostly acyclic, and maybe we could work at guaranteeing that, but nodes can definitely have two parents.

I just have a table for edges and a table for nodes with no special algorithmical sugars at all. It works great for dumping the whole digraph into a .dot file for graphviz, but anything else requires subquery after subquery. If we had an rdbms with recursive queries, we could use that, but something about recursive queries makes me go a cold wet one. Sounds like cheating and sounds like the wrong idea. Maybe there isn't a better way...

This discussion has been archived. No new comments can be posted.

Digraphs stored in a database

Comments Filter:

Pascal is not a high-level language. -- Steven Feiner

Working...