def sample(): """run a WIS_WR sample and print the results to a file for plotting""" graph = nx.read_edgelist("p2p-Gnutella31.txt", delimiter="\t", nodetype=int) collected = {} for size in xrange(0, 30001, 5000): if size == 0: continue print "WIS_WR sample size: ", size collected[size] = plotter.run(3, wis_wr_size_estimate, {"n_samples": size, "graph": graph}) plotter.print_data("wis_wr.data", collected) print "Finished"
def sample(): """run a UIS_WR sample and print the results to a file for plotting""" graph = nx.read_edgelist("p2p-Gnutella31.txt", delimiter='\t', nodetype=int) collected = {} for size in xrange(0, 30001, 5000): if size == 0: continue print 'UIS_WR sample size: ', size collected[size] = plotter.run(3, uis_wr_size_estimate, {'n_samples': size, 'graph': graph}) plotter.print_data('uis_wr.data', collected) print 'Finished'
def increasing_walk_length_sample_is_10000(): collected = {} for walk in xrange(0,600,50): if walk == 0: continue # ugly hack to skip first collected[walk] = plotter.run(3, mhrw.gnutella_mhrw, {'samples': 10000, 'length': walk, 'thinning': 5}) return collected def increasing_thinning_sample_is_10000_walk_is_100(): collected = {} for thinning in xrange(1,20,1): collected[thinning] = plotter.run(1, mhrw.gnutella_mhrw, {'samples': 10000, 'length': 300, 'thinning': thinning}) return collected if '__main__' == __name__: sample_size = increasing_sample_size() plotter.print_data("mhrw_size.data", sample_size) walk = increasing_walk_length_sample_is_10000() plotter.print_data("mhrw_walk.data", walk) thinning = increasing_thinning_sample_is_10000_walk_is_100() plotter.print_data("mhrw_thinning.data", thinning)