python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Bellman-Ford vs. Dijkstra graph density
I was testing the two algorithms and Bellman-Ford performed better on sparse graphs and looking at the big-O analysis of both, O(VE) for Bellman-Ford and O(E + V lg V) for Dijkstra's. I believe this i...
csstudent3423
Votes: 0
Answers: 2
In SPFA Shortest Path Faster Algorithm why does it have to check if current vertex is in queue before adding it to queue?
procedure Shortest-Path-Faster-Algorithm(G, s)
1 for each vertex v ≠ s in V(G)
2 d(v) := ∞
3 d(s) := 0
4 push s into Q
5 while Q is not empty do
6 u := poll Q
7...
typing...
Votes: 0
Answers: 2
algorithm for single source shortest path problem
we are given a directed graph G = (V, E) with positive and negative edge weights, but no cycles. Let s ∈ V be a given source vertex. How to find an algorithm that finds distance of all vertices from s...
Saeed Diab
Votes: 0
Answers: 1
Can Bellman-Ford algorithm handle positive cycles?
I am currently studying the Bellman-Ford algorithm and a doubt popped up. From what I learned the Bellman-Ford algorithm creates the shortest path from its sources, if perhaps there is a negative cycl...
Luca Girotti
Votes: 0
Answers: 2