The problem of planning an optimal trajectory of the object that passes through the area of the random search is discussed. The peculiarity of the problem is that the search area is unknown a priori, but algorithmic and technical characteristics of search funds are known. Two variational formulations of the problem of integral risk minimization in the absence and presence of restrictions on the length of the trajectory are proposed. Software modules are developed to get numerical solutions.