A modification of the ant colony method is considered, which makes it possible to search for a rational (optimal) solution to a parametric problem with the possibility of obtaining a negative value of the objective function. The objective function in the original algorithm that calculates the traveling salesman's path is determined by the total length of the path and cannot be negative. But when solving parametric problems of optimization of difference values for high availability systems, negative values of the objective function may arise. Such values lead to a negative value of the weights (pheromone), which leads to incorrect operation of the probabilistic arc/vertex selection formula. A formula has been derived for recalculating the positive shift of the objective function and pheromone to obtain a positive value of the pheromone, which is used when the sum of the value of the objective function and the shift is negative. The approaches are compared: initial shift, single shift, calculation of the module of the objective function, and a gradual iterative shift algorithm is proposed. The proposed approach allows us to equate the minimum value of the objective function to 0 and mathematically recalculate the weights (pheromone) for the parametric problem taking into account the resulting shift. By applying relative values of the weights, such a shift does not affect the probability distribution, but takes into account new values for previous calculations of the objective function. The studies were carried out on various benchmarks with optimal values in the negative region. Statistically, the proposed algorithm is not inferior in performance to shift and modular algorithms for converting the value of the objective function to the positive semi-axis.