Big help in Astar search code...

This is a discussion on Big help in Astar search code... within the C++ Programming forums, part of the General Programming Boards category; hi...i've been trying to battle out problems with respect to reading a file and then using its contents for Astar ...

Big help in Astar search code...

hi...i've been trying to battle out problems with respect to reading a file and then using its contents for Astar search...i don't expect anyone to be able to help me out here...but i'm putting the code to Astar in this post...

the code works perfectly for inputfile.txt and gives the right output...for 1.in file it does not produce the right output which should be:

399.499 0 1357 3424 1683 2668 620 3240 31 3387 3099 3434 0.19 sec

i suspect it's got to do with reading floats from the file which i can't correct...

btw if you want to read in inputfile.txt or 1.in then u have to comment the appropriate line in the readFile() function...

i was trying but it was too big to be attached...anyway astar search is a form of intelligent search where the heuristic function is of the form: f = g + h...you can search on the net about it...it's basically used in pathfinding e.g maze searches or calculating shortest routes between cities etc...