public class SimpleUndirectedSparseGraph<V,E> extends SimpleAbstractSparseGraph<V,E> implements UndirectedGraph<V,E>
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<E,Pair<V>> |
edges |
protected java.util.Map<V,java.util.Set<E>> |
vertices |
Constructor and Description |
---|
SimpleUndirectedSparseGraph() |
Modifier and Type | Method and Description |
---|---|
boolean |
addUndirectedEdge(E edge,
V v1,
V v2) |
boolean |
addVertex(V vertex) |
E |
findEdge(V v1,
V v2) |
java.util.Collection<E> |
getEdges() |
Pair<V> |
getEndpoints(E edge) |
java.util.Collection<E> |
getIncidentEdges(V vertex) |
java.util.Collection<E> |
getInEdges(V vertex) |
java.util.Collection<V> |
getNeighbors(V vertex) |
java.util.Collection<E> |
getOutEdges(V vertex) |
java.util.Collection<V> |
getPredecessors(V vertex) |
java.util.Collection<V> |
getSuccessors(V vertex) |
java.util.Collection<V> |
getVertices() |
boolean |
removeEdge(E edge) |
boolean |
removeVertex(V vertex) |
areIncident, areNeighbors, degree, getIncidentVertices, getOpposite, inDegree, isPredecessor, isSuccessor, numNeighbors, numPredecessors, numSuccessors, outDegree
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOpposite, inDegree, isPredecessor, isSuccessor, numPredecessors, numSuccessors, outDegree
areIncident, areNeighbors, degree, getIncidentVertices, numNeighbors
public java.util.Collection<E> getEdges()
getEdges
in interface ArchetypeGraph<V,E>
public java.util.Collection<V> getVertices()
getVertices
in interface ArchetypeGraph<V,E>
public boolean addVertex(V vertex)
addVertex
in interface ArchetypeGraph<V,E>
public boolean removeVertex(V vertex)
removeVertex
in interface ArchetypeGraph<V,E>
public boolean addUndirectedEdge(E edge, V v1, V v2)
addUndirectedEdge
in interface UndirectedGraph<V,E>
public boolean removeEdge(E edge)
removeEdge
in interface ArchetypeGraph<V,E>
public java.util.Collection<E> getInEdges(V vertex)
getInEdges
in interface Graph<V,E>
public java.util.Collection<E> getOutEdges(V vertex)
getOutEdges
in interface Graph<V,E>
public java.util.Collection<V> getPredecessors(V vertex)
getPredecessors
in interface Graph<V,E>
public java.util.Collection<V> getSuccessors(V vertex)
getSuccessors
in interface Graph<V,E>
public java.util.Collection<V> getNeighbors(V vertex)
getNeighbors
in interface ArchetypeGraph<V,E>
public java.util.Collection<E> getIncidentEdges(V vertex)
getIncidentEdges
in interface ArchetypeGraph<V,E>