def relabel(self, substitution, substitution_keys, revert=True): self.__vertices = relab.relabel_sequence(self.__vertices, substitution) self.__edges = relab.relabel_dict(self.__edges, substitution, substitution_keys) if not revert: return None, None return relab.revert_substitution( substitution), relab.revert_substitution(substitution_keys)
def relabel(self, substitution, substitution_edges): self.bags = relab.relabel_dict(self.bags, substitution, typ=set) # print self.bags # assert(len(self.bags) == 0) self._relabel(substitution_edges)
def _relabel(self, substitution_edges): self.hyperedge_function = { node: relab.relabel_dict(he, substitution_keys=substitution_edges) for node, he in self.hyperedge_function.iteritems() }