https://github.com/airoldilab/SAS
Raw File
Tip revision: 3ea0256ff23e6eab42281feea594310caf7ad29a authored by Edo on 10 January 2014, 20:42:01 UTC
Update Readme.txt
Tip revision: 3ea0256
stochastic_block.m
function west = stochastic_block(G,h)
n = size(G,1);

% h = round(log(n));

% Empirical Degree Sorting
d = mean(G);
[~, pos] = sort(d,'descend');
A = G(pos,pos);

% Histogram
west = imfilter(A, ones(h)/h^2, 'symmetric');
west = west(1:h:end,1:h:end);
west = imresize(west, [n,n], 'nearest');
back to top