Directed acyclic graph


In mathematics and computer science, a directed acyclic graph (DAG /ˈdæɡ/), is a directed graph with no directed cycles. That is, it is an object that consists of vertices and edges, with each edge directed from one vertex to another, such that there is no way to start at any vertex v and follow a consistently-directed sequence of edges that eventually loops back to v again. Equivalently, a DAG may be characterized as a directed graph that has a topological ordering, a sequence of the vertices such that every edge is directed from earlier to later in the sequence.