3 ms·
A tree is a type of graph. Also, if your graph has cycles you could end up with infinite levels of nesting. Trees are simpler by definition.
by kickopotomus 8y ago
A tree is a type of graph. Also, if your graph has cycles you could end up with infinite levels of nesting. Trees are simpler by definition.
- rbkillea 8y agoI think that the distinction that dustingetz was trying to make is related to the fact that trees are graphs. Many applications naively nest data in tree structures with links from nodes to other nodes that are implied by the data. Maps are powerful enough to represent arbitrary graphs, so if you don't take advantage of this you end up with a lot of duplicated data in tree format. Then you need to do a bunch of tree traversals to link the data to itself at query time.
- dustingetz 8y agographs are more general! we could argue which is simpler. Graphs store data in normal form. Trees are denormalized.