Ok, I posted this question because of this exercise:
Can we modify Dijkstra’s algorithm to solve the single-source longest path problem by changing mi
It works in directed acyclic graphs but not in cyclic graphs. Since the path will back track and there is no way of avoiding that in dijkstra's algo