Skip to content
BytePatterns

Graphs

Nodes, edges, and the searches that ripple across them.

Graphs progress0 / 8
  1. Graph BasicsThings, plus the connections between them.5m
  2. List vs MatrixStore the edges you have, or a cell for every pair you don't.5m
  3. Breadth-First SearchSweep outward one ring at a time, using a queue.6m
  4. Depth-First SearchCommit to one branch until it dead-ends, then back up.5m
  5. Connected ComponentsCount the islands by starting a fresh sweep on each one.5m
  6. Shortest Path, UnweightedBFS already found it — store parents to read it back.6m
  7. Dijkstra's AlgorithmWhen edges cost different amounts, always settle the nearest first.6m
  8. Topological SortOrder the steps so nothing runs before what it depends on.6m