well , actually we are doing this with 4 IR sensors (l,r,f and b) and using right/left hand rule to reach the center...our prob is recording the correct path to be taken when coming back...can this be done in a simple manner using an array ??
Yes, it can be done simply by using an array of "n" nodes (having the value 0 at start), each node being a change in direction. Each time you need to change direction, you write the node with a value like 1 for left, 2 for forward, 3 for right. If you follow a left hand rule, at an intersection you will allways turn left. So, if the left turn takes you to a dead end, you turn back to the node and add an other left turn value to the one that it is allready there. For example, if you the intersection is a +, you first turn left (write 1 in the node), reach a dead end, turn back to the node, turn left again (add a 1 to the existing value, making that a 2). If say the intersection looks like a T and when you come back from the dead end you can't turn left just go forward, you add a 2 to the value in that node (that makes a 3). Now lets say that you explore all directions from a node and get dead ends and you are headed to the previous node. In this case you will get a value of 4 for the curent node, which is illegal, so you make it 0. Then you continue exploring the directions left unexplored from the previous node.
After you found the center of the maze, you turn around to the last node and substract the value from 4 and turn that direction. For example, at the last node you turned right (the value was 3), when you go back you substract 3 from 4 and get the result a 1, so you turn left instead of right and so on untill you reach the first node, then you know you are about to exit the maze without even looking for other dead ends...
Using this method it is verry important to accurately detect the type of intersection. Mounting the sensors in a "+" pattern simplyfies the process of detecting that. Also being able to accurately turn 90 degrees and correct the errors while driving the straight segments is of a great importance.