The distance-2 layer of a graph
Run breadth-first search from vertex on this undirected graph, whose edges are How many vertices lie at shortest-path distance exactly from vertex ?
Show hints (2)+
- Layer , layer . Which new vertices do the neighbours of and reveal?
- Vertex is reachable from both and - count it once. Vertex sits one layer further out.
Answer
Reveal answer →Final answer
3
Create a free account to see the full worked solution and track your progress.
Interview format: Trading Aptitude Tests, Options Trading