A novel method is suggested for constructing topological indices (TIs) of molecular graphs which models human logic. This method is described in terms of a block scheme, consisting of the mutually connected elementary blocks. In each block the simple transformations of a molecular graph are fulfilled. A variant of the transformation is selected from the list of possible variants. Every TI is obtained as a result of the sequential execution of a number of operations, corresponding to some 'walk' on the block scheme. This walk can be selected both randomly and by the investigator. The suggested method can serve as a basis for the development of the respective computer program which may be used for the automatic construction of any number of TIs of differing nature. By this process one can also obtain the TIs that are unlikely to be constructed manually, due to their complexity. The set of obtained TIs may be used for building the structure-property models. In the case of an unsatisfactory result the obtained set of TIs may be changed using the described generator of TIs. A number of examples of application of the suggested approach for the building QSAR/QSPR models is given.