  Magnetic impurities on a superconductor induce sub-gap Yu-Shiba-Rusinov (YSR)
bound states, localized at the impurity site and fading away from it for
distances up to several nanometers. In this article, we present a theoretical
method to calculate the spatial distribution of the YSR spectrum of a
two-dimensional superconductor with arbitrary Fermi contours (FCs) in the
presence of magnetic impurities. Based on the Green's Function (GF) formalism,
we obtain a general analytical expression by approximating an arbitrary contour
shape to a regular polygon. This method allows us to show the connection
between the spatial decay (and, hence, the extension) of YSR states and the
shape of the FC of the host superconductor. We further apply this formalism to
compute the evolution of YSR states in the presence of a nearby impurity atom,
and compare the results with Scanning Tunneling Microscopy (STM) measurements
on interacting manganese dimers on the $\beta$-Bi2Pd superconductor. The method
can be easily extended to any arbitrary number of magnetically coupled
impurities, thus, providing a useful tool for simulating the spectral
properties of interacting YSR states in artificial atomic nanostructures.
