 Every directed acyclic graph has a topological ordering , an ordering of the vertices such that the starting endpoint of every edge occurs earlier in the ordering than the ending endpoint of the edge . The existence of such an ordering can be used to characterize DAGs : a directed graph is a DAG if and only if it has a topological ordering . In general , this ordering is not unique ; a DAG has a unique topological ordering if and only if it has a directed path containing all the vertices , in which case the ordering is the same as the order in which the vertices appear in the path . 
 Every directed acyclic graph <a href='got' title='1'><mark>has</mark></a> a topological ordering , an ordering of the vertices such that the starting endpoint of every edge <a href='uninflect' title='2'><mark>occurs</mark></a> earlier in the ordering than the ending endpoint of the edge . The existence of such an ordering can be used to characterize DAGs : a directed graph is a DAG if and only if it <a href='got' title='3'><mark>has</mark></a> a topological ordering . In general , this ordering <a href='negative_concord' title='4'><mark>is</mark></a> <a href='negative_concord' title='5'><mark>not</mark></a>unique ; a DAG <a href='got' title='6'><mark>has</mark></a> a unique topological ordering if and only if it <a href='got' title='7'><mark>has</mark></a> a directed path containing all the vertices , in which case the ordering <a href='drop_aux' title='8'><mark>is</mark></a>the same as the order in which the vertices appear in the path . 
Every directed acyclic graph got a topological ordering , an ordering of da vertices such dat tdastarting endpoint of every edge occur earlier in the ordering than the ending endpoint of thdadge . Thedaistence of such an ordering can be used to characterize DAGs : a directed graph is a DAG if and only if it got a topological ordering . In general , this ordering ain't unique ; a DAG got a unique topological ordering if and only if it got a directed path containing all the vertices , in which case the daering the same as the order in which the vertices appear in the pda .