[jgrapht-users] get a set of neighbors
Brought to you by:
barak_naveh,
perfecthash
From: Khanh N. <ngu...@gm...> - 2009-08-10 13:52:20
|
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 |