shortest-path Questions

4

I have a weighted graph, no negative weights, and I would like to find the path from one node to another, trying to minimize the cost for the single step. I don't need to minimize the total cost of...
Yuhas asked 25/8, 2011 at 18:27

14

Solved

Can somebody tell me why Dijkstra's algorithm for single source shortest path assumes that the edges must be non-negative. I am talking about only edges not the negative weight cycles.
Playoff asked 31/10, 2012 at 13:41

7

Solved

What is the difference between the "Floyd-Warshall algorithm" and "Dijkstra's Algorithm", and which is the best for finding the shortest path in a graph? I need to calculate the shortest path betw...
Maryannamaryanne asked 4/12, 2009 at 13:6

19

Solved

I've been practicing for an upcoming programming competition and I have stumbled across a question that I am just completely bewildered at. However, I feel as though it's a concept I should learn n...
Achromatin asked 26/2, 2010 at 2:20

10

Solved

For a Data Structures project, I must find the shortest path between two words (like "cat" and "dog"), changing only one letter at a time. We are given a Scrabble word list to use in finding our pa...
Usurpation asked 5/10, 2009 at 19:32

4

Solved

I'm working on a project which will involve running algorithms on large graphs. The largest two have around 300k and 600k vertices (fairly sparse I think). I'm hoping to find a java library that ca...
Exploiter asked 29/3, 2012 at 17:33

5

Solved

If I have a weighted undirected Graph with no negative weights, but can contain multiple edges between vertex and self-loops, Can I run Dijkstra algorithm without problem to find the minimum path b...
Gwenette asked 28/5, 2016 at 22:40

2

Is Dijkstra faster when using Fibonacci heap than with the Binary heap? I did some experiments implementing Fibonacci heap on my own and using it in Dijkstra, I also checked the ready-to-use Fibona...
Casandra asked 6/7, 2022 at 18:41

9

Solved

I've done some research, and I seem to be missing one small part of this algorithm. I understand how a Breadth-First Search works, but I don't understand how exactly it will get me to a specific pa...
Tammitammie asked 5/12, 2011 at 0:35

2

I'm looking for an algorithm that seems very typical to me, but it seems that the common solutions are all just a little bit different. In an undirected graph, I want the shortest path that visits...
Complexion asked 7/11, 2015 at 13:41

2

Solved

I tried to implement the Dijkstra's shortest path algorithm in JavaScript, and tested it with multiple examples. I am using this graph to see how it would behave: If I want to find the shortest pa...
Corycorybant asked 6/3, 2021 at 12:40

4

Solved

I've implemented Floyd-Warshall to return the distance of the shortest path between every pair of nodes/vertices and a single shortest path between each of these pairs. Is there any way to get it ...
Tonnage asked 6/7, 2012 at 21:44

5

Solved

I was reading about Graph algorithms and I came across these two algorithms: Dijkstra's algorithm Breadth-first search What is the difference between Dijkstra's algorithm and BFS while looking fo...
Racquelracquet asked 22/8, 2014 at 14:46

8

Solved

After a lot of Googling, I've found that most sources say that the Dijkstra algorithm is "more efficient" than the Bellman-Ford algorithm. But under what circumstances is the Bellman-Ford algorithm...
Sauceda asked 20/10, 2013 at 20:13

4

Solved

On the Wikipedia page for Dijkstra's algorithm, they mark visited nodes so they wouldn't be added to the queue again. However, if a node is visited then there can be no distance to that node that i...
Macaroni asked 10/11, 2013 at 20:6

7

Solved

I need help finding all the shortest paths between two nodes in an unweighted undirected graph. I am able to find one of the shortest paths using BFS, but so far I am lost as to how I could find ...
Fieldwork asked 3/1, 2013 at 17:31

2

Solved

My a* algorithm doesn't always take the shortest path. In this image the robot has to traverse to the black squares, the river and trees are obstacles. The black line is the path it took, which is...
Disulfiram asked 4/3, 2016 at 17:23

1

I have a large osmnx (networkx) graph and nx.all_pairs_dijkstra_path_length is taking a long time to calculate. What possibilities are there to speed up the calculation?
Pluckless asked 20/10, 2021 at 16:12

11

The shortest path between nodes in a graph can be found by several algorithms (Dikstra, A-star, etc). But what applications does this problem have? (I know quite a few already, but I would like to...
Francisco asked 10/12, 2010 at 18:27

4

Solved

So first let's define Dijkstra algorithm: Dijkstra's algorithm finds single-source shortest paths in a directed graph with non-negative edge weights. I want to know how can I save the shortest path...
Amortizement asked 11/3, 2015 at 22:29

9

Solved

I am trying to understand why Dijkstra's algorithm will not work with negative weights. Reading an example on Shortest Paths, I am trying to figure out the following scenario: 2 A-------B \ / 3 ...
Dick asked 23/7, 2011 at 8:19

3

I need it for an implementation of Dijkstra's algorithm, and I do have my own implementation but documenting my code would be easier with java's own classes.
Semitrailer asked 27/4, 2012 at 7:29

3

Solved

I wrote this code of BFS in c++ using wikipedia's pseudocode. The function takes two parameters s,t. Where s is the source node and t is the target, if the target is fount, the the search return th...
Hyatt asked 1/11, 2012 at 4:40

2

I am using networkx to work on shortest path problems. I am mostly using shortest_path. I was wondering if, with the current version of networkx, it is possible to constrain the shortest path calcu...
Diffract asked 24/5, 2021 at 15:35

3

Solved

I was revising single source shortest path algorithms and in the video, the teacher mentions that BFS/DFS can't be used directly for finding shortest paths in a weighted graph (I guess everyone kno...
Bitstock asked 23/5, 2015 at 6:8

© 2022 - 2024 — McMap. All rights reserved.