Diffing "probably not the shortest" and "probably not the shortest - tweak again"

Title: probably not the shortest probably not the shortest - tweak again
Author: Christopher Cheng Christopher Cheng
Submitted: 2003-11-06 11:19:18 UTC 2003-11-06 11:53:30 UTC
Status: Passed Passed
Score: 194.0 193.0
Result: pass pass
CPU Time: 7.38 7.31
Code:
w=(b(:,1)+1)*inf;
w=sum(b')*inf+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 ~any(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};