LESSON 3.06 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
Graphs and traversal
Watch BFS spread through a grid in rings while DFS follows one route deep.
Needs3.05 Tries
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 3.06 · GRAPH BAY12 NODES · 16 EDGES · SHORT WALL
01
Stage 1 of 6 · Nodes and edges
A graph is nodes joined by edges. Each grid cell is a node; each open move is an edge.
Explain it simply
Think of a small map, like the gridworlds that RL agents move around in. Each cell, A to L, is a node, and a line between two cells is an edge. The grey bar is a wall, so no edge joins B and C. Here, every edge counts as one step.
A 4 by 3 grid of 12 nodes, A to L. 16 edges join cells that are side by side. The short wall blocks B to C. The search starts at F; the goal is D.
node, edgefrontier (ring), finished node, search treepathcheck of a seen nodemove a wall blocks
Toy: the 3.C1 grid · 12 nodes · start F, goal D · no edge costs
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
A graph is a set of nodes and a set of edges.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 more stages and 3 live controls
- 2 mix-up cards and 3 predict-then-reveal checks
- Watch it as a narrated video, in three voices
- Every Pro lesson and capstone · 656 in total
$99 a year, or $15 a month. Cancel any time.