def cliques(self, threshold=3, distance=0): g = [] c = cluster.cliques(self, threshold) for nodes in c: g.append(cluster.subgraph(self, nodes, distance)) return g
def __sub__(self, graph): nodes = cluster.difference(cluster.flatten(self), cluster.flatten(graph)) all = self | graph return cluster.subgraph(all, nodes, 0)
def clique(self, id, distance=0): return cluster.subgraph(self, cluster.clique(self, id), distance)
def sub(self, id, distance=1): return cluster.subgraph(self, id, distance)
def __and__(self, graph): nodes = cluster.intersection(cluster.flatten(self), cluster.flatten(graph)) all = self | graph return cluster.subgraph(all, nodes, 0)