Finish 2003-11-13 10:00:00 UTC

Here we go IV

by Peter J. Acklam

Status: Passed
Results: pass
CPU Time: 6.96
Score: 191.0
Submitted at: 2003-11-06 12:08:34 UTC
Scored at: 2003-11-06 13:07:50 UTC

Current Rank: 57th
Based on: probably not the shortest - tweak again 3 (diff)
Basis for: will it work? (diff)
Basis for: x3 (diff)
Basis for: Tweak again V (diff)

Comments
Please login or create a profile.
Code
w=sum(b')*99+1;
p={1};
q=1;
while q
    r={};
    s=[];
    for i=find(q)
        y=p{i};
        z=y(end);
        g=q(i);
        if g<w(z)
            w(z)=g;
            f{z}=y;
        end
        for j=find(a(z,:))
            if all(j~=y)
                r=[r {[y j]}];
                s=[s g+norm(b(z,:)-b(j,:))];
            end
        end
    end
    p=r;
    q=s;
end
[i j]=max(w);
c=f{j};