  Community detection is a crucial task in network analysis that can be
significantly improved by incorporating subject-level information, i.e.
covariates. However, current methods often struggle with selecting tuning
parameters and analyzing low-degree nodes. In this paper, we introduce a novel
method that addresses these challenges by constructing network-adjusted
covariates, which leverage the network connections and covariates with a unique
weight to each node based on the node's degree. Spectral clustering on
network-adjusted covariates yields an exact recovery of community labels under
certain conditions, which is tuning-free and computationally efficient. We
present novel theoretical results about the strong consistency of our method
under degree-corrected stochastic blockmodels with covariates, even in the
presence of mis-specification and sparse communities with bounded degrees.
Additionally, we establish a general lower bound for the community detection
problem when both network and covariates are present, and it shows our method
is optimal up to a constant factor. Our method outperforms existing approaches
in simulations and a LastFM app user network, and provides interpretable
community structures in a statistics publication citation network where $30\%$
of nodes are isolated.
