Challenge: sum of squares. Let's break 299

02012018, 03:38 AM
Post: #56




RE: Challenge: sum of squares. Let's break 299
Finalizing my code for this puzzle. I made some modifications to make it run from the command line, and also slow it down.. The superfast version I had earlier could not guarantee a solution. Takes 3 inputs:
Code:
I had a version that adjusted the results adaptively, but there are SO many possible solutions, it's not necessary. In my fast version, similar to this one, I only take into account the maxclip during the last few steps. I had many many trial runs on the 10,000 or 20,000 node graph that had only a few numbers remaining (always 100<N<1). So my improvement (slower but more accurate) is to update the scoring algorithm for each candidate solution so that it's not rewarded based on the centrality of the starting graph, but the centrality of the _remaining choices_. This made a substantial difference in number of solutions, but made the whole thing slower. So if you want it FAST on the 1000 graph: squares.py 1000 1 1000 (not guaranteed to find a solution..) adjust the 1 to 2 or 5 or 10 if you want lots of solutions for N=50: squares.py 50 100 100000 ( I think there are more than 250,000 unique solutions for N=50) 17bii  32s  32sii  41c  41cv  41cx  42s  48g  48g+  48gx  50g  30b 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)