2015-03-26

Hello everyone,

A while ago I implemented my own A* pathfinding algorithm, and it works great. But I feel like my implementation of the A* is wrong. I feel like my algorithm is scanning extra nodes that should not be scanned.

Here is a picture of my program.



The yellow square is the starting node, the green square is the target node, the black squares are solid non-walkable nodes, the blue squares are the final path, the white squares are the squares that were not scanned and the red squares are the nodes that were in the closed list.

And here is another website that has A* implemented.



As you can see this website algorithm is scanning less nodes than my program. I don't know how and I don't know why.

This is the website.

Can you guys please help. I don't know how to fix this.

And here is my code:-

Show more