Skip to main content

Questions tagged [dijkstra]

This tag should be used for questions that involve Dijkstra's algorithm.

Filter by
Sorted by
Tagged with
1 vote
2 answers
145 views

Fully generic, very efficient bidirectional Dijkstra's algorithm in Java

After finding out that my previous implementations are incorrect, I decided to give it another try. I relied on this post. (The entire project resides in this GitHub repository. Contains some unit ...
coderodde's user avatar
  • 28.9k
1 vote
2 answers
703 views

Find the cheapest flight to reach from source to destination

As the input you get the flight schedule as an array, each element of which is the price of a direct flight between 2 cities ...
meallhour's user avatar
  • 133
1 vote
2 answers
203 views

Finding the cheapest path between two points using Dijkstra

I am trying to use Dijkstra to find the cheapest path between two pixels in an image. Implementation: ...
user877329's user avatar
3 votes
1 answer
165 views

Traditional vs. bidirectional Dijkstra's algorithm in C

I have this CLion project on GitHub. It constructs a directed, weighted graph consisting of 100 thousand nodes and 500 thousand directed arcs, picks two random nodes, and computes the shortest paths ...
coderodde's user avatar
  • 28.9k
2 votes
0 answers
226 views

Dijkstra's Shortest Path Algorithm

Is there anything I could do better in this Dijkstra's Implementation. This is my implementation of Dijkstra after understanding the concept. I used hash table wherever possible to have faster access <...
Ajmal Moha'd's user avatar
1 vote
1 answer
209 views

How can I avoid duplicate processing of vertices in the priorityqueue with Dijkstra?

So everytime a neighbors is discovered with an improved distance, it is added to the priorityqueue with the new distance (so it can be used in the right order). This means however that the old entry ...
Regyn's user avatar
  • 143
1 vote
1 answer
109 views

Pathfinders.hpp - Dijkstra's algorithm

I have this Visual Studio 2022 project, in which I compared the performance of 4 point-to-point shortest path algorithms. This one presents the Dijkstra's algorithm: ...
coderodde's user avatar
  • 28.9k
2 votes
2 answers
463 views

Graph Implementation with Dijkstra's Algorithm

Graph Interface: ...
GodLike's user avatar
  • 51
2 votes
0 answers
64 views

Dijkstra from scratch

I implemented the Dijkstra algorithm from scrath and wonder if I can save some code? The whole algorithm is here. n is the number of nodes, and m the number of edges. 1 ≤ 𝑛 ≤ 10^4, 0 ≤ 𝑚 ≤ 10^5, 𝑢 ...
Lerner Zhang's user avatar
1 vote
0 answers
435 views

Dijkstra's shortest-path algorithm implemented via Priority Queues and an adjacency matrix represented graph

My adjacency matrix looks like this, where non-zero weights denote edges. [0, 2, 0, 0, 3] [2, 0, 2, 4, 0] [0, 2, 0, 3, 0] [0, 4, 3, 0, 1] [3, 0, 0, 1, 0] Here's my attempt, would appreciate a code ...
user2495123's user avatar
6 votes
1 answer
214 views

Graph implementation with Dijkstra

So, here is the code: ...
Norhther's user avatar
  • 269
10 votes
2 answers
4k views

Implementation of Dijkstra's algorithm in Python

I have implemented Dijkstra's algorithm for my research on an Economic model, using Python. In my research I am investigating two functions and the differences ...
O.B.'s user avatar
  • 103
7 votes
2 answers
423 views

Dijkstra's implementation in rust

I would like to get any feedback about my implementation of Dijkstra algorithm in Rust following this youtube video. Please be aware that this my first code in Rust as well as my first Dijkstra ...
Zskdan's user avatar
  • 171
7 votes
1 answer
1k views

Dijkstra algorithm C#

I have implementing a simple version of Dijkstra's algorithm in C#. Could this be made more efficient? Does it need to be modified? ...
user10776032's user avatar
2 votes
1 answer
333 views

LeetCode: Network Delay Time Dijkstra's Algorithm C#

https://leetcode.com/problems/network-delay-time/ There are N network nodes, labelled 1 to N. Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the ...
Gilad's user avatar
  • 5,311