The method of simulated annealing in conjunction with the penalized functional method of constrained minimization is invoked for the simultaneous variational determination of both linear and non-linear parameters of a trial wavefunction for the ground and excited states. The method is applied to the ground and the singlet 1S2S states of a few members of the He-isoelectronic sequence. It is numerically demonstrated that the computational labour involved in the extraction of one eigenvalue of the CI matrix goes as N1.675 in the simulated annealing method, where N is the dimension of the CI space.