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.

Can Dijkstra's Single Source Shortest Path Algorithm detect an infinite cycle in a graph?

So I came to this beautiful problem that asks you to write a program that finds whether a negative infinity …

algorithm dijkstra shortest-path infinite bellman-ford
Python Dijkstra k shortest paths

I'm trying to make a small public transport routing application. My data is represented in a following structure: graph = {'A': {…

python algorithm graph graph-algorithm dijkstra
Are there faster algorithms than Dijkstra?

Given a directed, connected graph with only positive edge weights, are there faster algorithms for finding the shortest path between …

graph-theory dijkstra
How to implement Dijkstra Algorithm in Haskell

For my studies I have to write the following function which gets the shortest route between two countries. I already …

algorithm haskell dijkstra hugs
Can we change Dijkstra's Algorithm to work with negative weights?

The pseudocode as taken from Wikipedia: function Dijkstra(Graph, source): 2 for each vertex v in Graph: // Initializations 3 dist[v] := infinity ; // …

algorithm dijkstra directed-graph single-source
Dijkstra's Algorithm and Cycles

It's stated in a book that "Dijkstra's algorithm only works with Directed Acyclic Graphs". It appears the algorithm works for …

algorithm graph-algorithm dijkstra
Dijkstra algorithm. Min heap as a min-priority queue

I'm reading about Dijkstra's algorithm in CLRS, Third Edition (p. 662). Here is a part from the book I don't understand: …

heap priority-queue dijkstra min-heap
Find the shortest path with the least number of edges

I need to modify Dijkstra's algorithm so that if there are several shortest paths I need to find the one …

algorithm dijkstra shortest-path
Implementation of BFS, DFS and Dijkstra

Is it true that the implementation of BFS, DFS and Dijkstra are almost the same, except that BFS uses queue, …

graph-algorithm dijkstra breadth-first-search depth-first-search
Why do we call it "Relaxing" an edge?

In Dijkstra's shortest path algorithm and others, to examine an edge to see if it offers a better path to …

dijkstra bellman-ford