Writes a text file with the best modularity value