title: Dijkstra's algorithm on a graph whose edge weights are limited
body: <p>Suppose we want to run Dijkstra's algorithm on a graph whose edge weights are integers in the
  range <code>{1,2,...,W}</code>, where W is a relatively small number. How to find the shortest path from vertex <code>s</code> to <code>t</code> in <code>O((|V|+|E|)logW)</code>?</p>
  
  <p>I encountered this problem from the book Algorithms by S. Dasgupta, C. Papadimitriou and U. Vazirani. I could prove that if we implement the Dijkstra's algorithm as before, at each iteration the range of the distances for nodes in the priority queue would be within <code>W</code>. However, since priority queues do not have the property to put elements with same weights into the same bucket, this observation does not directly lead to a solution to the problem.</p>
  
  <p>Could anyone give me some hints on how to go one step further to make the bounded range <code>W</code> work for me?</p>
  
  <p>Thanks!</p>