Learning Log 1: Learning about AI search
31/1/2023 So far I am on step 1 of my journey. I have learned about and implemented the Best First Search algorithm on a small 2D grid. I’ve spent about 3-4 days to code it up. Given that I come from a software engineering background, I thought it would be a lot easier to implement. However, I noticed that to get something demonstrative, there were a lot of extra pieces to implement.
First, I needed a problem to solve. I initially thought I could have a grid of random integers representing topographical contours. The goal could be to find the steepest ascent or the smoothest ascent. I implemented the grid and found myself stuck at implementing other parts of the demo.
For example, I needed to implement the model, the states, the search tree nodes all while learning how to do so in Python. So I reduced the complexity of the problem to a simple 2D grid where there is a randomly selected Start and End point. The goal is to find the shortest path from the start to end. The solution is trivial since any man and his dog can visually solve the problem. However, the achievement here is that the agent is able to use an evaluation function to select the best step to take next.
I spent another couple of hours cleaning up the code, making the problem size configurable. I also made the output a little nicer so that the user can visually see on the console what is happening at each step. This exercise very enriching. Not only was I writing in Python, but getting familiar with the algorithm felt empowering. I can safely say, I know how to use this.
I intend to put this up on GitHub TODO And given enough time, to create a video explaining the code.