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 ofgraph
associated with each element ofvertex_collections
.static <V,
E, G extends Hypergraph<V, E>>
GcreateInducedSubgraph
(Collection<V> vertices, G graph) Creates the induced subgraph fromgraph
whose vertex set is equal tovertices
.
-
Constructor Details
-
FilterUtils
public FilterUtils()
-
-
Method Details
-
createInducedSubgraph
public static <V,E, G createInducedSubgraphG extends Hypergraph<V, E>> (Collection<V> vertices, G graph) Creates the induced subgraph fromgraph
whose vertex set is equal tovertices
. The graph returned hasvertices
as its vertex set, and includes all edges fromgraph
which 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 invertices
is not ingraph
-
createAllInducedSubgraphs
public static <V,E, Collection<G> createAllInducedSubgraphsG extends Hypergraph<V, E>> (Collection<? extends Collection<V>> vertex_collections, G graph) Creates the induced subgraphs ofgraph
associated 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
graph
associated with each element ofvertex_collections
-