Community analysis in social networks