https://vimeo.com/70999946
I implemented a recursive path search algorithm. This recursive algorithm works on the basis of predefined nodes connected together. Each node has four pointers containing a further direction: top, button, left and right. A recursive algorithm simply goes through each node and looks for each of these four directions one by one to reach its final destination; consider the following 7 nodes: A, B, C, D, E, F, G, H.
A (Button->D, Right->B) B (Right->C, Left->B) C (Left->B) D (Button->G, Right->E, Top->A) E (Right->F, Left->D) F (Left->E) G (Right->H, Top->D) H (Left->G)
These nodes when presenting a general view will be displayed in the following figure.
AโBโC | DโEโF | GโH
In this example, suppose the start path of the node is equal to node A and wants to go to node H as the final destination. node A looks at its own rights, buttons, on the left and top in order; his right pointed to node B; as a result, he decided to switch to node B; node B in the same template chooses to go right, node C. When the walker reaches node C; since its right, top and button keys are locked, node C goes back to node B. Also node B goes back to node A. The walker goes back to the starting point. Then node A goes to its button base node in order; which means that it goes to node D. node D goes to the right node E and then node F. As node F locks; it goes back to node E and node D. Then node D selects its button, node G according to the order of the walker. From there, node G goes to node H. Finally, the walker reaches its final destination.
Pseudocode: Recursive Path Finding Algorithm ArrayList findPath(GameObject currentPoint , GameObject targetPoint , ArrayList InputArrayList) { 1-Duplicate InputArrayList as tempArrayList 2-If the currentPoint equals to target Point return inputArrayList //*** End Condition found target 3-If the Right side of the currentPoint is empty goto step 4 3.1- Add currentPoint to tempArrayList //*** Call Right 3.2- tempArrayList = findPath(currentpoint.Right, targetPoint, tempArrayList); 3.3- If tempArrayList is not null return tempArrayList 4-If the Button side of the currentPoint is empty goto step 5 4.1- Add currentPoint to tempArrayList //*** Call Button 4.2- tempArrayList = findPath(currentpoint.Button, targetPoint, tempArrayList); 4.3- If tempArrayList is not null return tempArrayList 5-If the Left side of the currentPoint is empty goto step 6 5.1- Add currentPoint to tempArrayList //*** Call Left 5.2- tempArrayList = findPath(currentpoint.Left, targetPoint, tempArrayList); 5.3- If tempArrayList is not null return tempArrayList 6-If the Top side of the currentPoint is empty goto step 7 6.1- Add currentPoint to tempArrayList //*** Call Top 6.2- tempArrayList = findPath(currentpoint.Top, targetPoint, tempArrayList); 6.3- If tempArrayList is not null return tempArrayList 7-Return null; //*** End Condition does not found target }
Note: the actual code is in C #, you can download it from.
Occurrence of a problem in a case study: How do you understand this code; he has a weakness to illustrate this; given the following general overview of nodes, with the assumption that the start of node is equal to node A and the final destination is node H.
AโBโC | DโEโFโI | | | GโHโJโK
Although the best path solution is (A, D, G, H), the recursive path search algorithm explained finds (A, D, E, F, I, K, J, H) as its solution; it really seems like a robot is a stupid robot: D!
Figure 1: Recursive Path Search Algorithm 
Figure 2: Learning recursive path learning algorithm 
I solved the problem by adding learning ability for nodes. You can see the problem details from this link . But, I would have thought if anyone could reconsider the recursive algorithm to find the shortest path.
Thanks,