public class SetHypergraph<V,H>
extends java.lang.Object
implements edu.uci.ics.jung.graph.Hypergraph<V,H>, edu.uci.ics.jung.graph.MultiGraph<V,H>, java.io.Serializable
Hypergraph
that is suitable for sparse graphs and
permits parallel edges.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<H,java.util.Set<V>> |
edges |
protected java.util.Map<V,java.util.Set<H>> |
vertices |
Constructor and Description |
---|
SetHypergraph()
Creates a
SetHypergraph and initializes the internal data structures. |
Modifier and Type | Method and Description |
---|---|
boolean |
addEdge(H hyperedge,
java.util.Collection<? extends V> to_attach)
Adds
hyperedge to this graph and connects them to the vertex collection to_attach . |
boolean |
addEdge(H hyperedge,
java.util.Collection<? extends V> to_attach,
edu.uci.ics.jung.graph.util.EdgeType edge_type) |
boolean |
addVertex(V vertex) |
boolean |
containsEdge(H edge) |
boolean |
containsVertex(V vertex) |
int |
degree(V vertex) |
H |
findEdge(V v1,
V v2) |
java.util.Collection<H> |
findEdgeSet(V v1,
V v2) |
edu.uci.ics.jung.graph.util.EdgeType |
getDefaultEdgeType() |
V |
getDest(H directed_edge) |
int |
getEdgeCount() |
int |
getEdgeCount(edu.uci.ics.jung.graph.util.EdgeType edge_type) |
java.util.Collection<H> |
getEdges() |
java.util.Collection<H> |
getEdges(edu.uci.ics.jung.graph.util.EdgeType edge_type) |
edu.uci.ics.jung.graph.util.EdgeType |
getEdgeType(H edge) |
static <V,H> org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Hypergraph<V,H>> |
getFactory()
Returns a
Factory which creates instances of this class. |
int |
getIncidentCount(H edge) |
java.util.Collection<H> |
getIncidentEdges(V vertex) |
java.util.Collection<V> |
getIncidentVertices(H edge) |
java.util.Collection<H> |
getInEdges(V vertex) |
int |
getNeighborCount(V vertex) |
java.util.Collection<V> |
getNeighbors(V vertex) |
java.util.Collection<H> |
getOutEdges(V vertex) |
java.util.Collection<V> |
getPredecessors(V vertex) |
V |
getSource(H directed_edge) |
java.util.Collection<V> |
getSuccessors(V vertex) |
int |
getVertexCount() |
java.util.Collection<V> |
getVertices() |
int |
inDegree(V vertex) |
boolean |
isIncident(V vertex,
H edge) |
boolean |
isNeighbor(V v1,
V v2) |
int |
outDegree(V vertex) |
boolean |
removeEdge(H hyperedge) |
boolean |
removeVertex(V vertex) |
public SetHypergraph()
SetHypergraph
and initializes the internal data structures.public static <V,H> org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Hypergraph<V,H>> getFactory()
Factory
which creates instances of this class.V
- vertex type of the hypergraph to be createdH
- edge type of the hypergraph to be createdFactory
which creates instances of this classpublic boolean addEdge(H hyperedge, java.util.Collection<? extends V> to_attach)
hyperedge
to this graph and connects them to the vertex collection to_attach
.
Any vertices in to_attach
that appear more than once will only appear once in the
incident vertex collection for hyperedge
, that is, duplicates will be ignored.public boolean addEdge(H hyperedge, java.util.Collection<? extends V> to_attach, edu.uci.ics.jung.graph.util.EdgeType edge_type)
public edu.uci.ics.jung.graph.util.EdgeType getEdgeType(H edge)
public boolean containsVertex(V vertex)
public boolean containsEdge(H edge)
public java.util.Collection<H> getEdges()
public java.util.Collection<V> getVertices()
public int getEdgeCount()
public int getVertexCount()
public boolean addVertex(V vertex)
public boolean removeVertex(V vertex)
public boolean removeEdge(H hyperedge)
public int degree(V vertex)
public int getNeighborCount(V vertex)
public int getIncidentCount(H edge)
public int getEdgeCount(edu.uci.ics.jung.graph.util.EdgeType edge_type)
public java.util.Collection<H> getEdges(edu.uci.ics.jung.graph.util.EdgeType edge_type)
public edu.uci.ics.jung.graph.util.EdgeType getDefaultEdgeType()
public int inDegree(V vertex)
public int outDegree(V vertex)