← Microsoft questions

Find if there is a path between two vertices in an undirected graph

Filed under Microsoft

Given an undirected graph with n vertices (cities) and a list of edges (roads), determine if a path exists between a source vertex and a destination vertex. This is equivalent to checking if both…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.