graph - Minimum Weight Path -


"given connected undirected weighted graph, find maximum weight of edge in path s t maximum weight of edges in path minimum."

this seems floyd–warshall algorithm problem. there approach faster o(v^3)?

i submit breadth first search (bfs) determine whether s connected t path can run in o(v) time, since each vertex need visited once.

i propose therefore, solution problem sort edges weight, ,

while bfs succeeds in finding path s t     remove highest weighted edge graph 

the last edge removed before bfs fails maximum weighted edge you're looking for.

total running time o(e log e) sort edges weight, plus o(ve) run bfs until removing edge disconnects graph.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -