numVertices() |
Return the number of vertices in
G. |
numEdges() |
Return the number of edges in G. |
vertices() |
Return an iterator of the vertices of G. |
edges() |
Return an iterator of the edges of G. |
aVertex() |
Return a vertex of G. |
degree(v) |
Return the degree of v. |
adjacentVertices(v) |
Return an iterator of the vertices adjacent to v. |
incidentEdges(v) |
Return an iterator of the edges incident upon v. |
endVertices(e) |
Return an array of size 2 storing the end vertices of e. |
opposite(v,e) |
Return the endpoint of edge e
distinct from v. |
areAdjacent(v,w) |
Return true whenever vertices v and w are adjacent. |
directedEdges() |
Return an iterator of all
directed edges. |
undirectedEdges() |
Return an iterator of all undirected edges. |
destination(e) |
Return the destination of the
directed edge e. |
origin(e) |
Return the origin of the directed edge e. |
isDirected(e) |
Return true if and only if the edge
is directed. |
inDegree(v) |
Return the in-degree of v. |
outDegree(v) |
Return the out-degree of v. |
inIncidentEdges(v) |
Return an iterator of all the
incoming edges to v. |
outIncidentEdges(v) |
Return an iterator of all the outgoing edges from v. |
inAdjacentVertices(v) |
Return an iterator of all
vertices adjacent to v
along incoming edges to v. |
outAdjacentVertices(v) |
Return an iterator of all vertices adjacent to v along outgoing edges from v. |
insertEdge(v,w,o) |
Insert and return an undirected
edge between vertices v
and w, storing the object
o at this position. |
insertDirectedEdge(v,w,o) | Insert and return an directed edge from vertex v to vertex w, storing the object o at this position. |
insertVertex(o) |
Insert and return a new
(isolated) vertex storing the object o at this position. |
removeVertex(v) |
Remove the vertex v and all its incident edges. |
removeEdge(e) |
Remove edge e. |
makeUndirected(e) |
Make edge e undirected. |
reverseDirection(e) |
Reverse the direction of
directed edge e. |
setDirectionFrom(e,v) |
Make e directed away from vertex v. |
setDirectionTo(e,v) | Make e directed into vertex v. |