edu.uci.ics.jung.graph.impl
Class KPartiteSparseGraph
java.lang.Object
edu.uci.ics.jung.utils.UserData
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, java.lang.Cloneable, Graph, KPartiteGraph, UserDataContainer
- 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.
- Author:
- Joshua O'Madadhain
|
Constructor Summary |
KPartiteSparseGraph(java.util.Collection partitions,
boolean subsets)
Creates a KPartiteSparseGraph whose partitions are specified by
the predicates in the partitions array. |
KPartiteSparseGraph(Graph g,
java.util.Collection partitions,
boolean subsets)
Creates a new KPartiteSparseGraph which contains all the
vertices and edges in g. |
|
Method Summary |
java.util.Collection |
getPartitions()
Returns the array of predicates which define the partitions
of this graph. |
| Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractSparseGraph |
addEdge, addVertex, getEdges, getVertices, isDirected, removeAllEdges, removeAllVertices, removeEdge, removeEdges, removeVertex, removeVertices |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.uci.ics.jung.graph.ArchetypeGraph |
addListener, copy, getEdgeConstraints, getEdges, getVertexConstraints, getVertices, newInstance, numEdges, numVertices, removeAllEdges, removeAllVertices, removeEdges, removeListener, removeVertices |
KPartiteSparseGraph
public KPartiteSparseGraph(java.util.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,
java.util.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 java.util.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