Schema eines gerichteten azyklischen Graphen: mehrere beschriftete Knoten sind durch Pfeile verbunden, ein Knoten hat zwei Vorgänger, daneben ein durchgestrichener Kreislauf aus drei Knoten als verbotener Zyklus.

Directed Acyclic Graph

A Directed Acyclic Graph is a network of points and arrows in which you can never walk in a circle. This structure describes dependencies and sequences and is found in software blueprints, data pipelines, and blockchain systems.

Imagine a plan in which tasks are drawn as points. Arrows run between the points: an arrow from A to B means that A must come before B. Such a network of points and arrows is called a graph in computer science. Because the arrows have a fixed direction, it is directed. And it is acyclic if you can never get back to a point by following the arrows starting from it. This exact combination is called a Directed Acyclic Graph, or DAG for short.

Why freedom from cycles is worth so much

A cycle in a dependency plan is a disaster. If task A waits for B, B waits for C, and C waits for A again, everything waits forever. Such situations are called deadlocks, meaning blockages a system can no longer escape. A DAG rules them out by its very construction. That’s why many programs first check whether their dependency network is truly free of cycles.

Freedom from cycles brings a second advantage as well. In a DAG, it is always possible to find at least one valid order in which all points can be processed. Experts call this a topological sort. In practice, this means a computer can work out for itself what it needs to start with and what comes next.

Furthermore, a computer immediately sees which tasks are independent of one another. Such tasks can be handled simultaneously on multiple processor cores. A large build process that would otherwise take an hour sequentially often shrinks to just a few minutes this way. This automatic parallelization is one of the main reasons for the popularity of DAGs.

Points, arrows, and the search for cycles

Formally, a DAG consists of nodes and edges. Nodes are the points, for example tasks, files, or computation steps. Edges are the arrows between them and represent a dependency. A node with no incoming arrows can start immediately. A node with three incoming arrows waits until all three predecessors are finished.

To check whether a graph is truly acyclic, an algorithm goes through it step by step. A common method repeatedly removes all nodes that no longer have any open predecessors. If no node remains at the end, the graph is free of cycles. If a remainder is left over, it contains a cycle, and the program reports an error.

A common misconception is equating a DAG with a tree. A tree is a special case: there, every node has at most one predecessor. In a DAG, by contrast, a node may have multiple predecessors. A component can thus depend on two different preliminary stages without the structure losing its freedom from cycles.

From data pipelines to the blockchain

In the everyday world of software development, DAGs are encountered above all in tools for data pipelines. A program like Apache Airflow explicitly describes every workflow as a DAG. Data is loaded, cleaned, evaluated, and then written into a report. Each step is a node, each dependency an arrow.

A DAG also lies behind the scenes when training AI models. The computation steps of a neural network form a computation graph. Frameworks like PyTorch use it to automatically calculate how each parameter influences the result. Without this structure, training large models would be practically infeasible.

In finance and tech news, the term also comes up in connection with cryptocurrencies. Some systems, such as IOTA or Hedera, store transactions not in a chain of blocks but in a DAG. Multiple transactions can then reference each other simultaneously, which theoretically allows for higher speed. When an article describes a technology as DAG-based, this is usually exactly what is meant.

Latest News

Subscribe free. Unsubscribe the second it sucks.

High-signal news across AI, business, UX, and tech. Every morning.