igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Memory management issue


From: Gabor Csardi
Subject: Re: [igraph] Memory management issue
Date: Mon, 20 Nov 2006 21:53:38 -0500
User-agent: Mutt/1.5.11

Vincent,

there is a problem with the algorithm, since it does not produce the correct
results, i've tried it for trees, see the attached file, if you run that it
is clear that something is wrong. Just draw the tree in the example and 
you'll see. But it is possible to correct it, easily.

Gabor

On Mon, Nov 20, 2006 at 08:31:09PM -0500, Vincent Matossian wrote:
> 
>  Thanks for your prompt response Gabor!
> 
> I have gone through a few implementations to obtain neighborhood views. In 
> this
> one I maintain the distance to each original vertex using the 'steps' and
> 'order' variables.
> 
> Basically, the neighbors are appended to the processing queue only till one
> step before the desired level is reached (immediate neighbors are added by
> default), at which point all the neighbors of the vertices still in the queue
> are popped and added to the final 'view' of the vertex.
> 
> I don't know how I came up with this implementation, it was late and I thought
> it made sense...I still think it does, but I agree that it's not obvious :)
> 
> Anyhow, I am  fresh to R and particularly its development in C, so the file
> that I have attached ( neighborhood.c) is a very primitive test for the 
> renamed
> neighborhood function. The main function creates a straight line and my test
> code might not be very telling. I still don't know how to create better test
> cases in C alone.
> 
> I could also attach the .R file and corresponding rinterface and namespace
> components, but I'm not sure how it would be best done. Is it best to create a
> whole independent package that extends igraph, or  just send the files? I'm
> still reading the Writing R extensions to figure these things out, sorry for
> not providing appropriately testable code, please let me know what's best.
> 
> Btw, thanks for the recommendation for the renaming, I realized only later 
> that
> visitors was approprately named for graph traversals. I have now renamed my
> call to neighborhood. Also, I would certainly not object adding neighborhood 
> to
> igraph, once the resulting high number of subgraph creation memory issue gets
> resolved.
> 
> Thanks again, keep me posted,
> 
> Vincent
> 

-- 
Csardi Gabor <address@hidden>    MTA RMKI, ELTE TTK

Attachment: neighborhood.c
Description: Text Data


reply via email to

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