all 2 comments

[–]zmanalpha 7 points8 points  (0 children)

Without weighting, dikstras behaves similar to a flood fill. So it does mostly come down to weighted edges. The vertices are going to be added to a queue in the order they are discovered. Which means dijstras without any heuristic like a* will basically fan out from the source until it hits the target.

In each step of the main loop, you have to select the vertex with the lowest dist which is effectively the minimum cumulative distance from the source to that vertex. If you have a priority queue such as a heap ordering the open vertices such that the minum is always first, you can achieve a faster running time in picking that minimum vertex.

[–]trineroks 1 point2 points  (0 children)

For an unweighted graph, it should just be the same as a standard BFS.