igraph-help
[Top][All Lists]
Advanced

[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:24:46 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

> The out_callback signature is (igraph_t *, igraph_integer_t ,
> igraph_integer_t, void *)
> May I know what is passed in the two integers ? The first one is vid
> currently being processed (I printed it), but what is the second one?
Judging from the source code, it is the distance of the vertex from the
root. (See visitors.c, line 439).

> Can I know the parent of the current node?
As far as I know, they are not passed to the callback functions.
However, if you pass an igraph_vector_t* to the "father" argument of
igraph_dfs, that vector will be filled with the parent IDs for each
vertex and I think you can safely use that vector from the
out_callback. (I haven't tried it, though, I'm only looking at the
source code).

-- 
Tamas



reply via email to

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