def single_kb1p32(g6): g = parse_graph6(g6) d = min(g.degree().viewvalues()) # d >= 3k/2 # or d > 3k/2 - 1 k = int(2 * (d / 3.0)) if node_connectivity(g) >= k: return def chk(): for candidates in combinations(g.nodes_iter(),k+1): if not certify_non_kblock(g, candidates, k+1): return True return False if not chk(): return {'g':g6, 'k': k, 'd': d}
def single_maos_connected_kb1p32(g6): g = parse_graph6(g6) d = min(g.degree().viewvalues()) # d >= 3k/2 # or d > 3k/2 - 1 k = int(2 * (d / 3.0)) if node_connectivity(g) < k+1: return starters = [] for s in g.nodes_iter(): result = mao_kblock(g, k+1, s) # result = None if it is indeed a MAO if not result: starters.append(s) # we found one, let's skip ahead break if not starters: return {'g':g6, 'd':d, 'k':k}
def node_connectivity(self,h1,h2): G = self._graph return nxa.node_connectivity(G,h1,h2)
def node_connectivity(self, h1, h2): G = self._graph return nxa.node_connectivity(G, h1, h2)