This error message is caused by the fact that Dijkstra's algorithm assumes that all edge weights are non-negative. If even a single edge in the input graph has a negative weight, the algorithm may produce incorrect results or even fail to terminate at all.
In some cases, the algorithm may still work correctly if the negative weights are small and only occur in specific parts of the graph. However, if there are negative cycles (i.e., loops in the graph where the sum of edge weights is negative), the algorithm will produce incorrect results or terminate with the "Contradictory paths found: negative weights" error message.
Therefore, even if the isnegativelyweighted attribute is not true, it's important to ensure that the input graph doesn't have any negative weights or cycles before running Dijkstra's algorithm.
Asked: 2022-08-05 11:00:00 +0000
Seen: 8 times
Last updated: Jan 27 '22