Ejemplo n.º 1
0
def randon_main(g, folder):
    g = gen(g)

    metrics = extractor(g.copy(), 1)
    graphBuilder(g, metrics[1], metrics[0], 'GiantRandon', folder, 1)

    metrics = extractor(g.copy(), 2)
    graphBuilder(g, metrics[1], metrics[0], 'EficRandon', folder, 2)
Ejemplo n.º 2
0
def grapher(g):
    csv_gen(g.copy(), "Vinicios", 'giant', 1)
    metrics = extractor(g.copy(), 1)
    graphBuilder(g, metrics[1], metrics[0], 'GiantComponent',
                 "Vinicios/Graphs/Giant", 1)

    csv_gen(g.copy(), "Vinicios", 'eff', 2)
    metrics = extractor(g.copy(), 2)
    graphBuilder(g, metrics[1], metrics[0], 'Efficiency',
                 "Vinicios/Graphs/Effc", 2)

    csv_gen(g.copy(), "Vinicios", 'flow', 3)
    metrics = extractor(g.copy(), 3)
    graphBuilder(g, metrics[1], metrics[0], 'TotalFlow',
                 "Vinicios/Graphs/Flow", 3)
Ejemplo n.º 3
0
def main(network):

    for net in network:
        g = _main(net)
        # csv_gen(g.copy(), 'csvOutPut', net)
        metrics = extractor(g.copy(), 1)
        graphBuilder(g, metrics[1], metrics[0], net,
                     'GeneratedGraph/GiantComponent', 1)

        # csv_gen(g.copy(),'csvOutPut', net, 2)
        metrics = extractor(g.copy(), 2)
        graphBuilder(g, metrics[1], metrics[0], net,
                     'GeneratedGraph/Efficiency', 2)

        # csv_gen(g.copy(),'csvOutPut', net, 3)
        metrics = extractor(g.copy(), 3)
        graphBuilder(g, metrics[1], metrics[0], net,
                     'GeneratedGraph/TotalFlow', 3)
Ejemplo n.º 4
0
def vinic(g, type):
    metr = extractor(g, type)
    m = metr[2]
    deg.append(m[0])
    bet.append(m[1])
    betw.append(m[2])
    stren.append(m[3])
    vuln.append(m[4])
    vulnw.append(m[5])
    eff.append(m[6])

    return [
        np.mean(deg),
        np.mean(bet),
        np.mean(betw),
        np.mean(stren),
        np.mean(vuln),
        np.mean(vulnw),
        np.mean(eff)
    ]
Ejemplo n.º 5
0
def temporary(networks, type):
    deg = []
    bet = []
    betw = []
    stren = []
    vuln = []
    vulnw = []
    eff = []
    for net in networks:
        g = _main(net)
        metr = extractor(g, type)
        m = metr[2]
        deg.append(m[0])
        bet.append(m[1])
        betw.append(m[2])
        stren.append(m[3])
        vuln.append(m[4])
        vulnw.append(m[5])
        eff.append(m[6])

        # print(mean(deg), mean(bet), mean(betw), mean(stren), mean(vuln), mean(vulnw), mean(eff))
        # return [[np.mean(deg), np.mean(bet), np.mean(betw), np.mean(stren), np.mean(vuln), np.mean(vulnw), np.mean(eff)],
        #         [np.std(deg), np.std(bet), np.std(betw), np.std(stren), np.std(vuln), np.std(vulnw), np.std(eff)]]
        return [deg, bet, betw, stren, vuln, vulnw, eff]