Question: I require an algorithm (pseudocode is fine) that uses Dijkstra's Algorithm to solve the problem. Thus the problem must be converted to some weighted, directed

I require an algorithm (pseudocode is fine) that uses Dijkstra's Algorithm to solve the problem. Thus the problem must be converted to some weighted, directed graph, where Dijkstra's Algorithm may be implemented. I don't know how to do this. See picture for problem.

I require an algorithm (pseudocode is fine) that uses Dijkstra's Algorithm to

*Using Dijkstra's Algorithm is crucial*

Problem 4: Finding a cheap flight. Let G = (V, E) be a directed graph, where V is a set of cities, and E represents all possible flights between the cities in V. For every edge {u, v} E, you are given the duration of a direct flight from u to v, denoted by d(u, v), which is an integer. For example, if you are at city u at time t, and you take a direct flight to u, departing at time t' t, then you arrive at v at time t'+ d(uu). For every {u, v} E E, you are given a timetable of all available direct flights from u to v, for some interval {0,...,T}, where T > 0 is an integer. That is, for any {u, v} E E, you are given a list of pairs of integers (tu,0,1,C,0,1),..., (tuvik, Cu,v,k)), where the pair (tuwi, Cu,v.i) denotes the fact that there is a direct flight from u to v that departs at time tu,vi, and costs Cu,vi dollars. Design an algorithm that given a pair of cities u, v V, computes the cheapest possible route that starts at u at time 0, and ends at v at time at most T. Prove that your algorithm is correct, and that its running time is polynomial in V and T. Hint: Express the above problem as shortest-path computations in some graph

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!