Merged four search algorithm into single function. All mixed together. Little messy. But we can easily to see the differences of them.
In the DFS algorithm, when we reach the descendant node which has been saved in the close set, we update that descendant node with the better cost. However, the cost won't be propagated to it's rest of descendants. That might be the reason to cause the back tracing fail somehow.
Added check end condition to BFS and DFS. This part was missing in the old code.
There is no linked list available for structure array. In order to reduce the memory usage, I attempted to create a function to do that. Not finished yet. It is under lib folder. Reference link http://stackoverflow.com/questions/1413860/matlab-linked-list