We consider the compute-and-forward protocol design problem with the objective being maximizing the computation rate at a single relay, and propose an efficient method that finds the optimal solution based on sphere decoding. The problem can be transformed into a shortest vector problem (SVP), which can be solved in two steps. First, by fully exploiting the specific structure of the associated Gram matrix using the hyperbolic transformation, the Cholesky factor can be computed with only n 2 /2 + O(n) flops. Then, taking into account of some useful properties of the optimal solution, we modify the SchnorrEuchner search algorithm to solve the SVP. Numerical results show that our proposed branch-and-bound method is much more efficient than the existing one that gives the optimal solution. Besides, compared with the suboptimal methods, our method offers the best performance at a cost lower than that of the LLL based method and similar to that of the quadratic programming relaxation method.Index Terms-compute-and-forward, shortest vector problem, hyperbolic transformations, Schnorr-Euchner search, sphere decoding.