Question
Write a C++ program to find a path using the A* Algorithm. Prompt the user for the text file name containing the map. Then prompt
Write a C++ program to find a path using the A* Algorithm. Prompt the user for the text file name containing the map. Then prompt the user for the starting and stopping locations. The map has a header line which contains the number of rows and columns to follow. Each line after that contains a sequence of single digit numbers (without white space) indicating the cost to enter that location. A value of 0 indicates it is impassable. A horizontal or vertical move is that value. A diagonal move is 1.414 times that value of the square.
Output the total cost for the best path from the source to the destination and draw it (ASCII) on the screen.
Text file Example:
3 3
5-6-9-
8-1-0-
6-7-5
Step 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