Search⌘ K
AI Features

What Is a DAG?

Explore directed acyclic graphs or DAGs to understand how they represent task dependencies and data flow within machine learning pipelines. This lesson helps you grasp DAG concepts and their practical use in organizing pipeline tasks without loops.

Introduction to DAGs

In graph theory, a directed acyclic graph (DAG) is a set of vertices or nodes connected by edges so that:

  • Every edge is unidirectional.

  • There are no loops in the graph if we follow the edge directions.

This will become clear after we see a few examples.

A simple directed graph
A simple directed graph

The above figure shows a simple graph. This is a directed graph because if we start at vertex a and follow the edge connected to it, we end up at b. If we start at vertex b, we can’t go to any other node because the only connected edge is directed toward it.

A directed graph with a loop
A directed graph with a loop

The figure above shows a graph with three vertices, a, b, and c. This is ...