A Self-Organized Approach for Detecting Communities in Networks