(G: nx.Graph, communities: dict[int, list[str]])
| 266 | |
| 267 | |
| 268 | def score_all(G: nx.Graph, communities: dict[int, list[str]]) -> dict[int, float]: |
| 269 | return {cid: cohesion_score(G, nodes) for cid, nodes in communities.items()} |
| 270 | |
| 271 | |
| 272 | def remap_communities_to_previous( |