Practice Dependency Graphs in Math

Use these practice problems to test your method after reviewing the concept explanation and worked examples.

Quick Recap

A dependency graph is a directed graph where nodes are variables and arrows show which variables directly influence which others.

A recipe's prep plan: the sauce needs chopped onions and stock, the stock needs simmered bones, and the plated dish needs the sauce and the pasta. The arrows tell you what to start first and what a late delivery of onions will hold up. Unlike a kitchen plan, a dependency graph says nothing about how long each step takes.

Showing a random 20 of 50 problems.

Example 1

easy
In the chain A→B→C→D, how many ancestors does D have?

Example 2

easy
A graph has edges A→B, A→C, B→D. List the parents of D.

Example 3

medium
Find a valid evaluation order for C=A+B, E=C+D, where A,B,D are inputs.

Example 4

medium
Given A→B, A→C, B→D, C→D, D→E, list one valid topological order.

Example 5

easy
In a dependency graph, the edge X→Y means which variable directly influences the other?

Example 6

easy
Three tasks have the following dependencies: Task B depends on Task A, and Task C depends on Task B. Draw the dependency graph and determine a valid execution order.

Example 7

medium
Given D=A+B and E=D⋅C, list every variable that E depends on, directly or indirectly.

Example 8

easy
A formula computes C=A+B. Draw the dependency arrows.

Example 9

medium
Variables: rainfall → soil moisture → crop yield, and temperature → crop yield. If only temperature changes, does soil moisture change?

Example 10

easy
For z=f(x)+g(y), draw the dependency graph and identify the leaf node.

Example 11

medium
In the graph A→B, A→C, B→D, C→D, what is the out-degree of A?

Example 12

medium
Tasks A→B, A→C, B→D, C→D. What is the minimum number of stages to complete all tasks if independent tasks can run in parallel?

Example 13

easy
Does correlation between A and B guarantee that one depends on the other? Answer yes or no.

Example 14

easy
A node with no incoming arrows in a dependency graph is called a ____ variable.

Example 15

medium
In a causal dependency graph X→Y→Z, intervening on Y (forcing its value) breaks which arrow?

Example 16

medium
Given the dependencies: D depends on A and B; E depends on B and C; F depends on D and E. Find all valid topological orderings.

Example 17

challenge
A graph claims A→B, B→C, C→A is a valid computation pipeline. Identify the flaw and state the condition needed to fix it.

Example 18

medium
How many distinct topological orderings does the DAG A→B, A→C have? (No other edges.)

Example 19

medium
In the DAG with edges A→B, A→C, B→D, C→D, D→E, what is the longest path length (in edges) from A to E?

Example 20

medium
In a spreadsheet, cell C1=A1+B1 and D1=C1⋅2. If A1 changes, which cells must be recomputed?