def headsetofconnecteds(self, ixs):
    hds = set(ixs)
    if (not hds):
        return hds
    for n in ixs:
        for p in self.parents(n):
            hds.discard(p)
    assert hds
    return hds
def headsetofconnecteds(self, ixs):
    hds = set(ixs)
    if (not hds):
        return hds
    for n in ixs:
        for p in self.parents(n):
            hds.discard(p)
    assert hds
    return hds