-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathheavytwitter.m
More file actions
53 lines (39 loc) · 1.57 KB
/
heavytwitter.m
File metadata and controls
53 lines (39 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
% nohup /p/matlab-7.14/bin/matlab -nodisplay -nodesktop -nojvm -nosplash -r heavytwitter > heavtwit.txt &
% hkgrow and pprgrow both took far too long on the largest degree nodes of twitter,
% so this file has them run, not on the 1000 largest degree nodes, but a "log uniform
% sampling" of the top 10% largest degree nodes. This starts with the largest degree node,
% then skips the next 2000 largest degree nodes, and repeats for 2000 total trials.
filename = 'twitterp';
dataname = 'hk';
output_directory = '../results/';
data_directory = '../data';
addpath('..') ;
load([data_directory filename]);
numtrials = 2000;
indices = zeros(numtrials,1);
times = zeros(numtrials,1);
conds = zeros(numtrials,1);
cuts = zeros(numtrials,1);
vols = zeros(numtrials,1);
setsizes = zeros(numtrials,1);
gsize = zeros(1,2);
gsize(1) = size(A,1); n =gsize(1);
gsize(2) = nnz(A);
fprintf('starting graph = %s\n', filename);
%heavyhood
for j=1:numtrials
indices(j) = perms(1+(j-1)*2000);
end
for trial_num=1:numtrials
fprintf('hh trial=%i \t',trial_num);
tic; [dummy,conds(trial_num),cuts(trial_num),vols(trial_num)] = hkgrow(A,indices(trial_num),'neighborhood', true,'debug',false);
times(trial_num) = toc;
setsizes(trial_num) = min(length(dummy), n - length(dummy));
end
avecond = sum(conds)./numtrials;
avetime = sum(times)./numtrials;
fprintf('\n avecond=%f avetime=%f \n', avecond, avetime);
outputname = strcat(dataname,filename,'heavy');
save([output_directory outputname '.mat'], 'perms','dataname', 'gsize', 'setsizes',...
'vols', 'cuts', 'indices', 'times', 'conds', 'filename','-v7.3');
exit;