Class IntGraphImplQuadratic
- java.lang.Object
-
- org.processmining.plugins.inductiveminer2.helperclasses.graphs.IntGraphImplQuadratic
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classIntGraphImplQuadratic.EdgeIterator
-
Constructor Summary
Constructors Constructor Description IntGraphImplQuadratic()IntGraphImplQuadratic(int initialSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdge(int source, int target, long weight)Adds an edge.voidaddNode(int node)Adds a node to the graph.IntGraphImplQuadraticclone()booleancontainsEdge(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.intgetEdgeSource(long edgeIndex)Returns the node the edgeIndex comes from.intgetEdgeSourceIndex(long edgeIndex)intgetEdgeTarget(long edgeIndex)Returns the node the edgeIndex points to.intgetEdgeTargetIndex(long edgeIndex)Returns the index of the node the edgeIndex points to.longgetEdgeWeight(int source, int target)Returns the weight of an edge between source and target.longgetEdgeWeight(long edgeIndex)Returns the weight of an edge.EdgeIterablegetIncomingEdgesOf(int node)Returns an array of edge index, containing all edges of which v is the target.EdgeIterablegetIncomingEdgesOfIndex(int index)intgetNodeOfIndex(int index)The graph keeps an index of nodes.int[]getNodes()intgetNumberOfNodes()EdgeIterablegetOutgoingEdgesOf(int node)Returns an array of edge index, containing all edges of which v is the source.EdgeIterablegetOutgoingEdgesOfIndex(int index)longgetWeightOfHeaviestEdge()Returns the weight of the edge with the highest weight.java.lang.StringtoString()
-
-
-
Method Detail
-
addEdge
public void addEdge(int source, int target, long weight)Description copied from interface:IntGraphAdds an edge. If the weight becomes 0, the edge is removed.
-
getEdges
public 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.
-
containsEdge
public boolean containsEdge(int source, int target)Returns whether the graph contains an edge between source and target.- Specified by:
containsEdgein interfaceIntGraph- Returns:
-
getEdgeSource
public int getEdgeSource(long edgeIndex)
Description copied from interface:IntGraphReturns the node the edgeIndex comes from.- Specified by:
getEdgeSourcein interfaceIntGraph- Returns:
-
getEdgeSourceIndex
public int getEdgeSourceIndex(long edgeIndex)
- Specified by:
getEdgeSourceIndexin interfaceIntGraph
-
getEdgeTarget
public int getEdgeTarget(long edgeIndex)
Description copied from interface:IntGraphReturns the node the edgeIndex points to.- Specified by:
getEdgeTargetin interfaceIntGraph- Returns:
-
getEdgeTargetIndex
public int getEdgeTargetIndex(long edgeIndex)
Description copied from interface:IntGraphReturns the index of the node the edgeIndex points to.- Specified by:
getEdgeTargetIndexin interfaceIntGraph- Returns:
-
getEdgeWeight
public long getEdgeWeight(long edgeIndex)
Returns the weight of an edge.- Specified by:
getEdgeWeightin interfaceIntGraph- Parameters:
edgeIndex-- Returns:
-
getEdgeWeight
public long getEdgeWeight(int source, int target)Description copied from interface:IntGraphReturns the weight of an edge between source and target.- Specified by:
getEdgeWeightin interfaceIntGraph- Returns:
-
getIncomingEdgesOf
public EdgeIterable getIncomingEdgesOf(int node)
Description copied from interface:IntGraphReturns an array of edge index, containing all edges of which v is the target. Notice that the edge weight might be 0.- Specified by:
getIncomingEdgesOfin interfaceIntGraph- Returns:
-
getIncomingEdgesOfIndex
public EdgeIterable getIncomingEdgesOfIndex(int index)
- Specified by:
getIncomingEdgesOfIndexin interfaceIntGraph
-
getOutgoingEdgesOf
public EdgeIterable getOutgoingEdgesOf(int node)
Description copied from interface:IntGraphReturns an array of edge index, containing all edges of which v is the source. Notice that the edge weight might be 0.- Specified by:
getOutgoingEdgesOfin interfaceIntGraph- Returns:
-
getOutgoingEdgesOfIndex
public EdgeIterable getOutgoingEdgesOfIndex(int index)
- Specified by:
getOutgoingEdgesOfIndexin interfaceIntGraph
-
getEdgesOf
public java.lang.Iterable<java.lang.Long> getEdgesOf(int node)
Description copied from interface:IntGraphReturn an iterable of edgeIndex containing all edges of which v is a source or a target. Notice that the edge weight might be 0.- Specified by:
getEdgesOfin interfaceIntGraph- Returns:
-
getWeightOfHeaviestEdge
public long getWeightOfHeaviestEdge()
Returns the weight of the edge with the highest weight.- Specified by:
getWeightOfHeaviestEdgein interfaceIntGraph- Returns:
-
clone
public IntGraphImplQuadratic clone()
-
addNode
public void addNode(int node)
Description copied from interface:IntGraphAdds a node to the graph. Has no effect if the node was already present.
-
getNodes
public int[] getNodes()
-
getNumberOfNodes
public int getNumberOfNodes()
- Specified by:
getNumberOfNodesin interfaceIntGraph
-
getNodeOfIndex
public int getNodeOfIndex(int index)
Description copied from interface:IntGraphThe graph keeps an index of nodes. With this function, you can look up these indices.- Specified by:
getNodeOfIndexin interfaceIntGraph- Returns:
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-