Re: [jgrapht-users] get a set of neighbors
Brought to you by:
barak_naveh,
perfecthash
From: Khanh N. <kn...@cs...> - 2009-08-11 14:34:32
|
Hi, Thank you very much for your response. I took a closer look yesterday, I'm currently using NeighborIndex, is it efficient? My graph has 10.000 nodes. -k On Tue, Aug 11, 2009 at 12:18 AM, Xueyang Zhu<xue...@gm...> wrote: > HI, > > Try the following: > > for(DefaultEdge e:g.edgesOf(X)){ > Vertex v=g.getEdgeTarget(e); > ..... > > } > > > > 2009/8/10 Khanh Nguyen <ngu...@gm...> >> >> Hello all, >> >> I am new to JGraphT (just started this morning). I am working on a >> simple random search on a graph and I need to get the set of neighbors >> of each vertex. How do I do it? >> >> My attempt is to use edgesOf() method to get the set of edges of >> vertex X, but I don't know how to go next from there, as all methods >> in DefaultVertex are protected. It looks like this >> >> Set<DefaultEdge> s = g.edgesOf(X); >> ...? >> >> I guess, I could also try to implement an Iterator? but it seems more >> advanced at this point for me. >> >> Thanks. >> >> -k >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day >> trial. Simplify your report design, integration and deployment - and focus >> on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> jgrapht-users mailing list >> jgr...@li... >> https://lists.sourceforge.net/lists/listinfo/jgrapht-users > > |