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.Serializable
An implementation ofHypergraph
that is suitable for sparse graphs and permits parallel edges.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SetHypergraph()
Creates aSetHypergraph
and initializes the internal data structures.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addEdge(H hyperedge, java.util.Collection<? extends V> to_attach)
Addshyperedge
to this graph and connects them to the vertex collectionto_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 aFactory
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)
-
-
-
Method Detail
-
getFactory
public static <V,H> org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Hypergraph<V,H>> getFactory()
Returns aFactory
which 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
Factory
which creates instances of this class
-
addEdge
public boolean addEdge(H hyperedge, java.util.Collection<? extends V> to_attach)
Addshyperedge
to this graph and connects them to the vertex collectionto_attach
. Any vertices into_attach
that 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)
-
-