[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] graph components
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] graph components |
Date: |
Wed, 25 Nov 2009 22:03:05 +0100 |
Hi,
On Wed, Nov 25, 2009 at 9:20 PM, zhengjun chen <address@hidden> wrote:
> Hi,
> I want to calculate the number of components in an undirected graph.
> I use the function in such way:
> igraph_integer_t num; // it is used to store the number of components
> igraph_clusters(&graph,NULL,&clusters,&num,IGRAPH_WEAK);
> printf("number of components: %d\n",num);
This should be
printf("number of components: %d\n", (int) num);
Don't rely on igraph_integer_t being an integer.
Gabor
> But it always shows "number of components is: 0". Actually the number of
> components in my graph is two.
>
> --
> Thanks
> zhengjun
>
> Graduate research assistant
> Dept of Computer Science and Engineering
> Lehigh University
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
--
Gabor Csardi <address@hidden> UNIL DGM