graph - Dijkstra for The Single-Source Longest Path

前端 未结 3 1275
滥情空心
滥情空心 2020-12-01 21:34

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

3条回答
  •  春和景丽
    2020-12-01 21:59

    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

提交回复
热议问题