The organizational structure of a multi-agent system (MAS) is a set of roles and relationships of agents, com-ponents that control their behavior, as well as rules governing the interaction of system elements. The effectiveness of the MAS largely depends on the characteristics of the organizational structure used. Existing solutions in this area have a significant disadvantage, namely low adaptability to changes in environmental parameters or adjustment of the conditions of the task, which consists in the need to restart the procedure for synthesizing the organizational structure of the MAS. The problem of automatic optimization of the organizational structure of centralized MAS in the conditions of changed environmental parameters or the task is of particular relevance for centralized MAS with a strict hierarchical structure, whose agents can be divided into two classes – agents-managers, agents-subordinates. The subject of the study is the methods of synthesis of the organizational structure of the MAS. The aim of the work is to develop a method for optimizing the organizational structure of centralized MAS in automatic mode. To achieve this goal, the concepts of primary and secondary agent resources were introduced, based on a biogeographic algorithm, a method was developed that regulates the movement of subordinate agents between groups depending on the degree of attractiveness of the agent manager (depends on the sum of estimates of the effectiveness of subordinate agents managed by him, as well as on the distance from this subordinate agent). The developed method can find its practical application in the implementation of the following tasks: inspection or patrolling (protection) of infrastructure facilities by mobile robots, the implementation of artificial intelligence in computer games.