This paper presents optimization of wireless sensor network (WSN) topology for forest fire detection. The sensors for this purpose are deployed in forest, grassland and open space, which have different attenuation properties in electromagnetic waves. For this reason, routers which receive signals from sensors and send them to the base station must be deployed considering these differences. In this work, we develop an optimization method for WSN topology based on simulated annealing considering the differences in the attenuation property. The vegetation data are taken from Landsat data. Using the present method, the necessary number of routers for full connection of the sensors deployed in diverse, irregular environments can be estimated.