title: Shortest path with a fuel tank
body: <p>This is an homework question and I'd be happy for some guidance.</p>
  
  <p>Let G=(V,E) be an undirected graph where each vertex represents a city, and the edges have weights that represents travel distances. Some of the cities have gas stations in them. A car starts from vertex s with a gas tank sufficient to travel length L. I need to find the shortest path between s and t so that the car won't run out of gas.</p>
  
  <p>My main thought was to use Floyd–Warshall algorithm with some changes. When we calculate shortestPath(i,j,0) we assign w(i,j) if i has a gas station and L-w(i,j) > 0 , and infinity otherwise. However, for the next steps, I don't know how to add the current fuel status into the calculations.</p>
  
  <p>Thanks.</p>