Distributed community detection in dynamic networks