Relative Density and Exact Recovery in Heterogeneous Stochastic Block Models