I got a question that I'm having a hard time with :
Given A directed graph G=(V,E) with weight function w:E->R and a source vertex s. Find an algorithm that finds the lightest path from s to every v⋹V (since it's a directed graph vertex s doesn't have to have a path to each vertex in G) in a linear time of O(|V|+|E|) and explain why this algorithm works.
It will be great if someone will be able to help me with this question cause I can't find the solution myself. Thank you!!
Comments
Post a Comment