Shortest distance between any two nodes in directed graph
Filed under Oppo R&D
The question
Given an undirected graph, calculate the minimum distance between any two nodes, and write the algorithm to find the shortest distance between any two nodes in a directed graph.
No write-up yet. Related questions below have one.
Related Oppo R&D questions
Collected from public candidate posts and coding forums. Updated Nov 2026.