A Hybrid Algorithm for the Shortest Path Between Two Nodes in the Presence of Few Negative Arcs

We consider the well-known problem of finding a shortest path between two specified nodes in a directed graph with weights on the arcs. In the case of nonnegative arcs (i.e., arc weights are nonnegative), the algorithm of Dijkstra runs in O(n2) time where n is the number of nodes. If negative arcs are allowed but there are no negative cycles, the algorithm attributed to Bellman, Ford and others runs in O(n3) time. The more general algorithm of Floyd and Warshall, which runs in 0(n3) time can also be used (see [ 1,2] for these references). Our motivation is to discover an algorithm whose complexity lies between 0(n2) and O(n3). This note considers an alternative algorithm which is a hybrid of the Dijkstra and Bellman-Ford algorithms and runs in O(mn’) time where h is the number of negative arcs and m = min(h, n}. Thus our algorithm is (asymptotically) competitive with the known algorithms when h = o(n). Another feature which recommends this algorithm is its easy parallelizability: With m parallel processors, the time needed becomes 0(n2 + m”).