title: Running time analysis of Dijkstra's for shortest path algorithm but with a maximum K stops
body: <p>For a problem like this (<a href="https://leetcode.com/problems/cheapest-flights-within-k-stops/" rel="nofollow noreferrer">https://leetcode.com/problems/cheapest-flights-within-k-stops/</a>), I can solve this problem with Dijkstra's algorithm with an upper bound of O(|E| + |V|log|V|).</p>
  
  <p>However, since there is an additional stopping criteria of max of K stops. My upper bound should be less if K &lt; V.</p>
  
  <p>Q: How do I incorporate the K stops into my analysis of Dijkstra's algorithm?</p>
  
  <p>Q2: What if we assume the graph is fully connected (Each vertex is connected every other vertices. So E = V^2)? Does this change the analysis?</p>