Why graphs matter
Placement graph questions often hide inside simple stories: cities and roads, friends, courses, islands, servers, or college clubs.
Your job is usually not to invent a complex algorithm. First build the graph. Then traverse it safely.
One idea
Graph traversal is controlled exploration. Keep a visited set, then use a queue for BFS or a stack/recursion for DFS.
BFS is best when you need the minimum number of edges in an unweighted graph. DFS is handy for components, cycles, and reachability.