There are n cities connected by some number of flights. You are given an array of flights F[1, . . . , n], where F[i] = (Fromi, Toi, pi) indicates that there is a flight from city Fromito city Toiwith cost pi. You are also given three integers src, dst, and k, return the cheapest price from city src to city dst with at most k stops. If there is no such route, return -1.
Precisely define the subproblem.Provide the recurrence equation.Describe the algorithm in pseudocode to compute the optimal value.Describe the algorithm in pseudocode to print out an optimal solution.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here