public class UndirectedOrderedSparseMultigraph<V,E> extends UndirectedSparseMultigraph<V,E> implements UndirectedGraph<V,E>
UndirectedGraph
that is suitable for sparse graphs,
orders its vertex and edge collections according to insertion time, and permits
parallel edges.edges, vertices
edgeType
Constructor and Description |
---|
UndirectedOrderedSparseMultigraph()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addVertex(V vertex)
Adds
vertex to this graph. |
static <V,E> Factory<UndirectedGraph<V,E>> |
getFactory()
Returns a
Factory that creates an instance of this graph type. |
java.util.Collection<V> |
getNeighbors(V vertex)
Returns the collection of vertices which are connected to
vertex via any edges in this graph. |
addEdge, addEdgeWithEndpoints, containsEdge, containsVertex, findEdge, getDest, getEdgeCount, getEdgesView, getEndpoints, getIncident_internal, getIncidentEdges, getInEdges, getOutEdges, getPredecessors, getSource, getSuccessors, getVertexCount, getVerticesView, isDest, isSource, removeEdge, removeVertex
getDefaultEdgeType, getEdgeCount, getEdges, getEdgeType, hasEqualEdgeType, validateEdgeType
addEdge, addEdgeWithEndPoints, addEdgeWithVertices, addEdgeWithVertices, degree, findEdgeSet, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, getValidatedEndpoints, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addEdge, addEdge, getDest, getEndpoints, getInEdges, getOpposite, getOutEdges, getPredecessorCount, getPredecessors, getSource, getSuccessorCount, getSuccessors, inDegree, isDest, isPredecessor, isSource, isSuccessor, outDegree
addEdgeWithVertices, addEdgeWithVertices, containsEdge, containsVertex, degree, findEdge, findEdgeSet, getDefaultEdgeType, getEdgeCount, getEdgeCount, getEdges, getEdgesView, getEdgeType, getIncidentCount, getIncidentEdges, getIncidentVertices, getNeighborCount, getVertexCount, getVerticesView, isIncident, isNeighbor, removeEdge, removeVertex
public UndirectedOrderedSparseMultigraph()
public static <V,E> Factory<UndirectedGraph<V,E>> getFactory()
Factory
that creates an instance of this graph type.V
- the vertex type for the graph factoryE
- the edge type for the graph factorypublic boolean addVertex(V vertex)
Hypergraph
vertex
to this graph. Fails if vertex
is null or already in the graph.addVertex
in interface Hypergraph<V,E>
addVertex
in class UndirectedSparseMultigraph<V,E>
vertex
- the vertex to addtrue
if the add is successful, and false
otherwisepublic java.util.Collection<V> getNeighbors(V vertex)
Hypergraph
vertex
via any edges in this graph.
If vertex
is connected to itself with a self-loop, then it will be included in the collection returned.getNeighbors
in interface Hypergraph<V,E>
getNeighbors
in class UndirectedSparseMultigraph<V,E>
vertex
- the vertex whose neighbors are to be returnedvertex
,
or null
if vertex
is not presentCopyright © 2021, 2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence