#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <igraph.h>
int main(void) {
igraph_t graph;
FILE *myfile;
igraph_vector_t membership;
igraph_vector_t weights;
igraph_vector_t initial;
igraph_vector_bool_t fixed;
igraph_integer_t num_nodes, num_edges;
myfile = fopen("europe.gml", "r");
igraph_read_graph_gml(&graph, myfile);
fclose(myfile);
num_nodes = igraph_vcount(&graph);
igraph_vector_init(&membership, num_nodes);
num_edges = igraph_ecount(&graph);
igraph_vector_init(&weights, num_edges);
for(int i=0; i<igraph_vector_size(&weights); i++)
{
VECTOR(weights)[i] = 1;
/* VECTOR(initial)[i] = i;
VECTOR(fixed)[i] = 0;*/
}
igraph_community_label_propagation(&graph, &membership, &weights, &initial, &fixed);
cout << "Number of nodes: " << num_nodes << "\n Number of edges: " << num_edges << "\n";
igraph_vector_destroy(&membership);
igraph_vector_destroy(&weights);
igraph_destroy(&graph);
return 0;
}