edu.uci.ics.jung.graph.impl
Class KPartiteSparseGraph
java.lang.Object
edu.uci.ics.jung.utils.UserDataDelegate
edu.uci.ics.jung.graph.impl.AbstractArchetypeGraph
edu.uci.ics.jung.graph.impl.AbstractSparseGraph
edu.uci.ics.jung.graph.impl.SparseGraph
edu.uci.ics.jung.graph.impl.KPartiteSparseGraph
- All Implemented Interfaces:
- ArchetypeGraph, Graph, KPartiteGraph, UserDataContainer, Cloneable
public class KPartiteSparseGraph
- extends SparseGraph
- implements KPartiteGraph
An implementation of KPartiteGraph based on SparseGraph.
This implementation optionally creates a subset for each partition
specified in the constructor.
Vertex constraints imposed by this class: predicates in
partitions
constructor argument
Edge constraints imposed by this class:
KPartiteEdgePredicate(partitions)
- Author:
- Joshua O'Madadhain
Constructor Summary |
KPartiteSparseGraph(Collection partitions,
boolean subsets)
Creates a KPartiteSparseGraph whose partitions are specified by
the predicates in the partitions array. |
KPartiteSparseGraph(Graph g,
Collection partitions,
boolean subsets)
Creates a new KPartiteSparseGraph which contains all the
vertices and edges in g . |
Method Summary |
Collection |
getPartitions()
Returns the array of predicates which define the partitions
of this graph. |
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractArchetypeGraph |
addAllNotInitializers, addListener, checkConstraints, copy, getEdgeConstraints, getVertexConstraints, listenersExist, newInstance, numEdges, numVertices, removeAllEdges, removeAllVertices, removeListener, toString |
Methods inherited from interface edu.uci.ics.jung.graph.ArchetypeGraph |
addListener, copy, getEdgeConstraints, getEdges, getVertexConstraints, getVertices, newInstance, numEdges, numVertices, removeAllEdges, removeAllVertices, removeEdges, removeListener, removeVertices |
partitions
protected Collection partitions
KPartiteSparseGraph
public KPartiteSparseGraph(Collection partitions,
boolean subsets)
- Creates a KPartiteSparseGraph whose partitions are specified by
the predicates in the
partitions
array. If the
subsets
argument is true, creates a subset for
each partition.
KPartiteSparseGraph
public KPartiteSparseGraph(Graph g,
Collection partitions,
boolean subsets)
Creates a new KPartiteSparseGraph
which contains all the
vertices and edges in g
. The new graph contains all the
user data from the original graph and its components.
This method performs no tagging or structural conversion. If
g
is not compatible with the constraints specified by
partitions
, this constructor will throw an
IllegalArgumentException
. Thus, each vertex in
g
must be a member of exactly one partition, and each edge
must join vertices in distinct partitions.
getPartitions
public Collection getPartitions()
- Description copied from interface:
KPartiteGraph
- Returns the array of predicates which define the partitions
of this graph.
- Specified by:
getPartitions
in interface KPartiteGraph