Exemple #1
0
def computePLDistribution(gr, interval):
    clsv = algorithms.importance.closeness_centrality.getClosenessVectors(gr)
    cls = []
    for v in clsv.values():
        cls.extend(v)
    print min(cls)
    return distribution.computeDistribution(cls, 0, max(cls), interval, len(cls))
Exemple #2
0
def computeNodeBetweennessDistribution(gr):
    numnodes = gr.getNumNodes()
    nbs = algorithms.importance.betweenness_centrality.getNodeBetnSeq(gr)
    return distribution.computeDistribution(nbs, 0, numnodes * (numnodes - 1), numnodes)
Exemple #3
0
def computeEdgeBetweennessEntropy(gr):
    numedges = gr.getNumEdges()
    numnodes = gr.getNumNodes()
    ebs = algorithms.importance.betweenness_centrality.getEdgeBetnSeq(gr)
    ebd = distribution.computeDistribution(ebs, 0, numnodes * (numnodes - 1), numedges)
    return entropy.computeEntropy(ebd)
Exemple #4
0
def computeEdgeConnectivityDistribution(gr):
    econ = robustness.robustness_measures.getConnSeq(gr)
    return distribution.computeDistribution(econ, 0, max(econ), len(econ))
Exemple #5
0
def computeOutdegreeDistributionEntropy(gr):
    numnodes = gr.getNumNodes()
    ds = algorithms.importance.degree_centrality.getOutDegSeq(gr)
    dd = distribution.computeDistribution(ds, 0, numnodes - 1, numnodes)
    return entropy.computeEntropy(dd)
Exemple #6
0
def computeDegreeDistribution(gr):
    numnodes = gr.getNumNodes()
    ds = algorithms.importance.degree_centrality.getDegSeq(gr)    
    return distribution.computeDistribution(ds, 0, numnodes - 1, numnodes)