Top "Dijkstra" questions

Dijkstra's algorithm, conceived by Dutch computer scientist Edsger Dijkstra is a graph search algorithm that solves the single-source shortest path problem for a connected graph with nonnegative edge path costs, producing a shortest path tree.

Why doesn't Dijkstra's algorithm work for negative weight edges?

Can somebody tell me why Dijkstra's algorithm for single source shortest path assumes that the edges must be non-negative. I …

algorithm shortest-path dijkstra
Negative weights using Dijkstra's Algorithm

I am trying to understand why Dijkstra's algorithm will not work with negative weights. Reading an example on Shortest Paths, …

algorithm dijkstra shortest-path graph-algorithm
Bellman-Ford vs Dijkstra: Under what circumstances is Bellman-Ford better?

After a lot of Googling, I've found that most sources say that the Dijkstra algorithm is "more efficient" than the …

algorithm dijkstra shortest-path bellman-ford
Difference between Prim's and Dijkstra's algorithms?

What is the exact difference between Dijkstra's and Prim's algorithms? I know Prim's will give a MST but the tree …

algorithm graph dijkstra minimum-spanning-tree prims-algorithm
Understanding Time complexity calculation for Dijkstra Algorithm

As per my understanding, I have calculated time complexity of Dijkstra Algorithm as big-O notation using adjacency list given below. …

algorithm graph big-o time-complexity dijkstra
Dijkstra's algorithm in python

I am trying to implement Dijkstra's algorithm in python using arrays. This is my implementation. def extract(Q, w): m=0 …

python algorithm dijkstra
How does Dijkstra's Algorithm and A-Star compare?

I was looking at what the guys in the Mario AI Competition have been doing and some of them have …

algorithm artificial-intelligence graph a-star dijkstra
Find the shortest path in a graph which visits certain nodes

I have a undirected graph with about 100 nodes and about 200 edges. One node is labelled 'start', one is 'end', and …

algorithm graph-theory dijkstra
dijkstra's algorithm - in c++?

for the past four days I am trying to understand the dijkstra's algorithm. But I can't. I have a vector …

c++ algorithm dijkstra
Dijkstra's algorithm with negative weights

Can we use Dijkstra's algorithm with negative weights? STOP! Before you think "lol nub you can just endlessly hop between …

dijkstra