Basic steps for Louvain method