igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] vertex ids and function igraph_vcount(const igraph_t *grap


From: Gábor Csárdi
Subject: Re: [igraph] vertex ids and function igraph_vcount(const igraph_t *graph)
Date: Fri, 7 Aug 2009 23:19:17 +0200

Hi Christian,

vertices are always numbered from zero in igraph, up to the number of
vertices minus one. Please read
http://igraph.sourceforge.net/doc/html/ch03s02.html and perhaps
http://igraph.sourceforge.net/doc/html/ch04s01.html

Best,
Gabor

On Fri, Aug 7, 2009 at 11:13 PM, Christian
Gonzalez<address@hidden> wrote:
> Hello everybody
>    if you have a graph with six edges like this:
>
>
> ...
> igraph_t graph;
> igraph_vector_t edges;
>
> ...
>
> igraph_vector_init(&edges, 6);
>
> ...
>
> VECTOR(edges)[0] = 1200000
> VECTOR(edges)[1] = 1200001
> VECTOR(edges)[2] = 846
> VECTOR(edges)[3] = 30000000
> VECTOR(edges)[4] = 1200001
> VECTOR(edges)[5] = 846
>
> ...
>
> igraph_create(&graph, &edges, 0, IGRAPH_DIRECTED)
>
>
>
> How many memory is reserved for the vertex vector? --> 4 or 30000000
> positions?
> because if you call function  igraph_vcount(&graph), the return is 30000000
> instead of 4.
>
> Why this functions returns the maximum vertex id? instead of the number of
> vertex in the graph
>
>
> Regards,
> Christian
>
>
>
>
>
>
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM




reply via email to

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