Community Detection, Louvain, Leiden, Getting Started.
This approach considers the probability that a link lies within a community. The use of surprises works well in the limit of many small communities and the use of modularity works well in the limit of a few large communities. The use of the Surprise community detection algorithm using the python