def METHOD_NAME(self, graph: Graph) -> None:
    """Create dict with number of nodes in each group."""
    self.group_sizes = {}
    for node in graph.nodes:
        for group in node.groups:
            if not self.group_sizes.get(group):
                self.group_sizes[group] = 0
            self.group_sizes[group] += 1