Robot localization in a grid

The robot localization problem requires a mobile robot to determine its current location in an environment, given some initial information about the environment. We assume that the robot’s environment is represented by an occupancy grid. The grid is a rectangle of square cells, each of which is either obstructed or unobstructed. All the edge cells of the rectangle are obstructed. The robot can occupy any unobstructed cell and can sense the obstructed/unobstructed status of each of the eight neighboring cells that share at least a corner with the current cell. The robot can move into any unobstructed cell that shares an edge with the current cell, making it the new current cell. An example of a grid is shown in Fig. 1. The robot is placed in an arbitrary unobstructed cell of a grid and moves around the grid making observations until it has determined which grid square it currently occupies. Let n be the number of unobstructed