Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago