In this paper, the problem of the quality of the product is investigated in the conditions when the reassignment can be organized in the process of realization of a technological route. The information on the completed technological routes forms a training sample for the pattern recognition problem and the choice of the technological route for the continuation of the production process is carried out taking into account the expected quality indicators of the final product. To reduce the dimensionality of the problem, a given set of executed technological routes is divided into discrete classes, in each of which an algorithm for constructing a decision tree can be implemented. The paper gives a formal description of the developed algorithm for the node of the decision tree and a polynomial heuristic dichotomy algorithm in a multi-class pattern recognition problem is proposed for it. Computational experiments are carried out to confirm the effectiveness of the proposed algorithm by comparing the obtained solution with the exact solution.