My implementation of the Depth First Search algorithm. The robot finds the path from A to B on a 40 x 20 graph, where each 5 x 5 subsegment is randomly selected from six available combinations. The subject can only enter the white squares. The program also outputs the graph in the form of each node's neighbors, black and white board, 8 x 4 matrix of segments and lists the order in which the nodes have been visited.
Possible segments:
Example board before and after the path has been found:
Before:
After: