def build_k_number_dict(k_components): k_num = {} for k, comps in sorted(k_components.items()): for comp in comps: for node in comp: k_num[node] = k return k_num
def build_k_number_dict(k_components): k_num = {} for k, comps in sorted(k_components.items()): for comp in comps: for node in comp: k_num[node] = k return k_num