- Transpose G into G’
- DFS in G’ from minimum number.
If u is reachable from v in G’, then v is reachable from u in G. Since we start the DFS with minimum number, we can find the minimum node which is reachable from u.
If u is reachable from v in G’, then v is reachable from u in G. Since we start the DFS with minimum number, we can find the minimum node which is reachable from u.
It is a classical problem in graph theory. It is called Fleury’s algorithm. See reference.