Revision 739fe075 fiddle/heuristic-betweenness-centrality/compare.py

View differences:

fiddle/heuristic-betweenness-centrality/compare.py
29 29

  
30 30

  
31 31
if __name__ == '__main__':
32
    filepath_prefixes = ['/output/networkx_', '/output/heuristic_']
32
    filepath_prefixes = ['/output/networkx_', '/output/weight_basic_', '/output/heuristic_']
33 33
    types = ['edge_list']
34 34
    extension = '.csv'
35 35

  
......
38 38
        filepaths = [MAIN_CODE_DIR + p + t + extension for p in filepath_prefixes]
39 39

  
40 40
        nx_scores = read_centrality_score(filepaths[0])
41
        boost_scores = read_centrality_score(filepaths[1])
41
        weight_basic_scores = read_centrality_score(filepaths[1])
42
        heuristic_scores = read_centrality_score(filepaths[2])
42 43

  
43 44
        sorted_nx_scores = sort_value_of_dictionary(nx_scores)
44 45

  
......
47 48
        print "Compare"
48 49
        with open(MAIN_CODE_DIR + '/output/score_summary_%s.txt' % t, 'w') as output:
49 50
            for key, nx in sorted_nx_scores:
50
                boost = boost_scores[key]
51
                output.write('%s\t%s\t%s\n' % (key, nx, boost))
51
                weight_basic = weight_basic_scores[key]
52
                heuristic = heuristic_scores[key]
53
                output.write('%s\t%s\t%s\t%s\n' % (key, nx, weight_basic, heuristic))
52 54

  
53 55

  

Also available in: Unified diff