The time complexity of a straightforward calculation the scoring function and its gradient can be estimated as O(nm). This is not acceptable when one needs to compute the scoring function and the gradient at each iteration of the local search. Assuming the protein rigid, it is possible to reduce the computational complexity by precomputing the values of binding energy estimates at nodes of a regular three-dimensional grid constructed inside the input box: