Finding the shortest path in a graph without any negative prefixes
问题 Find the shortest path from source to destination in a directed graph with positive and negative edges, such that at no point in the path the sum of edges coming before it is negative. If no such path exists report that too. I tried to use modified Bellman Ford, but could not find the correct solution. I would like to clarify a few points : yes there can be negative weight cycles. n is the number of edges. Assume that a O(n) length path exists if the problem has a solution. +1/-1 edge weights