I was reading about Graph algorithms and I came across these two algorithms.
I searched a lot about this but didn\'t get any satisfactory answer!
I have a do
Blockquote while using BFS for finding shortest path in a graph what we do is We discover all the connected vertices, add them in the queue and also maintain the distance from source to that vertex. Now if we find a path from source to that vertex with still less distance then we update it!
We do not maintain a distance in BFS. It is for discovery of nodes. So we put them in a general queue and pop them. unlike in Dijikstra where we put accumulative weight of node (after relaxation) in a priority queue and pop the min distance.
So BFS would work like dijikstra in equal weight graph because.
complexity varies because of the use of simple queue and priority queue.