Computational annealing of superconducting radio-frequency cavities