To better understand what a directed acyclic graph is, let’s break down its components:
Nodes: Nodes, also known as vertices, represent entities, objects or variables on a graph. They are typically depicted as dots or circles.
Edges: Edges represent connections between entities. They are depicted as lines.
Directed edges: Directed edges represent connections that might be traversed in only 1 direction. Arrows on such edges indicate their direction.
Directed graphs: Graphs made up entirely of directed edges are directed graphs or digraphs. In contrast, graphs without directed edges are undirected graphs.
Colliders: Colliders are nodes that have 2 directed edges pointing at them.
Paths: Paths are a sequence of edges connecting 1 given node to another. Paths consisting entirely of directed edges are known as directed paths. Directed paths that indicate causal relationships are called causal paths.
Tree: In computer science, a tree is a directed acyclic graph in which every node has only 1 directed edge pointing to it, save for the starting node (the “root” node). While edges extend from the root node, no edges point to the root node.
In addition to understanding the parts of a DAG, it’s also important to recognize 1 component that it lacks: a cycle. The “acyclic” in directed acyclic graph refers to the absence of cycles or closed loops in these graphs. In other words, when starting at 1 node in a DAG and traversing subsequent nodes and edges, it’s impossible to return to the starting node.