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.
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.5hrStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started