Modifier and Type | Class and Description |
---|---|
class |
IntGraphImplQuadratic.EdgeIterator |
Constructor and Description |
---|
IntGraphImplQuadratic() |
IntGraphImplQuadratic(int initialSize) |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(int source,
int target,
long weight)
Adds an edge.
|
void |
addNode(int node)
Adds a node to the graph.
|
IntGraphImplQuadratic |
clone() |
boolean |
containsEdge(int source,
int 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 that have a weight greater
than 0; The edges that are returned are indices.
|
java.lang.Iterable<java.lang.Long> |
getEdgesOf(int node)
Return an iterable of edgeIndex containing all edges of which v is a
source or a target.
|
int |
getEdgeSource(long edgeIndex)
Returns the node the edgeIndex comes from.
|
int |
getEdgeSourceIndex(long edgeIndex) |
int |
getEdgeTarget(long edgeIndex)
Returns the node the edgeIndex points to.
|
int |
getEdgeTargetIndex(long edgeIndex)
Returns the index of the node 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.
|
EdgeIterable |
getIncomingEdgesOf(int node)
Returns an array of edge index, containing all edges of which v is the
target.
|
EdgeIterable |
getIncomingEdgesOfIndex(int index) |
int |
getNodeOfIndex(int index)
The graph keeps an index of nodes.
|
int[] |
getNodes() |
int |
getNumberOfNodes() |
EdgeIterable |
getOutgoingEdgesOf(int node)
Returns an array of edge index, containing all edges of which v is the
source.
|
EdgeIterable |
getOutgoingEdgesOfIndex(int index) |
long |
getWeightOfHeaviestEdge()
Returns the weight of the edge with the highest weight.
|
java.lang.String |
toString() |
public IntGraphImplQuadratic()
public IntGraphImplQuadratic(int initialSize)
public void addEdge(int source, int target, long weight)
IntGraph
public java.lang.Iterable<java.lang.Long> getEdges()
public boolean containsEdge(int source, int target)
containsEdge
in interface IntGraph
public int getEdgeSource(long edgeIndex)
IntGraph
getEdgeSource
in interface IntGraph
public int getEdgeSourceIndex(long edgeIndex)
getEdgeSourceIndex
in interface IntGraph
public int getEdgeTarget(long edgeIndex)
IntGraph
getEdgeTarget
in interface IntGraph
public int getEdgeTargetIndex(long edgeIndex)
IntGraph
getEdgeTargetIndex
in interface IntGraph
public long getEdgeWeight(long edgeIndex)
getEdgeWeight
in interface IntGraph
edgeIndex
- public long getEdgeWeight(int source, int target)
IntGraph
getEdgeWeight
in interface IntGraph
public EdgeIterable getIncomingEdgesOf(int node)
IntGraph
getIncomingEdgesOf
in interface IntGraph
public EdgeIterable getIncomingEdgesOfIndex(int index)
getIncomingEdgesOfIndex
in interface IntGraph
public EdgeIterable getOutgoingEdgesOf(int node)
IntGraph
getOutgoingEdgesOf
in interface IntGraph
public EdgeIterable getOutgoingEdgesOfIndex(int index)
getOutgoingEdgesOfIndex
in interface IntGraph
public java.lang.Iterable<java.lang.Long> getEdgesOf(int node)
IntGraph
getEdgesOf
in interface IntGraph
public long getWeightOfHeaviestEdge()
getWeightOfHeaviestEdge
in interface IntGraph
public IntGraphImplQuadratic clone()
public void addNode(int node)
IntGraph
public int[] getNodes()
public int getNumberOfNodes()
getNumberOfNodes
in interface IntGraph
public int getNodeOfIndex(int index)
IntGraph
getNodeOfIndex
in interface IntGraph
public java.lang.String toString()
toString
in class java.lang.Object