public class BfsGraph<T extends UndirectedSimpleVertex & BfsVertex> extends AbstractGraph<T>
Constructor and Description |
---|
BfsGraph()
Initialize graph to a default initial capacity of 16 vertices
|
BfsGraph(java.util.Collection<T> vertices)
Use the vertices in a collection as the initial vertices in the graph
|
BfsGraph(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 BfsGraph()
public BfsGraph(int initialCapacity)
initialCapacity
- expected number of verticespublic BfsGraph(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 & BfsVertex>