I am making a maze solver using DFS and I want to implement the search tree for it but I am a bit new to artificial intelligence and I want a little bit of help on this matter.
Let me give a maze example first:
1 2 3 4 5 6
|
char maze[5][9] =
"#########",
"# # #",
"# ## # #",
"# # #",
"#########",
|
So my search tree for DFS should be something like this:
1 2 3 4 5
|
"#########",
"#12#15 10 11 #",
"#3##14 9 #12 #",
"#456 7 8 #13 #",
"#########",
|
1st child of parent -> Right Cell if it is empty
2nd child of parent -> Bottom Cell if it is empty
3rd child of parent -> Left Cell if it is empty
4th child of parent -> Top Cell if it is empty
My solver will receive as an argument my maze array. My questions are these:
1st question: Is this actually the way the nodes are going to get visited by my actor?
2nd question: In the code do I need to declare 15 as child of 10? (also in other cases like 9 with 14)
3rd question: When my solver receives the array do I need to make a pre-process on the array and construct the tree from the array or will my actor construct it as he goes?