The paper is devoted to the optimal placement of devices within a wireless sensor network. Modern requirements to ensure public safety in buildings with a complex structure imply the existence of systems that can detect and position emergency situation, inform rescue and tenants about the status and help them to either evacuate or eliminate the danger. Nowadays the main approach to create indoor emergency system is based on wireless sensor network. The network is built with a big number of usually battery-operating devices, each consists of a sensors set for hazard detection, and radio frequency module for communication. To evaluate the state of indoor environment different sensors can be used, such as temperature, humidity, light, flame, smoke, gas, etc. The problem of optimizing the network topology as a covering problem is formulated. A set of points in the area that is not covered by circles, a set of points belonging to the region and the intersection of two or more circles of coverage, set of points that do not belong to the area need to be minimized. To ensure fault tolerance of the wireless sensor network, it is necessary to allow the connection of each sensor with at least two routers, in case one of the routers is accidentally switched off, and also it is necessary to ensure connection of the router with at least one router. To take into account these additional conditions, the method of penalty functions is used. The genetic algorithm for solving the problem is used. The main genetic operators are adapted to the problem of designing the topology of wireless sensor networks. A computa-tional experiment was carried out, during which the optimal population size was estab-lished; the procedure of homogeneous crossing, procedure of tournament selection is chosen; procedure of homogeneous mutation. As a criterion for stopping the genetic algorithm, the stagnation of the results on the iterations of the algorithm is chosen.