DAG vs Tree
A tree gives every node just one parent, but a DAG lets a step wait on two or more steps. Both have no loops. Only the DAG can join paths back together.
Directed Acyclic Graph (DAG)
A graph of one-way arrows with no loops. It shows what must come first.
A directed acyclic graph is a graph where every link points one way and no path loops back. Directed means each edge has an arrow. Acyclic means you can never follow the arrows back to where you began. That makes it perfect for steps that must happen in order. Task runners, build tools and Git history all use one.
Tree (Data Structure)
Nodes joined in a branching shape, with one root at the top and no loops.
A tree is a data structure made of nodes joined in a branching shape. It has one node at the top, called the root. Each node can have child nodes below it, and nodes with no children are called leaves. There are no loops: you can never walk back to where you started. Folders on a computer and the HTML of a web page are both trees.
In one line
- Directed Acyclic Graph (DAG)
- A graph of one-way arrows with no loops. It shows what must come first.
- Tree (Data Structure)
- Nodes joined in a branching shape, with one root at the top and no loops.