if not filename: print 'Error: first argument missing, input filename with BigGraph archive!' outname = len(sys.argv) > 2 and sys.argv[2] or None if not outname: #outname = '/tesis/flickr-growth.txt-200k.big_graph.passive' print 'Error: second argument missing, output filename!' exit(-1) print 'opening BigGraph ' + filename graph = BigGraph(filename) out = open(outname, 'w') total_nodes = graph.number_of_nodes() count = 0 for node, clustering in graph.get_parameter_cache_iter('clustering'): if count % 10000 == 0: print 'INFO: exporting clustering %d nodes of %d total nodes' % (count, total_nodes) out.write('%s\t\t%f\n' % (node, clustering) ) count += 1
if not filename: print 'Error: first argument missing, input filename with BigGraph archive!' outname = len(sys.argv) > 2 and sys.argv[2] or None if not outname: #outname = '/tesis/flickr-growth.txt-200k.big_graph.passive' print 'Error: second argument missing, output filename!' exit(-1) print 'opening BigGraph ' + filename graph = BigGraph(filename) out = open(outname, 'w') total_nodes = graph.number_of_nodes() count = 0 for node, shell in graph.get_parameter_cache_iter('shell'): if count % 10000 == 0: print 'INFO: exporting knn %d nodes of %d total nodes' % (count, total_nodes) out.write('%s\t\t%f\n' % (node, shell) ) count += 1
filename = len(sys.argv) > 1 and sys.argv[1] or None if not filename: print 'Error: first argument missing, input filename with BigGraph archive!' outname = len(sys.argv) > 2 and sys.argv[2] or None if not outname: #outname = '/tesis/flickr-growth.txt-200k.big_graph.passive' print 'Error: second argument missing, output filename!' exit(-1) print 'opening BigGraph ' + filename graph = BigGraph(filename) graph.debug = True out = open(outname, 'w') total_nodes = graph.number_of_nodes() count = 0 for node, triangles in graph.get_parameter_cache_iter('triangles'): if count % 10000 == 0: print 'INFO: exporting triangles %d nodes of %d total nodes' % ( count, total_nodes) out.write('%s\t\t%f\n' % (node, triangles)) count += 1
import sys filename = len(sys.argv) > 1 and sys.argv[1] or None if not filename: print 'Error: first argument missing, input filename with BigGraph archive!' outname = len(sys.argv) > 2 and sys.argv[2] or None if not outname: #outname = '/tesis/flickr-growth.txt-200k.big_graph.passive' print 'Error: second argument missing, output filename!' exit(-1) print 'opening BigGraph ' + filename graph = BigGraph(filename) out = open(outname, 'w') total_nodes = graph.number_of_nodes() count = 0 for node, knn in graph.get_parameter_cache_iter('knn'): if count % 10000 == 0: print 'INFO: exporting knn %d nodes of %d total nodes' % (count, total_nodes) out.write('%s\t\t%f\n' % (node, knn)) count += 1
lookahead = len(sys.argv) > 3 and int(sys.argv[3]) or None if not lookahead: print 'Error: third argument missing, input sphere lookahead (radius minus one)! lookahead 0 (zero) equals degree...' exit(-1) outname = len(sys.argv) > 4 and sys.argv[4] or None if not outname: #outname = '/tesis/flickr-growth.txt-200k.big_graph.passive' print 'Error: second argument missing, output filename!' exit(-1) print 'opening BigGraph ' + filename graph = BigGraph(filename) out = open(outname, 'w') total_nodes = graph.number_of_nodes() count = 0 for node, clustering in graph.get_parameter_cache_iter('%ssphere%d' % (type, lookahead)): if count % 10000 == 0: print 'INFO: exporting clustering %d nodes of %d total nodes' % ( count, total_nodes) out.write('%s\t\t%f\n' % (node, clustering)) count += 1
import sys filename = len(sys.argv) > 1 and sys.argv[1] or None if not filename: print 'Error: first argument missing, input filename with BigGraph archive!' outname = len(sys.argv) > 2 and sys.argv[2] or None if not outname: #outname = '/tesis/flickr-growth.txt-200k.big_graph.passive' print 'Error: second argument missing, output filename!' exit(-1) print 'opening BigGraph ' + filename graph = BigGraph(filename) out = open(outname, 'w') total_nodes = graph.number_of_nodes() count = 0 for node, degree in graph.get_parameter_cache_iter('degree'): if count % 10000 == 0: print 'INFO: exporting degree %d nodes of %d total nodes' % ( count, total_nodes) out.write('%s\t\t%f\n' % (node, degree)) count += 1