views:

133

answers:

2

Where can I find an A* implementation in C?

I was looking around but it seems my google-fu is not strong enough. I've started writing my own implementation, but then I remembered Stack Overflow and I thought I should ask here first. It seems a bit complicated to write a real A* implementation - I was tempted to just write an implementation of Dijkstra's algorithm for a binary grid, since that's all I really need, but I feel like I want to have a C A* implementation in my repertoire.

+10  A: 

Your google-fu is indeed weak, young padawan :-)

Try googling for astar c.

The first and second links are actual code implementations (the first under a liberal MIT licence, no idea about the second).

paxdiablo
Thanks! For some reason melding it into the single word "astar" didn't come to mind. The first link is C++ (my main problem when searching for it before), the second uses a bunch of libraries I'd rather not get dragged into. The fourth however ( Applications Programming in ANSI C - http://condor.depaul.edu/~mkalin/ed3/ ) seems just right. I may still finish my own implementation, since this one is a bit bulky and not as flexible and easy to tie into. I'll be sure to post it here.
btfx
+3  A: 

here you can find the pseudocode: http://en.wikipedia.org/wiki/A*

to find the right code for you just search after: astar graph search algorithm C

Ervin
Thanks, that's how I was building my implementation - working off that pseudocode. My google-fu may not be up to snuff but I still read wiki before asking question boards.
btfx