Multigrid (MG) methods are among the most efficient and widespread methods for solving large linear systems of equations that arise, for example, from the discretization of partial differential equations. In this paper we introduce a new approach for optimizing the computational cost of the full MG method to achieve a given accuracy by determining the number of MG cycles on each level. To achieve this, a very efficient and flexible Branch and Bound algorithm is developed. The implementation in the parallel finite element solver Hierarchical Hybrid Grids leads to a significant reduction in CPU time. Copyright © 2010 John Wiley & Sons, Ltd.