Posts

Showing posts from March, 2023

Modified A* - A Working Model

Image
 Introduction In this article, we will be going over the implementation of Modified A* algorithm using Python to solve the 8Puzzle problem, while also giving a generalized idea on how this can potentially be used for other problems as well. In case you are not sure about A* algorithm, or what the modification is, I recommend going through the topic here . Prerequisites: Python(Jupyter notebook), A* Algorithm, understanding copy/deep copy also helps. Algorithms This is going to be the algorithm for modified A* Algorithm, you will find it to be very similar to the algorithm for A* Algorithm, though this is expected as the main modification we have made is the added component of depth. Further it would help to note, depth of 1 is equivalent to the normal A* Algorithm. mod_A( state, depth ) :      root_node = initialiseRootNode( state )      iterated_node = root_node      fringe = PriorityQueue()      while not isGoalStat...

A Look Into Modified A* Algorithm

Image
 Introduction This article will give you an insight into some of the most basic graph based AI algorithms building up to further explain the modified A*(A star) algorithm which we are going to use in the subsequent post to solve a simple * Puzzle problem.  Prerequisite: Breadth first search, queue, priority queue Best First Search Algorithm First let us look at one of the most basic and generalized algorithm that we can use to search a value in our graph, Best First Search Algorithm. It is a simple search algorithm that uses a specific set of rules(cost functions) to select the most promising node among the immediate children of a parent node, it is often seen as akin to a Breadth First Search (BFS) but using a Priority queue instead of normal queue, i.e. FIFO queue. Here in normal BFS when we iterate through the children nodes we would normally go in whatever order we scanned the children node, i.e C1, C2, C3 if we just read from left to right, whereas in Best First Search, w...