Package edu.uci.ics.jung.graph
Class SetHypergraph<V,H>
- java.lang.Object
-
- edu.uci.ics.jung.graph.SetHypergraph<V,H>
-
- All Implemented Interfaces:
edu.uci.ics.jung.graph.Hypergraph<V,H>,edu.uci.ics.jung.graph.MultiGraph<V,H>,java.io.Serializable
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.SerializableAn implementation ofHypergraphthat is suitable for sparse graphs and permits parallel edges.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SetHypergraph()Creates aSetHypergraphand initializes the internal data structures.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddEdge(H hyperedge, java.util.Collection<? extends V> to_attach)Addshyperedgeto this graph and connects them to the vertex collectionto_attach.booleanaddEdge(H hyperedge, java.util.Collection<? extends V> to_attach, edu.uci.ics.jung.graph.util.EdgeType edge_type)booleanaddVertex(V vertex)booleancontainsEdge(H edge)booleancontainsVertex(V vertex)intdegree(V vertex)HfindEdge(V v1, V v2)java.util.Collection<H>findEdgeSet(V v1, V v2)edu.uci.ics.jung.graph.util.EdgeTypegetDefaultEdgeType()VgetDest(H directed_edge)intgetEdgeCount()intgetEdgeCount(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.EdgeTypegetEdgeType(H edge)static <V,H>
org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Hypergraph<V,H>>getFactory()Returns aFactorywhich creates instances of this class.intgetIncidentCount(H edge)java.util.Collection<H>getIncidentEdges(V vertex)java.util.Collection<V>getIncidentVertices(H edge)java.util.Collection<H>getInEdges(V vertex)intgetNeighborCount(V vertex)java.util.Collection<V>getNeighbors(V vertex)java.util.Collection<H>getOutEdges(V vertex)java.util.Collection<V>getPredecessors(V vertex)VgetSource(H directed_edge)java.util.Collection<V>getSuccessors(V vertex)intgetVertexCount()java.util.Collection<V>getVertices()intinDegree(V vertex)booleanisIncident(V vertex, H edge)booleanisNeighbor(V v1, V v2)intoutDegree(V vertex)booleanremoveEdge(H hyperedge)booleanremoveVertex(V vertex)
-
-
-
Method Detail
-
getFactory
public static <V,H> org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Hypergraph<V,H>> getFactory()
Returns aFactorywhich creates instances of this class.- Type Parameters:
V- vertex type of the hypergraph to be createdH- edge type of the hypergraph to be created- Returns:
- a
Factorywhich creates instances of this class
-
addEdge
public boolean addEdge(H hyperedge, java.util.Collection<? extends V> to_attach)
Addshyperedgeto this graph and connects them to the vertex collectionto_attach. Any vertices into_attachthat appear more than once will only appear once in the incident vertex collection forhyperedge, that is, duplicates will be ignored.
-
addEdge
public boolean addEdge(H hyperedge, java.util.Collection<? extends V> to_attach, edu.uci.ics.jung.graph.util.EdgeType edge_type)
-
getEdgeType
public edu.uci.ics.jung.graph.util.EdgeType getEdgeType(H edge)
-
containsVertex
public boolean containsVertex(V vertex)
-
containsEdge
public boolean containsEdge(H edge)
-
getEdges
public java.util.Collection<H> getEdges()
-
getVertices
public java.util.Collection<V> getVertices()
-
getEdgeCount
public int getEdgeCount()
-
getVertexCount
public int getVertexCount()
-
addVertex
public boolean addVertex(V vertex)
-
removeVertex
public boolean removeVertex(V vertex)
-
removeEdge
public boolean removeEdge(H hyperedge)
-
degree
public int degree(V vertex)
-
getNeighborCount
public int getNeighborCount(V vertex)
-
getIncidentCount
public int getIncidentCount(H edge)
-
getEdgeCount
public int getEdgeCount(edu.uci.ics.jung.graph.util.EdgeType edge_type)
-
getEdges
public java.util.Collection<H> getEdges(edu.uci.ics.jung.graph.util.EdgeType edge_type)
-
getDefaultEdgeType
public edu.uci.ics.jung.graph.util.EdgeType getDefaultEdgeType()
-
inDegree
public int inDegree(V vertex)
-
outDegree
public int outDegree(V vertex)
-
-