# Dependency Graph

> A map of which files or packages need which others. Arrows show the need.

**Field:** Software Development  
**Category:** Code Intelligence  
**Also known as:** Module Graph, Import Graph, Dependency Tree

## Think of it like

It is like a chart of a tower. It shows which bricks hold up which.

## Definition

A dependency graph shows which parts of a project rely on which other parts. A dot can be a file, a module or a whole package. An arrow means this part imports or needs that one. A part many arrows point to is one many things lean on. A loop of arrows, where two parts need each other, is often a sign of trouble.

## Example

Jack draws his app's dependency graph. The auth and billing modules both import utils, so a bug there hits both.

## Why it matters

It shows what to build first, what to test after a change, and which part is risky to touch.

## Common mistake

Letting two modules import each other. That loop makes both hard to change or test on their own.

## Three principles

- **Arrow means needs.** This part imports that one.
- **Hubs are risky.** Many arrows in, much to break.
- **Avoid loops.** Two parts should not need each other.

## Related terms

- [Code Graph](https://learn.benibix.com/term/development/code-graph)
- [Dependency](https://learn.benibix.com/term/development/dependency)
- [Call Graph](https://learn.benibix.com/term/development/call-graph)
- [Change Impact Analysis](https://learn.benibix.com/term/development/change-impact-analysis)
- [Graph (Data Structure)](https://learn.benibix.com/term/development/graph)

![Two panels. On the left, a dependency graph: the app module imports an auth module and a billing module, and both import a shared utils module, lit up. On the right, a control flow graph for one function: a start box, a diamond asking if the user is logged in, a yes path to show the page and a no path to send to login, both meeting at an end box. A dotted line follows one variable from where it is set to where it is used.](https://learn.benibix.com/diagrams/dev4-flow-graphs.svg)

---

Source: https://learn.benibix.com/term/development/dependency-graph
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
