Longest path in graph

后端 未结 4 1649
一生所求
一生所求 2021-01-24 00:24

Since last 2 days,i\'m trying to find some logic for calculating longest path in graph.I know i can find it easily for DAGs and in general it is polynomial time algorithm.Formal

4条回答
  •  遥遥无期
    2021-01-24 01:13

    Invert the weights of the paths and run a shortest path algorithm. The lowest number you get (most negative) is the longest path.

提交回复
热议问题