Special Graphs

  1. A Directed Acyclic Graph (DAG) is a directed graph that contains no directed cycles.

    In a DAG, it is impossible to start at a vertex and follow directed edges back to the same vertex.
    This digraph is acyclic because there is no directed path that returns to its starting vertex.

    This digraph is acyclic because there is no directed path that returns to its starting vertex. Miriam Briskman, CC BY-NC 4.0.

    \documentclass[border=1pt]{standalone}
    \usepackage{tikz}
    \usetikzlibrary{arrows.meta}
    
    \tikzset{
    vertex/.style={draw, circle, very thick, minimum size=1cm},
    edge/.style={very thick, -Triangle}
    }
    
    \begin{document}
    
    \begin{tikzpicture}
    
    \node[vertex] (1) at (0,0) {$1$};
    \node[vertex] (2) at (3,1) {$2$};
    \node[vertex] (3) at (3,-1) {$3$};
    \node[vertex] (4) at (6,0) {$4$};
    
    \draw[edge] (1) -- (2);
    \draw[edge] (1) -- (3);
    \draw[edge] (2) -- (4);
    \draw[edge] (3) -- (4);
    
    \end{tikzpicture}
    
    \end{document}