One of the important potential areas of application of intelligent virtual environment is to training medical doctors. One of the main problems in designing the corresponding intelligent system is the computational complexity of the corresponding computational problems. This computational complexity is especially high when the corresponding optimization is a discrete optimization problem, e.g., for pain relief methodologies such as acupuncture and spinal cord stimulation. In this paper, we show how to efficiently solve the corresponding discrete optimization problems. As a result, we get, e.g., a theoretical justification for the heuristic method of "guarded cathode".