コード例 #1
0
    def testDegree(self):

        degrees = list(self.graph.degrees(self.nodes))
        p = Plot()
        p.clear()
        p.title = 'Degree distribution'
        p.x_label = 'd : node degree'
        p.y_label = 'P(d)'
        p.dist_plot(degrees, 10, True, True, True)
        #p.show()
        pass
コード例 #2
0
 def testClust(self):
     clusts = list(self.graph.clustering_indices(self.nodes))
     p = Plot()
     p.clear()
     p.title = 'Clustering index distribution'
     p.x_label = 'c : node clustering index'
     p.y_label = 'P(c)'
     _, _ = p.dist_plot(clusts, 10, True, True, True)
     #p.show()
     pass
コード例 #3
0
    def testCompleteAnalysis(self):

        p = Plot()
        p.debug = False
        sample_size = 10
        bins = 10
        p.init_complete_analysis(self.graph, '/tmp/graph_analysis',
                                 sample_size, bins)
        p.complete_analysis(self.graph)
コード例 #4
0
    def testPlotSave(self):
        self.graph = Graph()
        self.graph.debug = False
        self.graph.input_debug_links = 200000
        self.graph.output_debug_nodes = 10000
        self.graph.load_edgelist(StringIO(example_txt))

        clusts = list(self.graph.eccentricities())
        clusts
        p = Plot()
        p.clear()
        p.hist(clusts, 3, True, True, True)
        p.save('testPlotSave.png')
コード例 #5
0
    def testGraphHistogram(self):
        self.graph = Graph()
        self.graph.debug = False
        self.graph.input_debug_links = 200000
        self.graph.output_debug_nodes = 10000
        self.graph.load_edgelist(StringIO(example_txt2))

        degrees = list(self.graph.degrees())
        p = Plot()
        p.clear()
        p.hist(degrees, 15, True, True, False)
コード例 #6
0
 def testBasicHistogram(self):
     x = map(lambda x: 2**x, range(0, 5))
     p = Plot()
     p.clear()
     p.hist(x, 4, False, False, False)
コード例 #7
0
#graph.max_links_input = 5*10**4
#graph.max_nodes_analysis = 10000

folder = len(sys.argv) > 2 and sys.argv[2] or None

if not folder:
    #folder = '/tesis/flickr-growth.txt-200k.big_graph.analysis'
    print 'Error: second argument missing, output folder name!'
    exit(-1)

user_params = len(sys.argv) > 3 and sys.argv[3] or None

if not user_params:
    user_params = 'degree,clustering,knn'

p = Plot(debug)

sample_size = graph.number_of_nodes()
bins = 8
compute_data = True

params = {
    'degree': 10,  #17,
    'clustering': 10,  #15,
    'knn': 10,  #12,
    'kcore': 10,  #10,
    'triangles': 10,
    'linksphere1': 10,
    #'linksphere2' : 10,
    #'linksphere3' : 10,
    'nodesphere1': 10,
コード例 #8
0
 def testPlot2D(self):
     x = range(0, 5) + [1]
     y = map(lambda x: 2**x, range(0, 5)) + [3]
     p = Plot()
     p.clear()
     p.dist_plot_2d(x, y, 5, False)