|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An EfficientFilter can take in an UnassembledGraph withut assembling it, and is used for non-structural filters. In general, EfficientFilters are those that look at vertices on their own, based on their attributes, as opposed to examining their structure.
This is an efficiency measure for handling streams of filters. Sometimes, a program needs to run a series of filters--for example, to cut out all vertices with field "color" is "green" and field "size" is "large". Rather than creating one custom filter that checks both, one can run those two filters serially. The code might look something like this:
Filter f_1 = new ColorFilter( "green" ); Filter f_2 = new SizeFilter( "large "); Graph green_graph = f_1.filter( graph ).assemble(); Graph large_green_graph = f_2.filter( green_graph ).assemble()Unfortunately, assembly can be an expensive process--it requires a full pass through the graph, checking each vertex and each edge. The
EfficientFilter
takes this into account and lets
a user specify the faster parts:
EfficientFilter f_1 = new ColorFilter( "green" ); EfficientFilter f_2 = new SizeFilter( "large "); UnassembledGraph green_u_graph = f_1.filter( graph ); // note: no call to assemble Graph large_green_graph = f_2.filter( green_u_graph ).assemble()which can be simplified to a chain as
EfficientFilter f_1 = new ColorFilter( "green" ); EfficientFilter f_2 = new SizeFilter( "large "); Graph large_green_graph = f_2.filter( f_1.filter( graph )).assemble(); // note: no call to assemble
vertex degree
and
vertex neighbors
are likely to be inaccurate. Thus, the
DropSoloNodesFilter
does not implement EfficientFilter, because it examines the degree of each vertex.
This is taken into consideration correctly for SerialFilter
.
Method Summary | |
UnassembledGraph |
filter(UnassembledGraph ug)
Filters a graph by returning an UnassembledGraph consisting of nodes and edges that pass the filter. |
Methods inherited from interface edu.uci.ics.jung.graph.filters.Filter |
filter, getName |
Method Detail |
public UnassembledGraph filter(UnassembledGraph ug)
Filter
.
ug
- An unassembled graph to be filtered.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |