public interface Graph<V> extends NormalisedIntGraph
Modifier and Type | Method and Description |
---|---|
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(V source,
V target)
Returns whether the graph contains an edge between source and 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.
|
V |
getEdgeTarget(long edgeIndex)
Returns the vertex the edgeIndex points to.
|
long |
getEdgeWeight(V source,
V target)
Returns the weight of an edge.
|
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(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() |
addEdge, containsEdge, getEdges, getEdgesOf, getEdgeSourceIndex, getEdgeTargetIndex, getEdgeWeight, getEdgeWeight, getIncomingEdgesOf, getOutgoingEdgesOf, getWeightOfHeaviestEdge
int addVertex(V x)
x
- void addVertices(java.util.Collection<V> xs)
void addVertices(V[] xs)
void addEdge(V source, V target, long weight)
source
- target
- weight
- V getVertexOfIndex(int index)
V[] getVertices()
int[] getVertexIndices()
int getNumberOfVertices()
boolean containsEdge(V source, V target)
V getEdgeSource(long edgeIndex)
edgeIndex
- V getEdgeTarget(long edgeIndex)
edgeIndex
- long getEdgeWeight(V source, V target)
source
- target
- java.lang.Iterable<java.lang.Long> getIncomingEdgesOf(V v)
v
- java.lang.Iterable<java.lang.Long> getOutgoingEdgesOf(V v)
v
- java.lang.Iterable<java.lang.Long> getEdgesOf(V v)
v
- int getIndexOfVertex(V v)
v
- Graph<V> clone()
clone
in interface NormalisedIntGraph