Graphs and Their Representations: Adjacency List, Matrix, Edge List
A binary tree is a graph where every node has at most 2 children and exactly 1 parent. A linked list is a graph where every node has exactly 1 next and exactly 1 prev. A road netw…
Graph Fundamentals covers: Graphs and Their Representations, The Graph Search Mind-Shift, DFS in Depth, BFS in Depth, Strongly Connected Components and Bridges. Year 1, Quarter 3. Includes 16 exercises and 2 projects.
This course unlocks once you've finished its prerequisite. Open prerequisite →
Complete prerequisites first to enroll.
A binary tree is a graph where every node has at most 2 children and exactly 1 parent. A linked list is a graph where every node has exactly 1 next and exactly 1 prev. A road netw…
You're about to meet two algorithms — Breadth-First Search and Depth-First Search — that are everywhere in graph theory. Every textbook treats them as a pair: "here are two import…
DFS isn't useful because it visits vertices in a particular order — BFS does that too. DFS is useful because of when it finishes processing each vertex. Every vertex has two times…
The last lesson said BFS is graph search with a queue, and that's all the algorithm is. But why does that queue give you shortest paths? Why doesn't a stack give them too? The ans…
A graph isn't usually one undifferentiated mass of vertices. It has structure: clusters where everything reaches everything else, single edges whose removal disconnects regions, i…
- [ ] Number of Islands (#200) — NC/LC — BFS/DFS on 2D grid, mark visited - [ ] Max Area of Island (#695) — NC/LC — DFS counting cells per island - [ ] Clone Graph (#133) — NC/LC …
- [ ] Course Schedule (#207) — NC/LC — Topological sort via DFS cycle detection - [ ] Course Schedule II (#210) — NC/LC — Return topological ordering - [ ] Pacific Atlantic Water …
- [ ] Word Ladder (#127) — NC/LC — BFS with word transformation as edges - [ ] Alien Dictionary (#269) — NC/LC — Topological sort from character ordering constraints - [ ] Walls a…
- [ ] Build a social network analyzer in Ruby — load a graph from file (adjacency list), find connected components, compute shortest path (BFS), detect communities (connected comp…
Build a Ruby tool that reads a dependency graph (like a Gemfile) and outputs the installation order using topological sort. Detect circular dependencies and report them. Input: YA…
- [ ] Milestone 1: Build the graph data structure in Ruby with adjacency list; load from CSV - [ ] Milestone 2: Implement Dijkstra's algorithm with min-heap; output shortest path …
- [ ] What are the three ways to represent a graph in code? What are the tradeoffs? - [ ] Explain BFS and DFS. What data structure does each use? When would you choose one over th…
12 lessons. Read in order; spiral back when you need to. By the end you'll have used the core ideas twice — once on the abstract, once on something you'll meet at work next week.