alternating Gauss-Seidel iteration