Skip to content
AITroveRead. Build. Understand.

Graphs

Adjacency, traversal, and connectivity.

Adjacency, traversal, and connectivity. Work through the operation contract, runnable case, and cost before selecting the structure for a real workload.

Lessons

Practice and next steps

CSR graphs: pack sparse neighbors for repeated scans

Dependency graphs: topological order and cycle rejection

Disjoint-set rollback: restore an earlier connectivity checkpoint

Shortest routes: skip stale min-heap entries

Offline connectivity: edge lifetimes and rollback unions

Online connectivity: answer after each edge change

Dense graph bitsets: adjacency and common neighbors

Parity disjoint set: maintain same-or-different constraints

Link-cut forests: change tree edges and sum a path

Potential disjoint sets: preserve numeric differences across merges

Centroid decomposition: nearest marked depot on a fixed tree

CSR delta overlays: stage road edits before compaction

Reachability bitsets: precompute directed paths for a fixed graph

Condensation DAGs: compress directed cycles before path queries

Moveable disjoint sets: transfer one shipment without splitting its old tree

Block-cut indexes: separate articulation depots from cyclic road blocks

Kruskal reconstruction trees: answer route bottlenecks through merge ancestors

De Bruijn graphs: compact non-branching k-mer routes into unitigs

Successor disjoint sets: skip permanently retired slots

Curriculum

Storage details