|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uci.ics.jung.algorithms.transformation.FoldingTransformer<V,E>
public class FoldingTransformer<V,E>
Methods for creating a "folded" graph based on a k-partite graph or a hypergraph.
A "folded" graph is derived from a k-partite graph by identifying a partition of vertices which will become the vertices of the new graph, copying these vertices into the new graph, and then connecting those vertices whose original analogues were connected indirectly through elements of other partitions.
A "folded" graph is derived from a hypergraph by creating vertices based on either the vertices or the hyperedges of the original graph, and connecting vertices in the new graph if their corresponding vertices/hyperedges share a connection with a common hyperedge/vertex.
Constructor Summary | |
---|---|
FoldingTransformer()
|
Method Summary | ||
---|---|---|
static
|
foldHypergraphEdges(Hypergraph<V,E> h,
org.apache.commons.collections15.Factory<Graph<V,Collection<E>>> graph_factory)
Creates a Graph which is an edge-folded version of h , where
hyperedges are replaced by k-cliques in the output graph. |
|
static
|
foldHypergraphEdges(Hypergraph<V,E> h,
org.apache.commons.collections15.Factory<Graph<V,E>> graph_factory,
org.apache.commons.collections15.Factory<E> edge_factory)
Creates a Graph which is an edge-folded version of h , where
hyperedges are replaced by k-cliques in the output graph. |
|
Graph<E,Collection<V>> |
foldHypergraphVertices(Hypergraph<V,E> h,
org.apache.commons.collections15.Factory<Graph<E,Collection<V>>> graph_factory)
Creates a Graph which is a vertex-folded version of h , whose
vertices are the input's hyperedges and whose edges are induced by adjacent hyperedges
in the input. |
|
static
|
foldHypergraphVertices(Hypergraph<V,E> h,
org.apache.commons.collections15.Factory<Graph<E,F>> graph_factory,
org.apache.commons.collections15.Factory<F> edge_factory)
Creates a Graph which is a vertex-folded version of h , whose
vertices are the input's hyperedges and whose edges are induced by adjacent hyperedges
in the input. |
|
static
|
foldKPartiteGraph(KPartiteGraph<V,E> g,
org.apache.commons.collections15.Predicate<V> p,
org.apache.commons.collections15.Factory<Graph<V,Collection<V>>> graph_factory)
Converts g into a unipartite graph whose vertices are the
vertices of g 's partition p , and whose edges
consist of collections of the intermediate vertices from other partitions. |
|
static
|
foldKPartiteGraph(KPartiteGraph<V,E> g,
org.apache.commons.collections15.Predicate<V> p,
org.apache.commons.collections15.Factory<Graph<V,E>> graph_factory,
org.apache.commons.collections15.Factory<E> edge_factory)
Converts g into a unipartite graph whose vertex set is the
vertices of g 's partition p . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FoldingTransformer()
Method Detail |
---|
public static <V,E> Graph<V,E> foldKPartiteGraph(KPartiteGraph<V,E> g, org.apache.commons.collections15.Predicate<V> p, org.apache.commons.collections15.Factory<Graph<V,E>> graph_factory, org.apache.commons.collections15.Factory<E> edge_factory)
g
into a unipartite graph whose vertex set is the
vertices of g
's partition p
. For vertices
a
and b
in this partition, the resultant
graph will include the edge (a,b)
if the original graph
contains edges (a,c)
and (c,b)
for at least
one vertex c
.
The vertices of the new graph are the same as the vertices of the
appropriate partition in the old graph; the edges in the new graph are
created by the input edge Factory
.
If there is more than 1 such vertex c
for a given pair
(a,b)
, the type of the output graph will determine whether
it will contain parallel edges or not.
This function will not create self-loops.
V
- vertex typeE
- input edge typeg
- input k-partite graphp
- predicate specifying vertex partitiongraph_factory
- factory used to create the output graphedge_factory
- factory used to create the edges in the new graph
public static <V,E> Graph<V,Collection<V>> foldKPartiteGraph(KPartiteGraph<V,E> g, org.apache.commons.collections15.Predicate<V> p, org.apache.commons.collections15.Factory<Graph<V,Collection<V>>> graph_factory)
g
into a unipartite graph whose vertices are the
vertices of g
's partition p
, and whose edges
consist of collections of the intermediate vertices from other partitions.
For vertices
a
and b
in this partition, the resultant
graph will include the edge (a,b)
if the original graph
contains edges (a,c)
and (c,b)
for at least
one vertex c
.
The vertices of the new graph are the same as the vertices of the
appropriate partition in the old graph; the edges in the new graph are
collections of the intermediate vertices c
.
This function will not create self-loops.
V
- vertex typeE
- input edge typeg
- input k-partite graphp
- predicate specifying vertex partitiongraph_factory
- factory used to create the output graph
p
partition of gpublic static <V,E> Graph<V,Collection<E>> foldHypergraphEdges(Hypergraph<V,E> h, org.apache.commons.collections15.Factory<Graph<V,Collection<E>>> graph_factory)
Graph
which is an edge-folded version of h
, where
hyperedges are replaced by k-cliques in the output graph.
The vertices of the new graph are the same objects as the vertices of
h
, and a
is connected to b
in the new graph if the corresponding vertices
in h
are connected by a hyperedge. Thus, each hyperedge with
k vertices in h
induces a k-clique in the new graph.
The edges of the new graph consist of collections of each hyperedge that connected the corresponding vertex pair in the original graph.
V
- vertex typeE
- input edge typeh
- hypergraph to be foldedgraph_factory
- factory used to generate the output graph
public static <V,E> Graph<V,E> foldHypergraphEdges(Hypergraph<V,E> h, org.apache.commons.collections15.Factory<Graph<V,E>> graph_factory, org.apache.commons.collections15.Factory<E> edge_factory)
Graph
which is an edge-folded version of h
, where
hyperedges are replaced by k-cliques in the output graph.
The vertices of the new graph are the same objects as the vertices of
h
, and a
is connected to b
in the new graph if the corresponding vertices
in h
are connected by a hyperedge. Thus, each hyperedge with
k vertices in h
induces a k-clique in the new graph.
The edges of the new graph are generated by the specified edge factory.
V
- vertex typeE
- input edge typeh
- hypergraph to be foldedgraph_factory
- factory used to generate the output graphedge_factory
- factory used to create the new edges
public static <V,E,F> Graph<E,F> foldHypergraphVertices(Hypergraph<V,E> h, org.apache.commons.collections15.Factory<Graph<E,F>> graph_factory, org.apache.commons.collections15.Factory<F> edge_factory)
Graph
which is a vertex-folded version of h
, whose
vertices are the input's hyperedges and whose edges are induced by adjacent hyperedges
in the input.
The vertices of the new graph are the same objects as the hyperedges of
h
, and a
is connected to b
in the new graph if the corresponding edges
in h
have a vertex in common. Thus, each vertex incident to
k edges in h
induces a k-clique in the new graph.
The edges of the new graph are created by the specified factory.
V
- vertex typeE
- input edge typeF
- output edge typeh
- hypergraph to be foldedgraph_factory
- factory used to generate the output graphedge_factory
- factory used to generate the output edges
public Graph<E,Collection<V>> foldHypergraphVertices(Hypergraph<V,E> h, org.apache.commons.collections15.Factory<Graph<E,Collection<V>>> graph_factory)
Graph
which is a vertex-folded version of h
, whose
vertices are the input's hyperedges and whose edges are induced by adjacent hyperedges
in the input.
The vertices of the new graph are the same objects as the hyperedges of
h
, and a
is connected to b
in the new graph if the corresponding edges
in h
have a vertex in common. Thus, each vertex incident to
k edges in h
induces a k-clique in the new graph.
The edges of the new graph consist of collections of each vertex incident to the corresponding hyperedge pair in the original graph.
h
- hypergraph to be foldedgraph_factory
- factory used to generate the output graph
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |