|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Graph<V,E>
Method Summary | |
---|---|
void |
add(V source,
V dest,
E data)
Adds vertices (if not already in the graph) and the edge between them. |
boolean |
addVertex(V v)
For adding a zero degree vertex |
void |
clear()
clears the graph, removes all edges and nodes |
boolean |
containsVertex(V v)
|
List<E> |
getAllEdges()
|
Set<V> |
getAllVertices()
|
Set<V> |
getChildren(V vertex)
for undirected graph, it is just the neighbors |
List<Set<V>> |
getConnectedComponents()
|
List<E> |
getEdges(V source,
V dest)
|
List<E> |
getIncomingEdges(V v)
for undirected graph, it is just the edges from the node |
int |
getInDegree(V vertex)
for undirected graph, it should just be the degree |
Set<V> |
getNeighbors(V v)
|
int |
getNumEdges()
|
int |
getNumVertices()
|
int |
getOutDegree(V vertex)
|
List<E> |
getOutgoingEdges(V v)
for undirected graph, it is just the edges from the node |
Set<V> |
getParents(V vertex)
for undirected graph, it is just the neighbors |
boolean |
isEdge(V source,
V dest)
only checks if there is an edge from source to dest. |
boolean |
isEmpty()
False if there are any vertices in the graph, true otherwise. |
boolean |
isNeighbor(V source,
V dest)
|
boolean |
removeEdge(V source,
V dest,
E data)
|
boolean |
removeEdges(V source,
V dest)
|
boolean |
removeVertex(V vertex)
remove a vertex (and its edges) from the graph. |
boolean |
removeVertices(Collection<V> vertices)
|
void |
removeZeroDegreeNodes()
Deletes nodes with zero incoming and zero outgoing edges |
Method Detail |
---|
void add(V source, V dest, E data)
source
- dest
- data
- boolean addVertex(V v)
v
- boolean removeEdges(V source, V dest)
boolean removeEdge(V source, V dest, E data)
boolean removeVertex(V vertex)
vertex
-
boolean removeVertices(Collection<V> vertices)
int getNumVertices()
List<E> getOutgoingEdges(V v)
v
- List<E> getIncomingEdges(V v)
v
- int getNumEdges()
Set<V> getParents(V vertex)
vertex
- Set<V> getChildren(V vertex)
vertex
- Set<V> getNeighbors(V v)
void clear()
boolean containsVertex(V v)
boolean isEdge(V source, V dest)
source
- dest
- boolean isNeighbor(V source, V dest)
Set<V> getAllVertices()
List<E> getAllEdges()
boolean isEmpty()
void removeZeroDegreeNodes()
List<E> getEdges(V source, V dest)
int getInDegree(V vertex)
vertex
- int getOutDegree(V vertex)
List<Set<V>> getConnectedComponents()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |