My first answer, please excuse any non-standard thing for the stackoverflow culture.
I think the solution is simple. Just deny the weights and run the classic shortest path for the DAG (of course, for the vertex weights). It should work pretty fast. (Perhaps the time complexity is O (V + E))
I think this should work as if you had lost weight, the largest would be the smallest, the second largest would be the second smallest, and so on, as if a > b then -a < -b . Then the execution of the DAG should be sufficient, since it will find a solution for the smallest path of negation and, thus, find the longest path for the original
user4952610
source share