This paper presents a novel path integral formalism for Einstein's theory of gravitation from the viewpoint of optimal control theory. Despite its close relation to the well-known variational principles of physicists, optimal control turns out to be more general. Within this context, a Lagrangian different from the Einstein-Hilbert Lagrangian is defined. Einstein field equations are recovered exactly with variations of the new action functional. The quantum theory is obtained using Ashtekar variables and the loop scalar product. By means of example, the tunneling process of a black hole into another black hole or into a white hole is investigated with a toy model.