Statistics
| Branch: | Revision:

root / custompackages / graph-parser / src / main.cpp @ c6961065

History | View | Annotate | Download (1.14 KB)

1
#include <iostream>
2
#include "parser.h"
3
#include "utility.h"
4
#include "centrality.h"
5

    
6

    
7
void handleSimpleInput(string filePath) {
8
    // Read the input.edges
9
    Graph g;
10
    readEdgeFile(filePath, g);
11

    
12
    cout << "Finish creating graph" << endl;
13

    
14
    simpleBetweennessCentrality(g, "edge_list");
15
}
16

    
17
void handleJsonInput(string filePath) {
18
    Graph g;
19
    readJson(filePath, g);
20
    printGraph(g);
21

    
22
    // Applying the betweenness centrality
23
    simpleBetweennessCentrality(g, "json_olsr");
24

    
25
    cout << "Done with Betweenness Centrality" << endl;
26
}
27

    
28
void handleComplexJsonInput(string filePath) {
29
    Graph g;
30
    readComplexJson(filePath, g);
31
    printGraph(g);
32

    
33
    // Applying the betweenness centrality
34
    simpleBetweennessCentrality(g, "json_topology");
35

    
36
    cout << "Done with Betweenness Centrality" << endl;
37
}
38

    
39

    
40
int main(int, char *[]) {
41
    string edgeFilePath = "../input/ninux_30_1.edges";
42
    handleSimpleInput(edgeFilePath);
43

    
44
    string jsonFilePath = "../input/olsr-netjson.json";
45
    handleJsonInput(jsonFilePath);
46

    
47
    string complexJsonFilePath = "../input/jsoninfo_topo.json";
48
    handleComplexJsonInput(complexJsonFilePath);
49

    
50
    return 0;
51
}