Class Components<V>
- java.lang.Object
-
- org.processmining.plugins.InductiveMiner.graphs.Components<V>
-
public class Components<V> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Components(java.util.Collection<? extends java.util.Collection<V>> partition)Components(V[] nodes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareInSameComponent(int nodeIndexA, int nodeIndexB)booleanareInSameComponent(V nodeA, V nodeB)Preferably use the integer variant.intgetComponentOf(int node)intgetComponentOf(V node)java.util.List<java.util.Set<V>>getComponents()java.lang.Iterable<java.lang.Integer>getNodeIndicesOfComponent(int componentIndex)intgetNumberOfComponents()voidmergeComponents(int componentA, int componentB)Merge two components.voidmergeComponentsOf(int indexA, int indexB)Merge the components of the two nodes.voidmergeComponentsOf(V nodeA, V nodeB)Merge the components of the two nodes.int[]normalise()Put the components in increasing order 0...n
-
-
-
Method Detail
-
mergeComponentsOf
public void mergeComponentsOf(int indexA, int indexB)Merge the components of the two nodes. If they are in the same component, runs in O(1). If they are not, runs in O(n) (n = number of nodes).- Parameters:
indexA-indexB-
-
mergeComponentsOf
public void mergeComponentsOf(V nodeA, V nodeB)
Merge the components of the two nodes. If they are in the same component, runs in O(1). If they are not, runs in O(n) (n = number of nodes). Use the integer variant if possible.- Parameters:
nodeA-nodeB-
-
mergeComponents
public void mergeComponents(int componentA, int componentB)Merge two components. The second component is kept.- Parameters:
componentA-componentB-
-
areInSameComponent
public boolean areInSameComponent(int nodeIndexA, int nodeIndexB)
-
areInSameComponent
public boolean areInSameComponent(V nodeA, V nodeB)
Preferably use the integer variant.- Parameters:
nodeA-nodeB-- Returns:
-
getComponentOf
public int getComponentOf(int node)
-
getComponentOf
public int getComponentOf(V node)
-
getNumberOfComponents
public int getNumberOfComponents()
-
getComponents
public java.util.List<java.util.Set<V>> getComponents()
-
getNodeIndicesOfComponent
public java.lang.Iterable<java.lang.Integer> getNodeIndicesOfComponent(int componentIndex)
-
normalise
public int[] normalise()
Put the components in increasing order 0...n- Returns:
- The mapping from old component to new component.
-
-