# Searching a Graph

Searching a Graph: How Many Steps Apart? Breadth-First Search, Who Can I Reach? Depth-First Search.

Updated: November 17, 2026

1. [How Many Steps Apart? Breadth-First Search](https://www.ask-codey.com/lessons/ds-bfs) (Journeyman): Find how many friendships apart two people are, the fewest, without listing every route or walking in circles: why both of those fail, and the search that fixes them, breadth-first search, with a queue and a visited set.
2. [Who Can I Reach? Depth-First Search](https://www.ask-codey.com/lessons/ds-dfs) (Journeyman): Find everyone a person can reach through friends, and split a network into the groups that don't touch, with a short recursive walk that never goes round in circles: why the folder walk from Module 3 loops forever here, and the search that fixes it, depth-first search, and when to choose it over breadth-first search.

Source: https://www.ask-codey.com/courses/data-structures/topics/ds-searching-a-graph
