edu.uci.ics.jung.algorithms.connectivity
Class KNeighborhoodExtractor

java.lang.Object
  extended byedu.uci.ics.jung.algorithms.connectivity.KNeighborhoodExtractor

public class KNeighborhoodExtractor
extends java.lang.Object

Extracts the subgraph (neighborhood) from a graph whose nodes are no more than distance k away from at least one of the root nodes (starting vertices).

Author:
Scott White and Danyel Fisher

Constructor Summary
KNeighborhoodExtractor()
           
 
Method Summary
static Graph extractInDirectedNeighborhood(DirectedGraph graph, java.util.Set rootNodes, int radiusK)
          Extracts the subgraph comprised of all vertices within distance K (in-directed) from any node in rootNodes.
static Graph extractNeighborhood(Graph graph, java.util.Set rootNodes, int radiusK)
          Extracts the subgraph comprised of all vertices within distance K (undirected) from any node in rootNodes.
static Graph extractOutDirectedNeighborhood(DirectedGraph graph, java.util.Set rootNodes, int radiusK)
          Extracts the subgraph comprised of all vertices within distance K (out-directed) from any node in rootNodes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KNeighborhoodExtractor

public KNeighborhoodExtractor()
Method Detail

extractNeighborhood

public static Graph extractNeighborhood(Graph graph,
                                        java.util.Set rootNodes,
                                        int radiusK)
Extracts the subgraph comprised of all vertices within distance K (undirected) from any node in rootNodes.

Parameters:
graph - the graph whose subgraph is to be extracted
rootNodes - the set of root nodes (starting vertices) in the graph
radiusK - the radius of the subgraph to be extracted

extractOutDirectedNeighborhood

public static Graph extractOutDirectedNeighborhood(DirectedGraph graph,
                                                   java.util.Set rootNodes,
                                                   int radiusK)
Extracts the subgraph comprised of all vertices within distance K (out-directed) from any node in rootNodes.

Parameters:
graph - the graph whose subgraph is to be extracted
rootNodes - the set of root nodes (starting vertices) in the graph
radiusK - the radius of the subgraph to be extracted

extractInDirectedNeighborhood

public static Graph extractInDirectedNeighborhood(DirectedGraph graph,
                                                  java.util.Set rootNodes,
                                                  int radiusK)
Extracts the subgraph comprised of all vertices within distance K (in-directed) from any node in rootNodes.

Parameters:
graph - the graph whose subgraph is to be extracted
rootNodes - the set of root nodes (starting vertices) in the graph
radiusK - the radius of the subgraph to be extracted