Class FilterUtils
java.lang.Object
edu.uci.ics.jung.algorithms.filters.FilterUtils
Utility methods relating to filtering.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <V, E, G extends Hypergraph<V,E>>
Collection<G> createAllInducedSubgraphs(Collection<? extends Collection<V>> vertex_collections, G graph) Creates the induced subgraphs ofgraphassociated with each element ofvertex_collections.static <V, E, G extends Hypergraph<V,E>>
GcreateInducedSubgraph(Collection<V> vertices, G graph) Creates the induced subgraph fromgraphwhose vertex set is equal tovertices.
-
Constructor Details
-
FilterUtils
public FilterUtils()
-
-
Method Details
-
createInducedSubgraph
public static <V, E, G extends Hypergraph<V,E>> G createInducedSubgraph(Collection<V> vertices, G graph) Creates the induced subgraph fromgraphwhose vertex set is equal tovertices. The graph returned hasverticesas its vertex set, and includes all edges fromgraphwhich are incident only to elements ofvertices.- Type Parameters:
V- the vertex typeE- the edge typeG- the graph type- Parameters:
vertices- the subset ofgraph's vertices around which the subgraph is to be constructedgraph- the graph whose subgraph is to be constructed- Returns:
- the subgraph induced by
vertices - Throws:
IllegalArgumentException- if any vertex inverticesis not ingraph
-
createAllInducedSubgraphs
public static <V, E, G extends Hypergraph<V,E>> Collection<G> createAllInducedSubgraphs(Collection<? extends Collection<V>> vertex_collections, G graph) Creates the induced subgraphs ofgraphassociated with each element ofvertex_collections. Note that these vertex collections need not be disjoint.- Type Parameters:
V- the vertex typeE- the edge typeG- the graph type- Parameters:
vertex_collections- the collections of vertex collections to be used to induce the subgraphsgraph- the graph whose subgraphs are to be created- Returns:
- the induced subgraphs of
graphassociated with each element ofvertex_collections
-