# Tree vs. DAG
A node in a DAG can be multiply connected. For example:
```
1 -> 2
1 -> 3
2 -> 4
3 -> 4
```
is a DAG, but if undirected the graph would contain a cycle. A DAG can also have unconnected nodes.
A tree has exactly one path between any two nodes. (Or, in a directed tree, every node has exactly one path from the root.) A DAG has a much weaker property that it is cycle-free, but there may be 0, 1, or many paths between two nodes.
---
Date: 20211026
Links to: [Algorithms and Data Structures](Algorithms%20and%20Data%20Structures.md)
Tags:
References:
* [Quora answer](https://www.quora.com/What-is-the-difference-between-a-DAG-and-a-tree-except-that-the-DAG-is-directed)