a)
Instead of applying dijsktra's algorithm on every ambulance available and finding the shortest , apply dijkstra's algorithm on Emergency Location L as source vertex . As dijktra's algorithm computes shortest path from source vertex to all other vertex find which ambulance is nearest and notify that particular ambulance.
b)
Let us suppose we are using adjacency matrix for graph representation
Total runtime or complexity of this process would be : O(V^2)
c)
Extra space would be required be required is for adjacency matrix and for the final output distances to k ambulances
So total space complexity : O(V^2 + k )
In this question, we will think about how to answer shortest path problems where we have more than just a single sourc...
In this question, we will think about how to answer shortest path problems where we have more than just a single source and destination. Answer each of the following in English (not code or pseudocode). Each subpart requires at most a few sentences to answer. Answers significantly longer than required will not receive full credit You are in charge of routing ambulances to emergency calls. You have k ambulances in your fleet that are parked at different locations, and you...
SpecificationStart with your Java program "prog340" which implements Deliverables A and B.This assignment is based on the definition of the Traveling Salesperson Problem (the TSP): Given a set of cities, you want to find the shortest route that visits every city and ends up back at the original starting city. For the purposes of this problem, every city will be directly reachable from every other city (think flying from city to city).Your goal is to use a non-genetic local search...