• retagged by
704 views

1 Answer

0 0 votes

dijkstra's is a single source shortest path algorithm

if i get your question correctly unreachable vertices will not be reachable through the source only

also further, dijkstras fails for negative weight edges and so a cycle also has it failed 

the following link gives some lucid explanation on failure in the negative weight edge

https://stackoverflow.com/questions/6799172/negative-weights-using-dijkstras-algorithm/6799344#6799344--->>>>this is the right reasoning

https://stackoverflow.com/questions/13159337/why-doesnt-dijkstras-algorithm-work-for-negative-weight-edges--->>>this one is wrong  

 

• edited by
Position:
Show:

Related questions

1 1 vote
1 1 answer
1.6k
1.6k views
Souvik33 asked Dec 19, 2022
1,567 views
If a -ve weight cycle is reachable from source, the Dijkstra's algorithm gets into an infinite loop TRUEFALSE
0 0 votes
0 0 answers
2.0k
2.0k views
anisha007 asked Jan 24, 2019
2,040 views
Somebody please clarify me, will dijkstra’s algorithm terminate if there is a negative cycle present? (as far as I know, it doesn't give correct result as it keep updatin...