A classical problem of stochastic simulation is how to estimate the variance of the sample mean of dependent but stationary outputs. Many variance estimators, such as the batch means estimators and spectral estimators, can be classified as quadratic-form estimators. Necessary and sufficient conditions on the quadratic-form coefficients such that the corresponding variance estimator has good performance have been proposed. But no one has utilized these conditions to pursue optimal quadratic-form coefficients to form an optimal variance estimator. In this paper, we seek an optimal (minimum variance unbiased) variance estimator by searching for the optimal quadratic-form coefficients.