Statistics
| Branch: | Revision:

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

History | View | Annotate | Download (1.14 KB)

1 af008982 Quynh PX Nguyen
#include <iostream>
2 04a9ef10 Quynh PX Nguyen
#include "parser.h"
3 6a12e353 Quynh PX Nguyen
#include "utility.h"
4 c6961065 Quynh PX Nguyen
#include "centrality.h"
5 04a9ef10 Quynh PX Nguyen
6
7
void handleSimpleInput(string filePath) {
8
    // Read the input.edges
9
    Graph g;
10 6a12e353 Quynh PX Nguyen
    readEdgeFile(filePath, g);
11
12 04a9ef10 Quynh PX Nguyen
    cout << "Finish creating graph" << endl;
13
14
    simpleBetweennessCentrality(g, "edge_list");
15 af008982 Quynh PX Nguyen
}
16
17
void handleJsonInput(string filePath) {
18
    Graph g;
19
    readJson(filePath, g);
20
    printGraph(g);
21
22
    // Applying the betweenness centrality
23 04a9ef10 Quynh PX Nguyen
    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 af008982 Quynh PX Nguyen
36
    cout << "Done with Betweenness Centrality" << endl;
37
}
38
39 04a9ef10 Quynh PX Nguyen
40 af008982 Quynh PX Nguyen
int main(int, char *[]) {
41
    string edgeFilePath = "../input/ninux_30_1.edges";
42 04a9ef10 Quynh PX Nguyen
    handleSimpleInput(edgeFilePath);
43 af008982 Quynh PX Nguyen
44
    string jsonFilePath = "../input/olsr-netjson.json";
45
    handleJsonInput(jsonFilePath);
46 04a9ef10 Quynh PX Nguyen
47
    string complexJsonFilePath = "../input/jsoninfo_topo.json";
48
    handleComplexJsonInput(complexJsonFilePath);
49
50 af008982 Quynh PX Nguyen
    return 0;
51
}