Log in Sign up
Back to Discover
🔢

Directed acyclic graph

math Maturity 11-13

Think of points joined by lines.

Tred-G.svg
Tred-G.svg
The lines have arrows. These arrows show you where to go. You can follow them in a path. But you can never go in a circle. You will never end up where you started. This helps us plan things. It can even show a family tree.
EgyptianPtolemies2.jpg
EgyptianPtolemies2.jpg
Can you find a path?

59 words

Imagine points joined by lines.

Tred-G.svg
Tred-G.svg
Each line has an arrow. These arrows show a direction. You can follow them like a path. But you can never make a loop. You will never end up back at the start.

This helps us organize things. It can show a family tree.

EgyptianPtolemies2.jpg
EgyptianPtolemies2.jpg
It can also help plan tasks. Some tasks must happen before others. This keeps everything in order.

Scientists use these maps too. They use them to study how families grow. They also use them to study how germs spread. It is a great way to see how things connect.

100 words

Imagine points joined by lines with arrows.

Tred-G.svg
Tred-G.svg
The arrows show a direction. You follow them like a path. In this special map, you can never make a loop. You will never end up back where you started. This type of map is called a directed acyclic graph. People often call it a DAG for short.

Because there are no loops, we can put the points in a line. This is called a topological ordering. It is like a schedule. Each point must come before the next one in the line. This helps us organize tasks. For example, some jobs must finish before new ones start.

Pert chart colored.svg
Pert chart colored.svg
Computers use this to plan work.

We also use these maps to show how things connect. A family tree is a good example.

EgyptianPtolemies2.jpg
EgyptianPtolemies2.jpg
It shows how people are related. Scientists also use them to study how germs spread. They can even show how books cite each other. These maps help us see the order of the world.

167 words

Imagine a map made of dots and arrows. The dots are called vertices, and the arrows are called edges. Each arrow points from one dot to another, showing you which way to go. In most maps, you might follow a path and end up back where you started. This is called a cycle. But in a special kind of map called a directed acyclic graph, or a DAG, there are no cycles.

Tred-G.svg
Tred-G.svg
You can follow the arrows as much as you want, but you will never walk in a closed loop. This makes the graph very organized and predictable.

Because there are no loops, we can arrange the dots in a specific order. This is called a topological ordering. In this line, every arrow points from an earlier dot to a later dot. It is like a schedule for a long project. You can think of it as a list of steps that must happen in order.

Pert chart colored.svg
Pert chart colored.svg
If one task must finish before another begins, the DAG shows that rule clearly. This helps people and computers plan complex work without getting stuck in a circle.

Mathematicians use DAGs to study how things connect. One way to look at these connections is through reachability. This tells us if you can get from one dot to another by following the arrows. We can use a "transitive closure" to show every possible connection between dots. Or, we can use a "transitive reduction" to make the map simpler. A transitive reduction uses the fewest arrows possible to show the same connections.

Hasse diagram of powerset of 3.svg
Hasse diagram of powerset of 3.svg
This creates a clean drawing called a Hasse diagram.

These maps are very useful in many different sciences. Biologists use them to map out family trees or how living things evolve.

EgyptianPtolemies2.jpg
EgyptianPtolemies2.jpg
They also use them to study how germs spread through a group of people. In information science, DAGs can show how different books cite one another. Even computer software uses them to keep track of files. If you change one piece of code, the DAG helps the computer know which other parts need to be updated.

Computers are very good at working with these structures. There are special ways for a computer to find a topological order quickly. One method is called Kahn's algorithm. It works by looking for dots that have no arrows pointing into them. It adds those dots to a list and then checks the neighbors.

Graph Condensation.svg
Graph Condensation.svg
This process continues until every dot has been placed in the right order. Using these tools, we can solve many hard problems in science and math.

436 words

A directed acyclic graph, often called a DAG, is a specific type of mathematical structure used in graph theory and computer science. A graph is composed of objects called vertices connected by lines called edges. In a directed graph, every edge has a specific orientation, meaning it points from one vertex to another. A DAG is unique because it contains no directed cycles. A cycle occurs when you can follow a sequence of edges and return to your starting vertex. In a DAG, following the arrows will never form a closed loop.

Tred-G.svg
Tred-G.svg

One of the most important properties of a DAG is that it can be topologically ordered. A topological ordering is a linear sequence of all vertices in the graph. In this sequence, every directed edge points from a vertex that appears earlier to a vertex that appears later. This property is actually an equivalent definition of a DAG. If a graph can be topologically ordered, it is guaranteed to be acyclic. Conversely, every directed acyclic graph possesses at least one such ordering.

Pert chart colored.svg
Pert chart colored.svg

Mathematicians study the connections within a DAG using the concept of reachability. A vertex is reachable from another if there is a directed path between them. This reachability relation can be formalized as a partial order on the vertices. From this, we can derive two important related graphs. The transitive closure is a graph containing the maximum number of edges that preserves the same reachability. It includes an edge for every pair of vertices where a path exists. In contrast, the transitive reduction is the graph with the fewest possible edges that maintains the same reachability.

Hasse diagram of powerset of 3.svg
Hasse diagram of powerset of 3.svg

Transitive reductions are particularly useful for creating clear visual representations of partial orders. When a transitive reduction is drawn so that the starting vertex of every edge is lower than the ending vertex, it is called a Hasse diagram. This method simplifies complex relationships by removing redundant edges. For example, if a path exists from vertex A to B and from B to C, a transitive reduction would remove the direct edge from A to C. This leaves only the essential connections needed to understand the structure.

Hasse diagram of powerset of 3.svg
Hasse diagram of powerset of 3.svg

There are several specialized types of directed acyclic graphs. A multitree is a DAG where there is at most one directed path between any two vertices. A polytree is a specific kind of multitree created by orienting the edges of an undirected tree. An arborescence is a polytree where all edges are directed away from a single starting vertex known as the root. These variations allow scientists to model different types of hierarchical or branching structures with high precision.

Computing with DAGs is a major focus in computer science. Topological sorting is the algorithmic task of finding a topological ordering for a given DAG. This can be achieved in linear time. One common method is Kahn's algorithm. This algorithm works by maintaining a list of vertices that have no incoming edges. It repeatedly adds these vertices to the ordering and checks if their neighbors now have no incoming edges. Another method involves using a depth-first search to create a postorder numbering, which is then reversed.

Graph Condensation.svg
Graph Condensation.svg

DAGs are essential for solving complex scheduling and dependency problems. In project management, they represent tasks that must follow a specific order. For instance, a spreadsheet uses a dependency graph to update cells. If one cell changes, the DAG identifies which other cells must be recalculated. They are also used in biology to map evolution, family trees, and the spread of diseases in epidemiology.

EgyptianPtolemies2.jpg
EgyptianPtolemies2.jpg
In information science, they can model citation networks to show how research builds upon previous work.

Finally, any directed graph can be transformed into a DAG through a process called condensation. This involves contracting each strongly connected component of the original graph into a single supervertex. This method allows researchers to simplify complex, looping systems into organized, acyclic structures. By removing cycles, scientists can apply the powerful tools of topological ordering to otherwise difficult problems.

680 words
🖼️ Images & Media (5)
File:Tred-G.svg
Tred-G.svg
File:Hasse diagram of powerset of 3.svg
Hasse diagram of powerset of 3.svg
File:Graph Condensation.svg
Graph Condensation.svg
File:Pert chart colored.svg
Pert chart colored.svg
File:EgyptianPtolemies2.jpg
EgyptianPtolemies2.jpg
Up Next
🔢
Cycle (graph theory)
Math
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.