Wednesday, March 27, 2013

graph vs tree



  • Introduction

Realize that all trees are graphs. A tree is a special case of a graph, one whose nodes are all reachable from some starting node and one that has no cycles.
Graph (c) does not have any cycles, as one less edge than it does number of nodes, and all nodes are reachable. Therefore, it is a tree.
http://msdn.microsoft.com/en-us/library/ms379574(v=vs.80).aspx



  • A tree is a connected graph with no cycles

https://docs.google.com/viewer?a=v&q=cache:2B00UUiFWB0J:www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15251-f09/Site/Materials/Lectures/Lecture18/lecture18.pdf+&hl=en&pid=bl&srcid=ADGEESh21IGgvVbbit2jwxSTnGhgmrTQ7ygsouGco178oA5Zj-HGbftJXWYOo6zmIzJVrz1KflxLwogoo8SkPw6iQOVKvx0fJ6-yOdeZwucLjGfNtXr2MLtxnOwRQKyxN0QFE-R3pEMo&sig=AHIEtbTjJflUVZU-sehW22YfIRzxWuFFUg

A Tree is just a restricted form of a Graph.
Trees have direction (parent / child relationships) and don't contain cycles.
They fit with in the category of Directed Acyclic Graphs (or a DAG)
http://stackoverflow.com/questions/7423401/whats-the-difference-between-the-data-structure-tree-and-graph

Tree is a hierarchical model.
Graph is a network model.
http://freefeast.info/difference-between/difference-between-trees-and-graphs-trees-vs-graphs/

No comments:

Post a Comment