public interface Graph
Modifier and Type | Method and Description |
---|---|
int |
addVertex()
Adds a new vertex.
|
void |
clear()
Removes all vertices and edges from the graph.
|
int |
getDegree(int v)
Returns the out-degree of the specified vertex.
|
int |
getInDegree(int v)
Returns the in-degree of the specified vertex.
|
java.lang.Iterable<java.lang.Integer> |
getNeighbors(int v)
Returns an iterable object that allows iteration over the neighbors of
the specified vertex.
|
boolean |
hasEdge(int begin,
int end)
Checks whether an edge exists between two vertices.
|
boolean |
isDirected()
Returns true if the graph is directed.
|
boolean |
isEmpty()
Returns true if there are no vertices in the graph.
|
int |
numEdges()
Returns the number of edges in the graph.
|
int |
numVerts()
Returns the number of vertices in the graph.
|
int addVertex()
boolean hasEdge(int begin, int end)
int getDegree(int v)
int getInDegree(int v)
java.lang.Iterable<java.lang.Integer> getNeighbors(int v)
int numVerts()
int numEdges()
boolean isDirected()
boolean isEmpty()
void clear()