[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] igraph BFS
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] igraph BFS |
Date: |
Wed, 19 May 2010 12:15:15 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Hi Ashwin,
> * the void *extra can be used to pass additional argument into the callback
> function. What if I need to pass more than one argument? In my case, I need
> to pass two igraph_vectors.
Wrap those two vectors in a struct and pass the pointer of that struct
to your function. E.g.:
typedef struct {
igraph_vector_t* first;
igraph_vector_t* second;
} vector_pair;
[...]
vector_pair pair;
pair.first = my_first_vector;
pair.second = my_second_vector;
igraph_bfs([...], &pair);
> * From the DFS output, i see that the nodes are processed in-order. Is there
> any way to change this to a pre-order traversal? One way I can do this is,
> use the out_callback function? This would guarantee that the children are
> processed before the parent. (tested this to be true)
Yes, I think out_callback can be used for that. (I'm not 100% sure,
however, it was Gabor who implemented igraph_dfs, so he might know the
internal details better than me).
--
Tamas
- [igraph] igraph BFS, Ashwin Kumar, 2010/05/18
- Re: [igraph] igraph BFS, Tamas Nepusz, 2010/05/18
- Re: [igraph] igraph BFS, Tamas Nepusz, 2010/05/18
- Re: [igraph] igraph BFS, Ashwin Kumar, 2010/05/18
- Re: [igraph] igraph BFS, Tamas Nepusz, 2010/05/18
- Re: [igraph] igraph BFS, Ashwin Kumar, 2010/05/18
- Re: [igraph] igraph BFS, Ashwin Kumar, 2010/05/19
- Re: [igraph] igraph BFS,
Tamas Nepusz <=
- Re: [igraph] igraph BFS, Ashwin Kumar, 2010/05/19
- Re: [igraph] igraph BFS, Tamas Nepusz, 2010/05/19
- Re: [igraph] igraph BFS, Ashwin Kumar, 2010/05/19
- Re: [igraph] igraph BFS, Tamas Nepusz, 2010/05/19
- Re: [igraph] igraph BFS, Ashwin Kumar, 2010/05/19