'Free all conj_ids associated with the sg_id and
return a list of (remote_sg_id, conj_id), which are no longer
in use.'

def delete_sg(self, sg_id):

    result = []
    for k in list(self.id_map.keys()):
        if (sg_id in k[0:2]):
            conj_id = self.id_map.pop(k)
            result.append((k[1], conj_id))
            self.id_free.append(conj_id)
    return result
