Class FilterUtils
- java.lang.Object
-
- edu.uci.ics.jung.algorithms.filters.FilterUtils
-
public class FilterUtils extends java.lang.Object
Utility methods relating to filtering.
-
-
Constructor Summary
Constructors Constructor Description FilterUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <V,E,G extends edu.uci.ics.jung.graph.Hypergraph<V,E>>
java.util.Collection<G>createAllInducedSubgraphs(java.util.Collection<? extends java.util.Collection<V>> vertex_collections, G graph)
Creates the induced subgraphs ofgraph
associated with each element ofvertex_collections
.static <V,E,G extends edu.uci.ics.jung.graph.Hypergraph<V,E>>
GcreateInducedSubgraph(java.util.Collection<V> vertices, G graph)
Creates the induced subgraph fromgraph
whose vertex set is equal tovertices
.
-
-
-
Method Detail
-
createInducedSubgraph
public static <V,E,G extends edu.uci.ics.jung.graph.Hypergraph<V,E>> G createInducedSubgraph(java.util.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 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:
java.lang.IllegalArgumentException
- if any vertex invertices
is not ingraph
-
createAllInducedSubgraphs
public static <V,E,G extends edu.uci.ics.jung.graph.Hypergraph<V,E>> java.util.Collection<G> createAllInducedSubgraphs(java.util.Collection<? extends java.util.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 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
-
-