  We theoretically determine the magnetic exchange interaction between two
ferromagnets coupled by a superconductor using a tight-binding lattice model.
The main purpose of this study is to determine how the self-consistently
determined superconducting state influences the exchange interaction and the
preferred ground-state of the system, including the role of impurity
scattering. We find that the superconducting state eliminates RKKY-like
oscillations for a sufficiently large superconducting gap, making the
anti-parallel orientation the ground state of the system. Interestingly, the
superconducting gap is larger in the parallel configuration than in the
anti-parallel configuration, giving a larger superconducting condensation
energy, even when the preferred ground state is anti-parallel. We also show
that increasing the impurity concentration in the superconductor causes the
exchange interaction to decrease, likely due to an increasing localization of
the mediating quasiparticles in the superconductor.
