You're in a remote town [S] with your car and are low on gas. Gas stations...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
You're in a remote town [S] with your car and are low on gas. Gas stations are present in the nearby towns [GI and G2] and reaching the nearest one is your Goal. You have access to a map that include roads between cities and the distances between each pair of cities with a road between them (available in the. You have to plan to solve this issue using A* heuristic search. One of your friends, who has a good knowledge of roads and has a fair idea of the terrain, can guess the approximate distance of the Goals (nearest petrol pumps) from any town. The distances calculated by your friend to the goal state are the 'heuristic distances'. Distances of paths to the immediately further towns are the 'actual distances. Write a program to arrive at the final path that the algorithm would take using the A* algorithm. Your code should output the fina; path and the total cost of getting from the current city to your goal destination (total distance). The distances calculated by your friend to the goal state are the 'heuristic distances". Distances of paths to the immediately further towns are the 'actual distances". The test case files are present in the folder Q1. Write a program to arrive at the final path that the algorithm would take using the A* algorithm. Your code should output the path and the distance of the path till that step. Input: Refer file 'casel.txt' In the first table you are given the list of towns and the corresponding Heuristic values. Second table comprises the actual path distances from one town to another. Example: Initial State: S 3 paths are possible: SA, SB, SC A* Heuristic values: SA-15+30=45 SB-2+40=42 SC-15+10=25 Queue=[[SA, 45], [SB, 42], [SC, 25]] Choose values with the lowest A* Heuristic value: [SC, 25]. Continue the same steps till a goal state is reached. Expected Output: ['SBDAEG1', 45] Execution Instructions: 1. Please make sure that your code is executable on running the command: For Python: python3 q1.py Example command: python3 q1.py case1.txt For Java: javac q1.java java q1 2. Write the output of the program to a text file in the Q1/Solutions folder with the naming convention - _solution.txt. You're in a remote town [S] with your car and are low on gas. Gas stations are present in the nearby towns [GI and G2] and reaching the nearest one is your Goal. You have access to a map that include roads between cities and the distances between each pair of cities with a road between them (available in the. You have to plan to solve this issue using A* heuristic search. One of your friends, who has a good knowledge of roads and has a fair idea of the terrain, can guess the approximate distance of the Goals (nearest petrol pumps) from any town. The distances calculated by your friend to the goal state are the 'heuristic distances'. Distances of paths to the immediately further towns are the 'actual distances. Write a program to arrive at the final path that the algorithm would take using the A* algorithm. Your code should output the fina; path and the total cost of getting from the current city to your goal destination (total distance). The distances calculated by your friend to the goal state are the 'heuristic distances". Distances of paths to the immediately further towns are the 'actual distances". The test case files are present in the folder Q1. Write a program to arrive at the final path that the algorithm would take using the A* algorithm. Your code should output the path and the distance of the path till that step. Input: Refer file 'casel.txt' In the first table you are given the list of towns and the corresponding Heuristic values. Second table comprises the actual path distances from one town to another. Example: Initial State: S 3 paths are possible: SA, SB, SC A* Heuristic values: SA-15+30=45 SB-2+40=42 SC-15+10=25 Queue=[[SA, 45], [SB, 42], [SC, 25]] Choose values with the lowest A* Heuristic value: [SC, 25]. Continue the same steps till a goal state is reached. Expected Output: ['SBDAEG1', 45] Execution Instructions: 1. Please make sure that your code is executable on running the command: For Python: python3 q1.py Example command: python3 q1.py case1.txt For Java: javac q1.java java q1 2. Write the output of the program to a text file in the Q1/Solutions folder with the naming convention - _solution.txt.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
The adjusted trial balance for Sweet Home Catering, Inc., is presented below. Prepare the income statement and statement of retained earnings for Sweet Home Catering, Inc., for the month ended March...
-
Tom sells mutual funds on a graduated commission structure. He receives 3.3% on the first $50,000 of sales in a month, 4.4% on the next $50,000, and 5.5% on all further sales. What are his gross...
-
Use the Entertainment Centre Ltd. data in S3-12 to make the company's closing entries at March 31, 2014. Then set up a T-account for Retained Earnings and post to that account. Compare Retained...
-
Why are technologies like facial recognition and AI programs that monitor a large volume of phone calls and email messages a concern for American citizens?
-
Consider this LP formulation: Graphically illustrate the feasible region and apply the isocost line procedure to indicate which corner point produces the optimal solution. What is the cost of this...
-
Marcus is attending State University full time and is in his second year at university. He received a scholarship to help with his school expenses. The scholarship is $5,000 and is all used to pay...
-
Research can be conducted for a variety of reasons including searching for effective change strategies that allow followers to perceive of someone as a leader rather than a manager or studying a...
-
At September 3 0 , the end of Beijing Companys third quarter, the following stockholdersequity accounts are reported. Common stock, $ 1 0 par value $ 4 8 0 , 0 0 0 Paid - in capital in excess of par...
-
6x+17x-3 Evaluate the following limit: lim xo 5x2+14x-3
-
When looking at a project to convert data into information, data analysis is the methodology thatshould be used to accomplish the output. When reviewing the tools used in the course and the data that...
-
What are the advantages and pitfalls of the media's appetite for telling and selling stories? As we reach the point where almost all media exist on the Internet in some form, how have our culture and...
-
You are working in a clinic and have just roomed a patient. When you come out of the room, you overhear me complaining to two co-workers about you and how slow you are. [Take the role of the other...
-
1. In your own words explain the steps in conducting a t test or a z test for the differences between means or proportions. 2. Provide a real life example that matches the steps.
-
Write the expression in radical notation. Then evaluate the expression when the result is an integer. 23 -1/2
-
Consider the multiple linear regression model fit to the baseball data in Problem 3.41. Problem 3.41 Consider the 2016 major league baseball data in Table B.22. While team ERA was useful in...
-
Consider the simple linear regression model fit to the rental price data from Problem 2.36. Data From Problem 2.36 Table B.24 contains data on median family home rental price and other data for 51 US...
-
Consider the multiple linear regression model fit to the rental price data in Problem 3.42. Problem 3.42 Table B.24 contains data on median family home rental price and other data for 51 US cities....
Study smarter with the SolutionInn App