Rank: 15589 based on 0 downloads (last 30 days) and 0 file submitted
photo

Leon

E-mail
Company/University
University of Warwick
Lat/Long
52.37699890136719, -1.560999989509583

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by Leon
Updated File Comments Rating
25 Feb 2011 gaimc : Graph Algorithms In Matlab Code Efficient pure-Matlab implementations of graph algorithms to complement MatlabBGL's mex functions. Author: David Gleich

Thanks for your excellent library! It's great to be able to see how you've solved the technical issues. Good work!

I believe there is a small bug in your clusteringcoeffs.m code, Tt occurs when you try and calculate unweighted clustering with a normal format network (not csr).

Calling clustercoeffs.m(A,0) always exits with

"Error in ==> clustercoeffs at 42
if any(ai)<0, error('gaimc:clustercoeffs',... "

This is because ai is not defined; the easy solution is to nest:
if any(ai) <0, error( ....
end
within the "if usew, [rp ci ai]..." loop.

your code (lines 39-45):
if usew, [rp ci ai]=sparse_to_csr(A);
else [rp ci]=sparse_to_csr(A);
end
if any(ai)<0, error('gaimc:clustercoeffs',...
['only positive edge weights allowed\n' ...
'try clustercoeffs(A,0) for an unweighted comptuation']);
end

proposed fix (lines 39-45)
if usew, [rp ci ai]=sparse_to_csr(A);
if any(ai)<0, error('gaimc:clustercoeffs',...
['only positive edge weights allowed\n' ...
'try clustercoeffs(A,0) for an unweighted comptuation']);
end
else [rp ci]=sparse_to_csr(A);
end

Hope that helps,
L.

Contact us