Made some optimizations to ACOCommunityDetection