| Constructor and Description |
|---|
GraphImplLinearEdge(java.lang.Class<?> clazz) |
| 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.
|
java.lang.String |
toString() |
public int addVertex(V x)
Graphpublic void addVertices(java.util.Collection<V> xs)
addVertices in interface Graph<V>public void addVertices(V[] xs)
addVertices in interface Graph<V>public void addEdge(int source,
int target,
long weight)
Graphpublic void removeEdge(long edge)
GraphremoveEdge in interface Graph<V>public void addEdge(V source, V target, long weight)
Graphpublic V getVertexOfIndex(int index)
getVertexOfIndex in interface Graph<V>public V[] getVertices()
getVertices in interface Graph<V>public int[] getVertexIndices()
getVertexIndices in interface Graph<V>public int getNumberOfVertices()
getNumberOfVertices in interface Graph<V>public java.lang.Iterable<java.lang.Long> getEdges()
Graphpublic boolean containsEdge(V source, V target)
GraphcontainsEdge in interface Graph<V>public boolean containsEdge(int source,
int target)
GraphcontainsEdge in interface Graph<V>public V getEdgeSource(long edgeIndex)
GraphgetEdgeSource in interface Graph<V>public int getEdgeSourceIndex(long edgeIndex)
getEdgeSourceIndex in interface Graph<V>public V getEdgeTarget(long edgeIndex)
GraphgetEdgeTarget in interface Graph<V>public int getEdgeTargetIndex(long edgeIndex)
GraphgetEdgeTargetIndex in interface Graph<V>public long getEdgeWeight(long edgeIndex)
GraphgetEdgeWeight in interface Graph<V>public long getEdgeWeight(int source,
int target)
GraphgetEdgeWeight in interface Graph<V>public long getEdgeWeight(V source, V target)
GraphgetEdgeWeight in interface Graph<V>public java.lang.Iterable<java.lang.Long> getIncomingEdgesOf(V v)
GraphgetIncomingEdgesOf in interface Graph<V>public java.lang.Iterable<java.lang.Long> getIncomingEdgesOf(int v)
GraphgetIncomingEdgesOf in interface Graph<V>public java.lang.Iterable<java.lang.Long> getOutgoingEdgesOf(V v)
GraphgetOutgoingEdgesOf in interface Graph<V>public java.lang.Iterable<java.lang.Long> getOutgoingEdgesOf(int v)
GraphgetOutgoingEdgesOf in interface Graph<V>public java.lang.Iterable<java.lang.Long> getEdgesOf(V v)
GraphgetEdgesOf in interface Graph<V>public java.lang.Iterable<java.lang.Long> getEdgesOf(int indexOfV)
GraphgetEdgesOf in interface Graph<V>public long getWeightOfHeaviestEdge()
GraphgetWeightOfHeaviestEdge in interface Graph<V>public java.lang.String toString()
toString in class java.lang.Objectpublic int getIndexOfVertex(V v)
getIndexOfVertex in interface Graph<V>