I am trying to make optimized version of bellman ford algorithm to run in worst case. Optimized version I mean if after relaxing 1 round of edges and there is no further update on the shortest distance, it terminates.
For instance, a simple connected weighted directed graph with 7 vertices such that running Optimized Bellman-Ford's algorithm from source vertex 0 uses at least 5 rounds to get the correct shortest paths.
The graph cannot contain a negative weight cycle. i.e. all outgoing edges from vertex 0 is processed then edges from vertex 1 and so on
I know it has to do with cycles. But i am not very sure the strategy in drawing the graph to meet the requirement.