igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] igraph_community_fastgreedy() in C


From: Guilherme Ferraz de Arruda
Subject: Re: [igraph] igraph_community_fastgreedy() in C
Date: Mon, 11 Oct 2010 23:28:46 -0300

Hi,

I was trying to use the EANV(), but i got an error with this function.
I got segmentation fault

I write a function to find communities:

int ComunidadesFastgreedy(igraph_t *grafo, igraph_vector_t* atributos,
                       igraph_vector_t* modularity, igraph_matrix_t* merges){

 igraph_vector_init(atributos, 0);
 igraph_vector_init(modularity,0);
 igraph_matrix_init(merges, 0, 0);

 EANV(grafo, NULL, atributos);

 igraph_community_fastgreedy(grafo, atributos, merges, modularity);
}

Using a debuger i saw that i got seg fault at: EANV(grafo, NULL, atributos);

if ai comment this line and put NULL at igraph_community_fastgreedy(),
my program runs without any problem.

Sorry for sending this email, but i lose more then 4 hours with this
kind of problems today.

2010/10/10 Gábor Csárdi <address@hidden>:
> On Sun, Oct 10, 2010 at 11:54 PM, Guilherme Ferraz de Arruda
> <address@hidden> wrote:
>> Ok, but,
>>
>> I have created my graph with:
>>
>> igraph_weighted_adjacency(grafo, &w_adj, IGRAPH_ADJ_MAX, 0);
>>
>> can i use the name parameter as NULL at EANV()?
>>
>> #define EANV(graph,n,vec)
>> graph: The graph.
>> n: The name of the attribute.
>> vec: Pointer to an initialized vector, the result is stored here. It
>> will be resized, if needed.
>>
>> what is the name that i need to use?
>
> http://igraph.sourceforge.net/doc/html/igraph_weighted_adjacency.html
>
> says:
>
> "attr:    the name of the attribute that will store the edge weights.
> If NULL , it will use weight as the attribute name."
>
> so if you used NULL, the name of the attribute will be "weight".
>
> Best,
> Gabor
>
>> Thanks for all.
>>
>> Guilherme.
>>
>> 2010/10/10 Gábor Csárdi <address@hidden>:
>>> Hi,
>>>
>>> for this you need to use the attribute handler, as
>>> igraph_weighted_adjacency adds edge weights as attributes. Please see
>>> http://igraph.sourceforge.net/doc/html/ch09s02.html
>>> http://igraph.sourceforge.net/doc/html/ch09s02s01.html#igraph_cattribute_EANV
>>> http://igraph.sourceforge.net/doc/html/ch09s02s01.html#EANV
>>>
>>> Then you can pass the edge weight vector to igraph_community_fastgreedy.
>>>
>>> Best,
>>> Gabor
>>>
>>> On Sat, Oct 9, 2010 at 8:26 PM, Guilherme Ferraz de Arruda
>>> <address@hidden> wrote:
>>>> Hi,
>>>>
>>>> I was trying to use the igraph_community_fastgreedy() function with C,
>>>> but how can i use the: const igraph_vector_t *weights ?
>>>> What is the sequence of edges?
>>>>
>>>> I have builded my graph with igraph_weighted_adjacency(), may i need
>>>> to use the weights vector?
>>>>
>>>> Thanks for all.
>>>>
>>>> Guilherme.
>>>>
>>>> _______________________________________________
>>>> igraph-help mailing list
>>>> address@hidden
>>>> http://lists.nongnu.org/mailman/listinfo/igraph-help
>>>>
>>>
>>>
>>>
>>> --
>>> Gabor Csardi <address@hidden>     UNIL DGM
>>>
>>
>
>
>
> --
> Gabor Csardi <address@hidden>     UNIL DGM
>



reply via email to

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