def substructure_vec_to_substructure_dict(substructure_vec):
    """convert the substructure vector to dictionary with degree as key"""
    substructure_dict = {}
    for i in substructure_vec:
        if str(len(i)) not in substructure_dict.keys():
            substructure_dict[str(len(i))] = [i]
        else:
            substructure_dict[str(len(i))].append(i)
    return substructure_dict
