|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
TVertex - Type of IVertex.public interface IAdjacencyList<TVertex extends IVertex>
An adjacency list is essentially an array of size n where A[i] is the list of out-neighbors of node i. Please see http://www.cs.cmu.edu/~avrim/451f08/lectures/lect1002.pdf
| Method Summary | |
|---|---|
int[] |
calculateInDegrees()
Scans the IAdjacencyList and for each vertex it counts the number of other vertices referencing it. |
int |
indexOf(TVertex vertex)
Find the index in the IAdjacencyList at which the provided vertex argument can be found. |
boolean |
isEmpty()
Determines if the adjacency list is empty. |
List<TVertex> |
outNeighborsAt(int index)
Gets the list of out-neighbors for a given vertex of TVertex at the provided index argument. |
List<TVertex> |
outNeighborsFor(TVertex vertex)
Gets the list of out-neighbors for a given vertex of TVertex. |
IAdjacencyListPair<TVertex> |
pairAt(int index)
Retrieves an instance of IAdjacencyListPair at the specified index. |
int |
size()
The size of the IAdjacencyList. |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Method Detail |
|---|
boolean isEmpty()
true if the adjacency list is empty; false otherwise.List<TVertex> outNeighborsFor(TVertex vertex)
TVertex.
vertex - A vertex of TVertex for whom we wish to retrieve its out-neighbors.
TVertex instances who are the out-neighbors for the provided vertex argument.IAdjacencyListPair.getOutNeighbors()IAdjacencyListPair<TVertex> pairAt(int index)
IAdjacencyListPair at the specified index.
index - The index in the list for which we wish to get the associated IAdjacencyListPair.
IAdjacencyListPair if found; otherwise null.IAdjacencyListPairList<TVertex> outNeighborsAt(int index)
TVertex at the provided index argument.
index - The index in the list for which we wish to get the associated out-neighbors.
TVertex instances who are the out-neighbors for an instance of TVertex
at the specified index.IAdjacencyListPair.getOutNeighbors()int indexOf(TVertex vertex)
IAdjacencyList at which the provided vertex argument can be found.
vertex - An instance of IVertex of TVertex.
IAdjacencyList at which the provided vertex argument can be found.
-1 if the vertex cannot be found.int[] calculateInDegrees()
IAdjacencyList and for each vertex it counts the number of other vertices referencing it.
size() representing the in-degrees for each vertex.int size()
IAdjacencyList. This is the same as the number of vertices in the IGraph.
IAdjacencyList.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||