I have a large graph that I am processing using JUNG. I was wondering if there JUNG provides a way to extract say a 2-hop neighborhood of a vertex (complete with all edges amongst themselves) into a separate graph?
A:
In JUNG 2.0 it is edu.uci.ics.jung.algorithms.filters.KNeighborhoodFilter
/** * A filter used to extract the k-neighborhood around one or more root node(s). * The k-neighborhood is defined as the subgraph induced by the set of * vertices that are k or fewer hops (unweighted shortest-path distance) * away from the root node. * * @author Danyel Fisher */
Christoph
2010-07-29 16:10:04