public class UndirectedSimpleGraph<T extends UndirectedSimpleVertex> extends AbstractGraph<T>
Constructor and Description |
---|
UndirectedSimpleGraph()
Initialize graph to a default initial capacity of 16 vertices
|
UndirectedSimpleGraph(java.util.Collection<T> vertices)
Use the vertices in a collection as the initial vertices in the graph
|
UndirectedSimpleGraph(int initialCapacity)
Initialize graph to have capacity for the given number of vertices
|
Modifier and Type | Method and Description |
---|---|
int |
edgeCount()
Returns the number of edges in the graph.
|
addVertex, containsEdge, containsVertex, getVertices, removeVertex, vertexCount, vertexIterator
public UndirectedSimpleGraph()
public UndirectedSimpleGraph(int initialCapacity)
initialCapacity
- expected number of verticespublic UndirectedSimpleGraph(java.util.Collection<T> vertices)
vertices
- collection of vertices that will make up the initial vertices
of the graphpublic final int edgeCount()
AbstractGraph
edgeCount
in class AbstractGraph<T extends UndirectedSimpleVertex>