We perform a general optimization of the parameters in the Multilevel Monte
Carlo (MLMC) discretization hierarchy based on uniform discretization methods
with general approximation orders and computational costs. We optimize
hierarchies with geometric and non-geometric sequences of mesh sizes and show
that geometric hierarchies, when optimized, are nearly optimal and have the
same asymptotic computational complexity as non-geometric optimal hierarchies.
We discuss how enforcing constraints on parameters of MLMC hierarchies affects
the optimality of these hierarchies. These constraints include an upper and a
lower bound on the mesh size or enforcing that the number of samples and the
number of discretization elements are integers. We also discuss the optimal
tolerance splitting between the bias and the statistical error contributions
and its asymptotic behavior. To provide numerical grounds for our theoretical
results, we apply these optimized hierarchies together with the Continuation
MLMC Algorithm. The first example considers a three-dimensional elliptic
partial differential equation with random inputs. Its space discretization is
based on continuous piecewise trilinear finite elements and the corresponding
linear system is solved by either a direct or an iterative solver. The second
example considers a one-dimensional It\^o stochastic differential equation
discretized by a Milstein scheme