Previously, the algorithm for the inverse problem for determining the dynamics of mass flow rate changes in the systems of natural gas production and transportation by measuring the outlet pressure was generalized to the case of hydrate formation in the main gas pipeline and in the well. In this research the new algorithm based on the method of half division (bisection, dichotomy), which has unconditional convergence, is presented. In the process of solving the problem of formation and deposition of gas hydrates on the pipe walls, the dynamics of gas pressure and temperature changes, as well as the flowing section along the length of the well are calculated. Comparison of the calculation results showed that at constant bottomhole pressure the realization of this algorithm, unlike the previously proposed one, leads to an increase in the duration of the process of complete plugging of the well with hydrates and, accordingly, to an increase in the total amount of extracted gas.