comparison louvain/graph.h @ 0:1d1b9e1b2e2f draft

Uploaded
author petr-novak
date Thu, 19 Dec 2019 10:24:45 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1d1b9e1b2e2f
1 // File: graph.h
2 // -- simple graph handling header file
3 //-----------------------------------------------------------------------------
4 // Community detection
5 // Based on the article "Fast unfolding of community hierarchies in large networks"
6 // Copyright (C) 2008 V. Blondel, J.-L. Guillaume, R. Lambiotte, E. Lefebvre
7 //
8 // This program must not be distributed without agreement of the above mentionned authors.
9 //-----------------------------------------------------------------------------
10 // Author : E. Lefebvre, adapted by J.-L. Guillaume
11 // Email : jean-loup.guillaume@lip6.fr
12 // Location : Paris, France
13 // Time : February 2008
14 //-----------------------------------------------------------------------------
15 // see readme.txt for more details
16
17 #ifndef GRAPH_H
18 #define GRAPH_H
19
20 #include <stdlib.h>
21 #include <stdio.h>
22 #include <iostream>
23 #include <iomanip>
24 #include <fstream>
25 #include <vector>
26 #include <map>
27 #include <set>
28 #include <algorithm>
29
30 #define WEIGHTED 0
31 #define UNWEIGHTED 1
32
33 using namespace std;
34
35 class Graph {
36 public:
37 vector<vector<pair<int,float> > > links;
38
39 Graph (char *filename, int type);
40
41 void clean(int type);
42 void renumber(int type);
43 void display(int type);
44 void display_binary(char *filename, char *filename_w, int type);
45 };
46
47 #endif // GRAPH_H