Question: Consider the shortest paths problem from a single source s . The key idea underlying Dijkstra's algorithm is the following: For every q , let
Consider the shortest paths problem from a single source s The key idea underlying Dijkstra's algorithm is the following:
For every q let Wq denote our current best upper bound on the weight of a shortestweight path from s to q Consider a neighbor v of u
If Wuwuv Wv we should set Wv to Wuwuv # Here wuv is the weight on edge u v
Now consider a variant of the singlesource shortestpaths problem in which paths containing more than k edges do not qualify. Consider the following variant of the aforementioned idea around which we hope to develop an optimal algorithm for this new algorithm.
For every q let Wq denote our current best upper bound on the weight of a shortest path from s to q under the added constraint that it contains no more than k edges and let jq denote the actual number of edges in a path from which Wq was obtained. Consider a neighbor v of u
If Wuwuv Wv and ju k we should set Wv to Wuwuv and jv to ju
Critique this new idea from the perspective of whether or not we can build an optimal algorithm for the new problem around it
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
