by nandemo · 14y ago · 0 comments
A DAG is a directed graph that has no (directed) loops. Consider the following:
A
/ \
v v
B C
\ /
v v
D
This is a DAG but not a tree, because it has an undirected loop but no directed loops.A tree is a connected undirected acyclic graph (or, equivalently, an undirected graph in which there is exactly one path between any pair of vertices).
A DAG may represent a tree (usually rooted) or it may not. Not all connected DAGs are trees e.g.:
a->b, a->c, b->d, c->d is a DAG, but not a tree.