T
- the type of the data to store in Vertices of this graphpublic class UnweightedUndirectedGraph<T> extends UndirectedGraph<T> implements UnweightedGraph<T>
Constructor and Description |
---|
UnweightedUndirectedGraph()
Creates a new unweighted undirected graph
|
UnweightedUndirectedGraph(java.util.Collection<T> vertexData)
Creates a new unweighted undirected graph with the given data in vertices
|
UnweightedUndirectedGraph(MultiMap<T,T> connections)
Creates a new unweighted undirected graph with the connections described
by a multimap.
|
Modifier and Type | Method and Description |
---|---|
UndirectedEdge<T> |
addEdge(Vertex<T> one,
Vertex<T> other)
Adds an edge to the graph between two Vertices
|
UnweightedUndirectedVertex<T> |
addVertex(T data)
Adds a new vertex to the graph with the given data
|
getEdges, getVertices, removeAllEdges, removeAllVertices, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEdges, getVertices, removeAllEdges, removeAllVertices
public UnweightedUndirectedGraph()
public UnweightedUndirectedGraph(java.util.Collection<T> vertexData)
vertexData
- the data to make vertices out ofpublic UndirectedEdge<T> addEdge(Vertex<T> one, Vertex<T> other)
UnweightedGraph
addEdge
in interface UnweightedGraph<T>
one
- the Vertex the edge starts at (arbitrary for undirected
graphs)other
- the Vertex the edge ends at (arbitrary for undirected graphs)