Science  People  Locations  Timeline
Index: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Home > Directed acyclic graph


 

In mathematics, a directed acyclic graph, also called a dag, DAG, or acyclic directed graph, is a directed graph with no cycles; that is, for any vertex v, there is no directed path starting and ending on v. DAGs appear in models where it doesn't make sense for a vertex to have a path to itself; for example, if an edge uv indicates that v is a part of u, such a path would indicate that u is a part of itself, which is impossible.

Every directed acyclic graph has a topological sort, an ordering of the vertices such that each vertex comes before all vertices it has edges to.

DAGs can be considered to be a generalization of trees in which certain subtrees can be shared by different parts of the tree. In a tree with many identical subtrees, this can lead to a drastic decrease in space requirements to store the structure. Conversely, a DAG can be expanded to a forest of rooted trees using this simple algorithm:

If we explore the graph without modifying it or comparing nodes for equality, this forest will appear identical to the original DAG.

Some algorithms become simpler when used on DAGs instead of general graphs. For example, search algorithms like depth-first search normally must mark vertices they have already visited and not visit them again. If they fail to do this, they may never terminate because they follow a cycle of edges forever. Such cycles do not exist in DAGs.

Directed acyclic graphs have many important applications in computer science, including:

Graphs

Read more »

Non User