A parallel community detection algorithm based on spanning trees