[Math] a directed acyclic graph (DAG)

definitiondirected graphsgraph theory

I am reading this link on Wikipedia; it states the following definition is given for a DAG.

Definition: A DAG is a finite, directed graph with no directed cycles.

Reading this definition believes me to think that the digraph below would be a DAG as there are no directed cycles here (there are cycles of the underlying graph but there are no directed cycles).

enter image description here

However, all the pictures on Wikipedia show examples of DAGs with arrows pointing the same way. So, I think I am interpreting this definition wrong. In particular, why does the definition mention later on an equivalent definition is that it must have topological ordering such that "every edge is directed from earlier to later in the sequence"? Reading the definition above would lead me to believe that the graph above is a DAG, but then the equivalent definition would make me think otherwise.

Best Answer

The graph you show is a DAG.

It is conventional to draw DAGs with all the arrows going in the roughly the same direction, because that usually gives a clearer intuition about what is going on in the graph.

But remember that locations and directions are not part of the formal definition of a graph -- they're just incidental features of the particular drawing at the graph you're looking at, and it would be the same graph if you drew the vertices in different locations on the paper.

(Even in your drawing, all the edges go in a broadly southeasterly direction -- or at least more southeast than northwest -- so you're actually following the convention).

In particular, why does the definition mention later on an equivalent definition is that it must have topological ordering such that "every edge is directed from earlier to later in the sequence"?

Because that is another way to define the same class of graphs, and sometimes (but not always) a more productive way to think about them. You should be able to prove that the finite directed graphs that have no directed cycles are exactly the same as the finite directed graphs that have a topological ordering.

Related Question