Dijkstra's algorithm for computing the shortest single-source shortest paths in a graph with nonnegative edge weights relies on making the following calls to a priority queue: V calls to Insert; V-1 calls to ExtractMin and O(E) calls to DecreaseKey for existing elements. When the priority queue is implemented with a Fibonacci Heap, the resulting worst-case time for Dijkstra's algorithm is O(E + Vlg V).
Show that if all edge weights of a graph are integers in the range from 1 to W, for some fixed W, then a custom implementation of a priority queue data structure can be used to allow Dijkstra's algorithm to run in time O(E + VW), which is an improvement when W > lg V.
Note: Although this problem is clearly very similar to the previous problem, the same solution is not likely to be correct for both problems because there are differences in how priorities are defined for the algorithms.