for node in children.keys():
    store[tuple(sorted(children[node])), tuple(sorted(parents[node]))].append(
        node)
for s in store.values():
    if len(s) > 1:
        pass
How to identify unconnected siblings in a graph?