Implementation of path finder algorithm in C
Hey all,
I'm looking for a C implementation of the Lee path algorithm. It has to satisfy the following:
* The algorithm is to work inside a two dimensional space
* From each point, one can only traverse to the next point in four directions; up, down, left, right
* Points can only be either blocked or nonblocked, only nonblocked points can be traversed
Basically on a 2D rectangular grid, there can be any number for blocks (one block per x-y position). The path from one block to another must be found. The end result is that the algorithm must find the shortest path from one block to another (source and goal).
It gets a little more complicated in that a given source A can connect to multiple goals B C D and so on. That is to say within a given path (whether already found or not) there are "sub-paths". Sort of like a highway that has multiple lanes. Several cars starting from the same point (source) can reach different destinations (goal) by choosing a lane which corresponds to a desired exit. For example, from source A we can use lane A to connect to goal B; lane B to goal C; lane C to goal B.
I understand the main idea behind it. We have to expand out from the source to the goal, and then trace back to the start, the path that has the smallest cost function. It is also a requirement that we should not waste time with expanding from the source in all directions, instead we should use some sort of predictor to somehow narrow our expansion.
C is my first programming and I very recently started to learn it. Now I understand that I wont be given code in its entirety. But I am just so confused on where to begin. There are so many requirements. I would appreciate any design hints you are willing to share.
Thank you.