# Alex P. and the Anatomy of a Tweak1

Posted by Ned Gulley,

Congratulations to Alex P., winner of the Square One Challenge with his SOC tweak. Michael Bindschadler came close… so close! to winning. But from the newsgroup, we read this heartbreaking story.

Curses!! I tried to hold my SOC code for as long as I could, but I was going to be away from the computer for the last hour before the deadline and I knew I hadn’t really kept up with the leader developments since I forked from “m” to develop my SOC solver, so there were a lot of tweaks that could probably quickly improve my code. I went so far as to make sure I could do the submission at the last minute from my phone. I submitted from my phone at 8 min before the deadline because I wanted to have time to log back in to matlabcentral, find my entry, and resubmit with the SOC tag, in case my phone had mysteriously logged out or I was in a dead zone or something. I was hoping 8 min was not going to be enough time for someone to find and insert a winning tweak. I should have known better :)

Congrats to Alex P, who only needed 7 min to find something to improve and resubmit it, winning by improving the time by 0.16 seconds!

His closing comment shows that Michael is a good sport and that he understands the brutal reality of the contest: tweaks can happen at any time. Alex P., who has narrowly missed on prizes of his own, deserves our recognition too. But I can’t resist showing you the one line out of 1675 lines where the code differs. On line 478, where Michael had


for n1=1:1e2,



Alex had substituted


for n1=1:22,



And that, my friends, is all it takes. Assuming your answer is actually better, which is harder than it looks.

There is one exception to the Iron Law of Tweaking, though, and it will soon be upon us. Once we get so close to the end of the contest that your code can’t be scored until after the deadline has passed, nobody can see and modify your code before the end. All the hardcore competitors (and who else is left by now?) are aware of this. They’ve reached deep into the shot locker for their last tricks. Now they are slowly circling the submit button, waiting… waiting for the moment to blaze away. I’m picturing the ships of the line at Trafalgar drifting slowly toward each other, almost within range. The slow match is burning. All is silent.

Good luck!

## 1 CommentsOldest to Newest

Alan Chalker replied on : 1 of 1

Real-world obligations have prevented me from participating much this time, but I’ve been generally following along and am impressed with the level of collaboration in this contest.

For the sake of posterity, I have been able to figure out the scoring formula and am posting it here as I traditionally do. As usual, it’s very similar to the recent contests:

score = k1*result + k2*e(k3*runtime) + k4*max(complexity-10,0) + k5*nodes

Where:

k1 = 0.01
k2 = 0.002
k3 = 4/30 (0.1333333)
k4 = 10
k5 = 0.01

Good luck to everyone in these final minutes of the contest!

These postings are the author's and don't necessarily represent the opinions of MathWorks.