A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Directed Graphs and Digraphs

College Depth 66 in the knowledge graph ☐ I know this ☆ Set as goal
32topics build on this
283prerequisites beneath it
See this on the map →
Introduction to Graph Theory→→Control Flow GraphsCycle Detection in Directed Graphs+3 more
graph-theory directed-graphs digraphs

Core Idea

Directed graphs (digraphs) extend graph theory by adding direction to edges. Each edge points from one vertex to another, creating paths and cycles with directionality. They model relationships where direction matters: web links, tournament results, and state transitions.

How It's Best Learned

Draw digraphs with arrows showing direction. Trace paths following arrow directions. Compare directed vs. undirected versions of the same graph to see how direction changes properties like connectivity.

Common Misconceptions

Explainer

In an undirected graph, an edge between vertices A and B means you can travel freely in either direction. A directed graph (or digraph) breaks this symmetry: each edge is an arc with a specific tail (where it starts) and a head (where it points). The arc from A to B is a completely different object from the arc from B to A — and the graph may have one, both, or neither. This small change — adding arrows — dramatically changes the questions you can ask and the answers you get.

The most important new concept is reachability. In a digraph, vertex B is reachable from A if there exists a directed path following arcs in their forward direction. Even if A and B are connected by arcs, B might be reachable from A while A is not reachable from B. Think of a one-way street network: you can reach the highway from your house via certain routes, but returning home may require a completely different sequence of streets. This asymmetric reachability is the heart of why digraphs model so many real systems — web hyperlinks, program control flow, dependency trees, and tournament rankings all have this one-way character.

From your prerequisite knowledge of undirected graphs, you know that connectivity tells you whether any two vertices can communicate. Digraphs split this into two levels. A digraph is weakly connected if the underlying undirected graph (ignoring arrow directions) is connected — the vertices are linked, but not necessarily reachable from each other. It is strongly connected if every vertex is reachable from every other vertex following directed paths. A directed cycle — a path that returns to its starting vertex following arrows — is only possible in a strongly connected component. Detecting these components is a major algorithmic task that builds directly on your graph traversal skills.

In-degree and out-degree replace the single degree concept you know from undirected graphs. A vertex's in-degree counts arrows pointing into it; its out-degree counts arrows leaving it. A vertex with out-degree zero is a sink — information or flow ends there. A vertex with in-degree zero is a source — it produces but never receives. These roles are critical in applications: in a dependency graph, sources are packages with no dependencies; sinks are packages nothing depends on. In a web crawl, a page with no outgoing links is a sink. The sum of all in-degrees equals the sum of all out-degrees (both equal the number of arcs), which is the directed analogue of the handshaking lemma you know from undirected graphs.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Making 10 as an Addition Strategy → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts Through 10 → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Opposites and Additive Inverses → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Directed Graphs and Digraphs

Longest path: 67 steps · 283 total prerequisite topics

Prerequisites (1)

Leads To (5)