How can we count number of node - disjoint paths between any two nodes such that distance between two nodes is maximum K?
Details about node - disjoint path can be found here.
We are given a directed graph where we have to count number of node - disjoint path from vertex u
to v
such that maximum number of nodes between them is K - 2 (u
and v
are decremented from K , therefore K - 2). Number of vertices in graph can be up to than 10^5 and edges can be 6 * 10^5. I thought of implementing BFS for every node until maximum distance from source node is less than K. But I am not getting idea for implementation. Anybody please help me?
If anybody have idea to solve it using DFS, please share it.