Demon Community detection algorithm implementation in c++