Robot mapping is the basic work for robot navigation and path planning. Static map is also important to deal with dynamic environment. Occupancy grid maps are used to represent the
environment. This paper focuses on the dependence between grid cells. We assume that if one
point of the map is free, then the neighbors are likely to be free. This knowledge is encoded in a
Markov random field (MRF) that is used as our prior belief about the world. Data from range
sensors will then update our knowledge. By maximizing the posterior distribution of MRF
model, a linear filter is generated. It can be used to filter the noise in observations or static maps. This linear filter can be implemented online. It is also additive if the sensor model is in the log odds form