Ejemplo n.º 1
0
if __name__ == "__main__":
    import time
    start = time.time()

    G = nx.read_gpickle("../../graphs/hep.gpickle")
    print 'Read graph G'
    print time.time() - start

    model = "MultiValency"

    if model == "MultiValency":
        ep_model = "range"
    elif model == "Random":
        ep_model = "random"
    elif model == "Categories":
        ep_model = "degree"

    # get propagation probabilities
    Ep = dict()
    with open("Ep_hep_%s1.txt" %ep_model) as f:
        for line in f:
            data = line.split()
            Ep[(int(data[0]), int(data[1]))] = float(data[2])

    I = 1000

    S = newGreedyIC(G, 10, Ep)
    print S
    print avgIAC(G, S, Ep, I)
 def mapAvgSize (S):
     return runIAC.avgIAC(G, S, Ep, I)
Ejemplo n.º 3
0
 def mapAvgSize(S):
     return runIAC.avgIAC(G, S, Ep, I)
Ejemplo n.º 4
0
def mapAvgSize (args):
    G, S, Ep, I = args
    return avgIAC(G, S, Ep, I)