Package com.gengoai.graph
Class EdgeMergeFunctions
- java.lang.Object
-
- com.gengoai.graph.EdgeMergeFunctions
-
public final class EdgeMergeFunctions extends Object
A set of common edge merge functions.- Author:
- David B. Bracewell
-
-
Constructor Summary
Constructors Constructor Description EdgeMergeFunctions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <V> EdgeMergeFunction<V>
averageWeight()
A merge function that creates a new edge whose weight is the average of the two edges.static <V> EdgeMergeFunction<V>
keepDuplicate()
A merge function that keeps the duplicate edge and ignores the original.static <V> EdgeMergeFunction<V>
keepOriginal()
A merge function that keeps the original edge and ignores the duplicate.static <V> EdgeMergeFunction<V>
maxWeight()
A merge function that creates a new edge whose weight is the maximum of the two edges.static <V> EdgeMergeFunction<V>
minWeight()
A merge function that creates a new edge whose weight is the minimum of the two edges.
-
-
-
Method Detail
-
keepOriginal
public static <V> EdgeMergeFunction<V> keepOriginal()
A merge function that keeps the original edge and ignores the duplicate.- Type Parameters:
V
- The vertex type- Returns:
- An EdgeMergeFunction
-
keepDuplicate
public static <V> EdgeMergeFunction<V> keepDuplicate()
A merge function that keeps the duplicate edge and ignores the original.- Type Parameters:
V
- The vertex type- Returns:
- An EdgeMergeFunction
-
averageWeight
public static <V> EdgeMergeFunction<V> averageWeight()
A merge function that creates a new edge whose weight is the average of the two edges.- Type Parameters:
V
- The vertex type- Returns:
- An EdgeMergeFunction
-
minWeight
public static <V> EdgeMergeFunction<V> minWeight()
A merge function that creates a new edge whose weight is the minimum of the two edges.- Type Parameters:
V
- The vertex type- Returns:
- An EdgeMergeFunction
-
maxWeight
public static <V> EdgeMergeFunction<V> maxWeight()
A merge function that creates a new edge whose weight is the maximum of the two edges.- Type Parameters:
V
- The vertex type- Returns:
- An EdgeMergeFunction
-
-