Nepedia
Back to Discover
Fluent Reader
🔢

Directed acyclic graph

math Maturity 11-13 Next article →

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
Tred-G

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
Pert chart colored

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
Hasse diagram of powerset of 3

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
EgyptianPtolemies2

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
Graph Condensation

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.

424 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ 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
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.