|
From: | Elena Tea Russo |
Subject: | [igraph] invalid node ID after adding (and try to connect) the 999th node |
Date: | Sun, 15 Jul 2012 16:58:36 +0200 |
Hi all, I am working on a language network builded by adding up nodes (and the edges) with a C program reading a .txt file. (I am usin the C libraries). I start with a 1 node graph, then I add a new node and connect it with the previous one – and so on, connecting nodes by considering the text as a co-occurrence written language newtork. Everything works with small texts; but with big texts, when I reach the 999th node i get an error: when the program try to connect this node to another (existing) one by building a new edge, it gives me back a "unvalid id node" error. I tryied then to build a 10.000 nodes graph and just connect nodes following the same criteria, with the difference that now the nodes are pre-existing: nothing, the error on the 999th node edge's continue to appear. Is it a limit of igraph? Or maybe there is something I am missing? this are the parts of the programs which works on the graph: [...] igraph_i_set_attribute_table(&igraph_cattribute_table); /*variables*/ igraph_real_t reale1, reale2, reale3; igraph_integer_t old, now; old=0; igraph_t grafo; igraph_vector_t v1; igraph_vector_init(&v1, 2); igraph_vector_t nowed, olded; igraph_vector_init(&olded, 2); igraph_vector_init(&nowed, 2); igraph_strvector_t names; igraph_strvector_init(&names, 1); /*empty new graph*/ VECTOR(v1)[0]=0; VECTOR(v1)[1]=0; igraph_create(&grafo, &v1, 2,0); /*build graph*/ [...]
if(checkmatch==1) {now=match; igraph_add_edge(&grafo,old,now);} if(checkmatch==0) { [...] /*igraph_add_vertices(&grafo, 1, 0);*/ igraph_strvector_add(&names, " "); igraph_strvector_set2(&names,lastregword,temp1,cont);
igraph_add_edge(&grafo,old,now);
[...] free(temp1); ++lastregword; } [...] SETVASV(&grafo, "id", &names); igraph_write_graph_pajek(&grafo, output); /*strvector_print(&names);*/ n=igraph_vcount(&grafo); m=igraph_strvector_size(&names); printf("n=%i , m(size)=%i, lastregword= %i \n", n,m, lastregword); igraph_strvector_destroy(&names); igraph_destroy(&grafo); fclose(input); fclose(output); free(temp1); return 0; } Thank you for reading me _______________________________________ Elena Tea RUSSO - address@hidden – Italian mobile phone: +39 328 93 68 798 – Italian home phone : +39 040 568 777 – Alternative e-mail adress: address@hidden |
[Prev in Thread] | Current Thread | [Next in Thread] |