One of the actual problems in modern economy is to construct an efficient organizational hierarchy allowing to control the firm with minimal cost. This paper describes the mathematical models of optimal hierarchies in firms. We explore formally such practical effects as optimality of divisional, functional and matrix hierarchy for different levels of standardization, environment instability, functional links intensity, horizontal and vertical integration, etc.