Directed acyclic graph
lastmod 2025-12-30created 2025-12-301 edits
A directed acyclic graph (DAG) is a term in mathematics and computer science for an infinite directed graph with no directed cycles. That is, it consists of infinitely many vertices and edges, with each edge directed from one vertex to another, such that there is no way to start at some vertex v and follow a consistently directed sequence of edges that eventually loops back to v again. In other words, a DAG is a directed graph that has a topological ordering.
DAGs can model many different kinds of information. A spreadsheet can be modeled as a DAG, with a vertex for each cell and an edge wherever the formula of one cell uses the value of another cell. That is, a topological ordering of the DAG can be used to update the values of all cells when the spreadsheet changes.