story

Graphs for Programmers

Learn graphs for programming from first principles: graph models, nodes, edges, graph theory basics, traversal, dependency ordering, shortest paths, and search spaces.

Hub

Understanding Graphs for Programmers

Learn graphs for programming from first principles: graph models, nodes, edges, graph theory basics, traversal, dependency ordering, shortest paths, and search spaces.

Reading Path

  1. 1 Why Graphs Exist

    Learn why graphs are useful in programming, when arrays and maps are not enough, and how graphs model relationships in real data.

  2. 2 The Math Root of Graphs

    Learn the graph theory basics programmers need: vertices, edges, directed graphs, degree, paths, cycles, and weighted edges.

  3. 3 Graphs vs Arrays, Maps, Tables, and Trees

    Compare graphs with arrays, maps, tables, and trees, and learn when graph data structures are the right model for relationship-heavy problems.

  4. 4 Representing Graphs in Code

    Learn how to represent graphs in code using edge lists, adjacency lists, adjacency matrices, and reversed graphs for practical programming problems.

  5. 5 Walking Graphs with BFS and DFS

    Learn graph traversal with BFS and DFS, when to use each search strategy, and why traversal order matters in programming.

  6. 6 Detecting Cycles in Graphs

    Learn how to detect cycles in directed graphs using DFS, in-progress nodes, and done states, with dependency graph examples.

  7. 7 Topological Sort and Build Order

    Learn topological sort with dependency graphs, build order examples, in-degree, Kahn's algorithm, and cycle detection.

  8. 8 Weighted Graphs and Shortest Paths

    Learn weighted graphs, shortest paths, edge costs, and Dijkstra's algorithm for programming problems where relationships have cost.

  9. 9 Graphs as Search Spaces

    Learn how graphs can model search spaces in games, compilers, planners, and workflows using generated neighbors, minimax, and pruning.

Connections

These show why the reading path is ordered this way.