  The Scheduled Relaxation Jacobi (SRJ) method is an extension of the classical
Jacobi iterative method to solve linear systems of equations ($Au=b$)
associated with elliptic problems. It inherits its robustness and accelerates
its convergence rate computing a set of $P$ relaxation factors that result from
a minimization problem. In a typical SRJ scheme, the former set of factors is
employed in cycles of $M$ consecutive iterations until a prescribed tolerance
is reached. We present the analytic form for the optimal set of relaxation
factors for the case in which all of them are different, and find that the
resulting algorithm is equivalent to a non-stationary generalized Richardson's
method. Our method to estimate the weights has the advantage that the explicit
computation of the maximum and minimum eigenvalues of the matrix $A$ is
replaced by the (much easier) calculation of the maximum and minimum
frequencies derived from a von Neumann analysis. This set of weights is also
optimal for the general problem, resulting in the fastest convergence of all
possible SRJ schemes for a given grid structure. We also show that with the set
of weights computed for the optimal SRJ scheme for a fixed cycle size it is
possible to estimate numerically the optimal value of the parameter $\omega$ in
the Successive Overtaxation (SOR) method in some cases. Finally, we demonstrate
with practical examples that our method also works very well for Poisson-like
problems in which a high-order discretization of the Laplacian operator is
employed. This is of interest since the former discretizations do not yield
consistently ordered $A$ matrices. Furthermore, the optimal SRJ schemes here
deduced, are advantageous over existing SOR implementations for high-order
discretizations of the Laplacian operator in as much as they do not need to
resort to multi-coloring schemes for their parallel implementation. (abridged)

Numerical Analysis;High Energy Astrophysical Phenomena;Computational Physics