Do you know any reference where to find SQL queries for traversing trees/graphs?
I found this one: http://www.artfulsoftware.com/mysqlbook/sampler/mysqled1ch20.html and Celko’s book.
Problem is that the majority of resources I found refers to adiacency model trees, I’m using a normal edge list model.
Eg. queries or procedures to extract subpaths, subtrees, etc.
Thanks
Nested sets models are best for hierarchical aggregations. Traversals for general graphs are best done with the adjacency list model. But I have used nested sets for convergent graphs by splitting nodes
Becomes
Since nests sets keep nodes in a separate table, this is easy.
You can also do a general graph as a forest of all possible spanning trees