igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] invalid node ID after adding (and try to connect) the 999th


From: Tamás Nepusz
Subject: Re: [igraph] invalid node ID after adding (and try to connect) the 999th node
Date: Sun, 15 Jul 2012 22:06:29 +0200

Hi Elena,  

Since you did not send a self-contained and compilable example that reproduces 
the problem, I can only make an educated guess. You never seem to call 
igraph_add_vertices, only igraph_add_edges. Before adding an edge to a newly 
created node, you must add the node itself.  

Hope this helps. If you are still stuck, please send us an example that 
reproduces the problem and that we can actually compile and try out.

Best,--  
T.


On Sunday, 15 July 2012 at 16:58, Elena Tea Russo wrote:

>  
> 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 (mailto:address@hidden)
> – Italian mobile phone: +39 328 93 68 798
> – Italian home phone : +39 040 568 777
>  
> – English mobile phone: +44 7511 240 652
> – Alternative e-mail adress: address@hidden (mailto:address@hidden)
>  
>  
>  
>  
> _______________________________________________
> igraph-help mailing list
> address@hidden (mailto:address@hidden)
> https://lists.nongnu.org/mailman/listinfo/igraph-help






reply via email to

[Prev in Thread] Current Thread [Next in Thread]