Comparison of methods for community detection in networks