Question: Let us consider a traveling app. There are source and destination cities where the agent has to decide on which path he needs to travel.

Let us consider a traveling app. There are source and destination cities where the agent has to decide on which path he needs to travel. The following graph will give the cities with their time and fare. Here Start node is A and the Goal node is G. Note that the edge value from A to B 500/3hr represents 500 is maximum fare and 3hr is the maximum time taken to reach A to B or vice-versa. Find the path and cost which takes the least time to reach the destination. Use appropriate data structures and implement a search algorithm to find the path that the agent can visit all the cities in the graph. The input has to be taken from the user. Let us consider a traveling app. There are source and destination cities

3hr B 500/3hr 1250/3hr Shri A 590/1.5hr 850/3hr 1.5hr 1500/2hr 1000/4hr 650/2hr G Ohr 600/3hr 700/2hr C 2500/3hr E 5hr 1.5hr

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!