We consider RKKY interaction between two magnetic adatoms in graphene (monolayer and multilaye), both pristine and doped (gapped). The consideration is based on the perturbation theory for the thermodynamic potential using the Green's functions in the coordinate -- imaginary time (imaginary frequency) representation. Both representations, corresponding to calculation of the bubble diagram in Euclidean space, have an important advantage over those corresponding to calculation in Minkowskii space, using real frequency (real time) representation, which are also reviewed. The former, in distinction to the latter, operate only with the convergent integrals from the start to the end of the calculation.