def all_maotrees_have_kblock(g6): g = parse_graph6(g6) d = min(g.degree().viewvalues()) # or d > 3k/2 - 1 k = int(ceil(2 * ((d+1) / 3.0)) - 1) result = {} for m in all_maos(g): m_ = list(m) t = maotree(g, m_) found = False for p in t.paths(): if len(p) >= k: # print p kblock = certify_non_kblock(g, p[-(k+1):], k) if not kblock: found = True if not found: result['m'] = m result['t'] = t break if result: result['g'] = g6 result['k'] = k result['d'] = d return result
def single_ALL_mao_kp1b(g6): g = parse_graph6(g6) d = min(g.degree().viewvalues()) # d >= k+1, take maximal k k = d-1 if k < 2: return last = None for l in all_maos(g): if not certify_non_kblock(g, l[-(k+1):], k+1): return return {'g': g6, 'd': d, 'k': k}
def all_maotrees_all_kblock(g6): g = parse_graph6(g6) d = min(g.degree().viewvalues()) # or d > 3k/2 - 1 k = int(ceil(2 * ((d+1) / 3.0)) - 1) result = None for m in all_maos(g): m_ = list(m) t = maotree(g, m_) for p in t.paths(): if len(p) >= k: # print p result = certify_non_kblock(g, p[-(k+1):], k) if result: break if result: break if result: result['g'] = g6 result['k'] = k result['d'] = d return result