Is there any empirical relation between hardness and density? Inspired from: Why is diamond not the most dense substance?
The answer says that there is no general relation between hardness and density but we do have a connection between packing/bonding of atoms which ultimately determines the density of the substance.
However, hardness might have a slight correlation with density as most metals are hard and quite dense (except obvious exception: Mercury and Gold). From here:

hardness is roughly correlative with density. In addition, several pairs of polymorphs show the same trend: the more dense mineral is the harder mineral. This relationship makes some sense, in that closer packing of atoms would give greater density and would allow shorter bond lengths, which allows greater hardness.

Is there any empirical relationship/formula that can correlate various hardness constants of a material and density?
 A: There is no such correlation function; here is why. I will restrict my answer to common engineering materials from which useful objects could be fashioned, where hardness would be a useful attribute. This excludes metals that catch fire spontaneously in air, since it would be injudicious to make cars and airplanes out of them.
Hardness is a measure of how difficult it is to indent a material. Indentive deformation requires slippage between adjacent layers of atoms which is facilitated by nondirectional bonding between those atoms- as in the case of metallic bonding. Resistance to indentation requires either the interatomic bonds be directional (as in the case of covalently bonded atoms, as for instance in ceramics) or that interatomic slippage mechanisms be pinned down or inhibited by the microstructure of that material (as for example in the case of the iron-carbon system).
This is an extremely complicated business where the hardness mechanisms in different materials have completely different root causes, making any sort of universal correlative "hardness function" essentially impossible- especially with respect to density, as density itself is not correlated to interatomic bonding mechanisms, alloying effects, microstructure, and ductility mechanisms.
A: Niels Nielsen is obviously an expert on condensed matter physics, but I find his answer a little unsatisfying because it merely asserts that there are many confounding variables. That doesn't mean that there is no correlation, or that we can't find an empirical rule relating hardness and density if we control for all the other variables.
If you look at the alkali metals, they all have BCC structure, and their density increases as you go down the periodic table (except for potassium). Their hardness decreases. That is, lithium is both the lowest in density and the hardest. So I think this establishes that such a relation does exist sometimes, if you control for lots of other variables. However, it seems unlikely that this relation is in any way universal. For instance, I think the trend for various types of wood would be that denser woods are harder.
A: So you gave a link, but there are two other relevant links in the same book: 2 and 3. All the links are for minerals, rather than for materials in general. It turns out that there is a better correlation between hardness and normalized density:

the observed density is divided by the average atomic weight of the
constituent atoms (and thus by formula weight divided by the number of
atoms in the formula

