Free · First family

Traversal and connectivity

The first family and its related problems are fully open.

Browse all 445 related problems

Patterns

Free

DFS Components and Reachability

Follow adjacency as deeply as needed to decide reachability, enumerate components, or aggregate each component. The goal is to exhaust a region, not to minimize travel distance.

Free

BFS Connectivity Traversal

Use a FIFO queue to exhaust reachable regions without recursion risk, while leaving room to record levels, parents, or component labels.

Free

Grid Flood Fill

Treat a matrix as an implicit graph and consume the maximal region connected to a seed, supporting recoloring, area, boundary-touch, and enclosure analysis.

Free

Topological Sort / Indegree Elimination

Turn prerequisites into an executable order by repeatedly removing tasks with no unfinished predecessors; detect directed cycles and support execution layers or DAG DP.