aestrivex/bctpy

distance_bin yields incorrect result and does not warn if the input array is a matrix

mdarnold1 opened this issue · 1 comments

distance_bin yields incorrect result: output is non-symmetric and does not match scipy.sparse.csgraph.dijkstra
The Matlab version of BCT does not have this problem.

The problem appears to be that distance_bin does not check if the input is a matrix (which is a likely use case if the graph was converted from scipy.sparse).

Then this shortcut for & is incorrect because * implies matrix (not element-wise) multplication:
L = (nPATH != 0) * (D == 0)

I suggest replacing the * with & since this is the intended function and it is just as fast.