public interface Graph<V>
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(int source,
int target,
long weight)
Adds an edge.
|
void |
addEdge(V source,
V target,
long weight)
Adds an edge.
|
int |
addVertex(V x)
Add a vertex to the graph.
|
void |
addVertices(java.util.Collection<V> xs) |
void |
addVertices(V[] xs) |
Graph<V> |
clone() |
boolean |
containsEdge(int source,
int target)
Returns whether the graph contains an edge between source and target.
|
boolean |
containsEdge(V source,
V target)
Returns whether the graph contains an edge between source and target.
|
java.lang.Iterable<java.lang.Long> |
getEdges()
Gives an iterable that iterates over all edges; The edges that are
returned are indices.
|
java.lang.Iterable<java.lang.Long> |
getEdgesOf(int indexOfV)
Return an iterable of edgeIndex containing all edges of which v is a
source or a target.
|
java.lang.Iterable<java.lang.Long> |
getEdgesOf(V v)
Return an iterable of edgeIndex containing all edges of which v is a
source or a target.
|
V |
getEdgeSource(long edgeIndex)
Returns the vertex the edgeIndex comes from.
|
int |
getEdgeSourceIndex(long edgeIndex) |
V |
getEdgeTarget(long edgeIndex)
Returns the vertex the edgeIndex points to.
|
int |
getEdgeTargetIndex(long edgeIndex)
Returns the index of the vertex the edgeIndex points to.
|
long |
getEdgeWeight(int source,
int target)
Returns the weight of an edge between source and target.
|
long |
getEdgeWeight(long edgeIndex)
Returns the weight of an edge.
|
long |
getEdgeWeight(V source,
V target)
Returns the weight of an edge.
|
java.lang.Iterable<java.lang.Long> |
getIncomingEdgesOf(int v)
Returns an array of edge index, containing all edges of which v is the
target.
|
java.lang.Iterable<java.lang.Long> |
getIncomingEdgesOf(V v)
Returns an array of edge index, containing all edges of which v is the
target.
|
int |
getIndexOfVertex(V v) |
int |
getNumberOfVertices() |
java.lang.Iterable<java.lang.Long> |
getOutgoingEdgesOf(int v)
Returns an array of edge index, containing all edges of which v is the
source.
|
java.lang.Iterable<java.lang.Long> |
getOutgoingEdgesOf(V v)
Returns an array of edge index, containing all edges of which v is the
source.
|
int[] |
getVertexIndices() |
V |
getVertexOfIndex(int index) |
V[] |
getVertices() |
long |
getWeightOfHeaviestEdge()
Returns the weight of the edge with the highest weight.
|
void |
removeEdge(long edge)
Removes an edge.
|
int addVertex(V x)
x - void addVertices(java.util.Collection<V> xs)
void addVertices(V[] xs)
void addEdge(int source,
int target,
long weight)
source - target - weight - void addEdge(V source, V target, long weight)
source - target - weight - void removeEdge(long edge)
source - target - weight - V getVertexOfIndex(int index)
V[] getVertices()
int[] getVertexIndices()
int getNumberOfVertices()
java.lang.Iterable<java.lang.Long> getEdges()
boolean containsEdge(V source, V target)
boolean containsEdge(int source,
int target)
V getEdgeSource(long edgeIndex)
edgeIndex - int getEdgeSourceIndex(long edgeIndex)
V getEdgeTarget(long edgeIndex)
edgeIndex - int getEdgeTargetIndex(long edgeIndex)
edgeIndex - long getEdgeWeight(long edgeIndex)
edgeIndex - long getEdgeWeight(int source,
int target)
source - target - long getEdgeWeight(V source, V target)
source - target - java.lang.Iterable<java.lang.Long> getIncomingEdgesOf(V v)
v - java.lang.Iterable<java.lang.Long> getIncomingEdgesOf(int v)
v - java.lang.Iterable<java.lang.Long> getOutgoingEdgesOf(V v)
v - java.lang.Iterable<java.lang.Long> getOutgoingEdgesOf(int v)
v - java.lang.Iterable<java.lang.Long> getEdgesOf(V v)
v - java.lang.Iterable<java.lang.Long> getEdgesOf(int indexOfV)
v - long getWeightOfHeaviestEdge()
int getIndexOfVertex(V v)
e -