Generalized shortest-paths problem.In Internet routing, there are delays on lines but also, more significantly, delays at routers. This motivates a generalized shortest-paths problem.
Suppose that in addition to having edge lengths ,a graph also has vertex costs . Now define the cost of a path to be the sum of its edge lengths, plusthe costs ofall vertices on the path (including the endpoints). Give an efficient algorithm for the followingproblem.
Input:A directed graph positive edge lengths and positive vertex costs ; a starting vertex .
Output:An array such that for every vertex , is the least cost of any path from s to u (i.e., the cost of the cheapest path), under the defnition above.
Notice that .