Why can't a directed weighted graph contain cycles of negative weight, if we want to determine the shortest path between two nodes of that graph?
No negative cycles when determining path between two nodes
102 Views Asked by Drago AtThere are 4 best solutions below

Because if there such a cycle, for every "shortest path" that you may think, I can pick a better one by simply traversing this negative cycle once again. And this will definitely decrease the overall path cost, because by assumption this cycle is of negative weight.

Because "shortest" actually means "least cost/weight" path.
By having a cycle of negative weight it's possible to use it to get the weight of a ny path (containing this cycle) arbitrary low.

Because if it does, the shortest path can be -inf.
Imagine this example, you want to compute the shortest path between A and D. Probably you want it to be A - B - D, 6 steps. But you can loop the cycle B - C - B as many times as you want. Then, the shortest path is A - B - C - B - C - ... - B - C - B - D.
Because a negative cycle would affect the path-weight in the following-way:
First attempt of finding a path:
Now let's enter the loop:
Well that's cheaper by two, but we can do better:
The obvious problem: with every run through the loop the path gets cheaper and we wind up with an endless loop as shortest path.
But this doesn't apply to all path-finding algorithms. For example the Bellman-Ford-algorithm is capable of handling negative edges, with the cost of being less efficient.