edu.stanford.math.plex4.graph
public interface AbstractUndirectedGraph extends java.lang.Iterable<edu.stanford.math.primitivelib.autogen.pair.IntIntPair>, java.io.Serializable
Modifier and Type | Method and Description |
---|---|
void |
addEdge(int i,
int j)
This function adds the edge (i, j) to the graph.
|
boolean |
containsEdge(int i,
int j)
This function returns true if the edge (i, j) is in the graph,
and false otherwise.
|
int |
getDegree(int v) |
int[] |
getDegreeSequence() |
gnu.trove.TIntHashSet |
getLowerNeighbors(int i)
This function returns the set of neighbors of vertex i in the graph
which have indices less than i.
|
int[] |
getNeighbors(int v) |
int |
getNumEdges()
Gets the number of edges in the graph.
|
int |
getNumVertices()
Gets the number of vertices in the graph.
|
java.util.Iterator<edu.stanford.math.primitivelib.autogen.pair.IntIntPair> |
iterator()
This function returns an edge iterator that allows the user to
iterate over the set of edges in the graph.
|
void |
removeEdge(int i,
int j)
This function removes the edge (i, j) from the graph.
|
int getNumVertices()
int getNumEdges()
boolean containsEdge(int i, int j)
i
- the first vertex of the edgej
- the second vertex of the edgevoid addEdge(int i, int j)
i
- the first vertex of the edge to addj
- the second vertex of the edge to addvoid removeEdge(int i, int j)
i
- the first vertex of the edge to addj
- the second vertex of the edge to addgnu.trove.TIntHashSet getLowerNeighbors(int i)
i
- the vertex to queryjava.util.Iterator<edu.stanford.math.primitivelib.autogen.pair.IntIntPair> iterator()
iterator
in interface java.lang.Iterable<edu.stanford.math.primitivelib.autogen.pair.IntIntPair>
int getDegree(int v)
int[] getNeighbors(int v)
int[] getDegreeSequence()