We have discussed that the above Dijkstra's single source shortest-path algorithm works for graphs along with non-negative edges (like road networks). Given two scenarios can emerge out of negative cost edges into a graph:
Figure: A Graph with negative edge & non-negative weight cycle
The net weight of the cycle is 2(non-negative)
Figure: A graph with negative edge and negative weight cycle
The net weight of the cycle is 3(negative) (refer to above figure). The shortest path from A to B is not well defined as the shortest path to this vertex are infinite, that means , by traveling each cycle we can reduced the cost of the shortest path by 3, like (S, A, B) is path (S, A, B, A, B) is a path with less cost and so forth.
Dijkstra's Algorithm works only for directed graphs along non-negative weights (cost).