I am working on a project and have a problem relating to finding a maximum bottleneck path from s to t in a directed acyclic graph. The problem is as follows:
Define the bottleneck of a path from s to t in a graph to be the smallest capacity out of the capacities of the edges in the path. Is it possible to find a path from s to t with the maximum bottleneck capacity in O(|E|) time, where |E| is the number of edges in the graph? How would I make such an algorithm?
You can do a breadth-first search for
t
starting at nodes
. As your graph is acyclic, this search is guaranteed to end, either returning all paths froms
tot
or no paths, if there is none such path.x
which was already visited via some other path, check, which of the known paths froms -> x
has the highest bottleneck and keep only that one.t
, ie if you reacht
, check if you already have found any other path tot
and keep only the path with the maximum bottleneck.As this approach visits each edge at most once, it's in O(|E|)