The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
0 votes
When the graph contain negetive weight edges but no negetive weight cycle, in this case can dijkstra leads to incorrect result?
asked in Algorithms by Boss (6.6k points) | 161 views

1 Answer

+3 votes
Why dijkastra provide wrong result for -ve edge. Because dijkastra supports increments of distance, when it goes from one vertex to other. In the middle if we get some -ve edge, this assumption will be violated. That is why dijkastra gives incorrect result for some cases.

Dijkastra doesnot check if there is a -ve edge or not. If it's assumtion is true, dijkastra even give correct result with -ve weight edges too.
answered by Veteran (69.8k points)

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

28,834 questions
36,688 answers
34,641 users