So, I'm pretty new to AI in general, and am trying to implement a tree-based search from a textfile input (a maze). An example would be:||||||||||||||||||||||| ||        | |      |    \|    |||||| | |||||| |     \||||||       |    P  |      \|   .| |||||| || |||||       \  P = Start| |||| |         |   |       /  . = Goal|        ||| |||   | |      /||||||||||    |||||| |     /|          ||        |    /||||||||||||||||||||||I understand the basic algorithms in general (BFS, DFS, A*, etc.), but I want to make sure I'm implementing them correctly, and not somehow cutting corners because I know where the best path is. My basic idea is:Parse the file into a 2D arrayWhile parsing, if I encounter P, note the Start indexWhile parsing, if I encounter ., note the Goal indexBegin at Index(Start), and evaluate surrounding [blank] spacesCreate Nodes for these, and add the appropriate actions to the current Node's available actions --- Add these Nodes to my frontier que[continue whichever algorithm from here]So I guess my main question is, am I generating my world correctly? Is it right to not really create Nodes until I encounter them during the search? It seems wasteful to get to a [blank] space, scan the surrounding 4 directions for other [blank] spaces, and if they exist add them to the available actions and create Nodes for all possible actions.Another alternative would be to generate Nodes as I encounter the [blank] spaces, but this would be hard (since I wouldn't be aware of the upcoming blanks) ... should I parse the file completely, and the traverse the stored array to create all possible Nodes/Links/Actions? Or is that considered cheating somehow...
Tree search for path finding - algorithm critiques
python;artificial intelligence;search