Detecting communities using social network analysis