K
- graph ID typeVV
- vertex value typeEV
- edge value typepublic class TriangleListing<K extends Comparable<K> & org.apache.flink.types.CopyableValue<K>,VV,EV> extends GraphAlgorithmWrappingDataSet<K,VV,EV,TriangleListing.Result<K>>
A triangle is a 3-clique with vertices A, B, and C connected by edges (A, B), (A, C), and (B, C).
The input graph must not contain duplicate edges or self-loops.
This algorithm is similar to the undirected version but also tracks and computes a bitmask representing the six potential graph edges connecting the triangle vertices.
Modifier and Type | Class and Description |
---|---|
static class |
TriangleListing.Result<T>
Wraps
Tuple4 to encapsulate results from the directed Triangle Listing algorithm. |
Constructor and Description |
---|
TriangleListing() |
Modifier and Type | Method and Description |
---|---|
protected String |
getAlgorithmName()
Algorithms are identified by name rather than by class to allow subclassing.
|
protected boolean |
mergeConfiguration(GraphAlgorithmWrappingDataSet other)
An algorithm must first test whether the configurations can be merged
before merging individual fields.
|
org.apache.flink.api.java.DataSet<TriangleListing.Result<K>> |
runInternal(Graph<K,VV,EV> input)
The implementation of the algorithm, renamed from
GraphAlgorithm.run(Graph) . |
TriangleListing<K,VV,EV> |
setLittleParallelism(int littleParallelism)
Override the parallelism of operators processing small amounts of data.
|
TriangleListing<K,VV,EV> |
setSortTriangleVertices(boolean sortTriangleVertices)
Normalize the triangle listing such that for each result (K0, K1, K2)
the vertex IDs are sorted K0 < K1 < K2.
|
equals, hashCode, run
public TriangleListing<K,VV,EV> setSortTriangleVertices(boolean sortTriangleVertices)
sortTriangleVertices
- whether to output each triangle's vertices in sorted orderpublic TriangleListing<K,VV,EV> setLittleParallelism(int littleParallelism)
littleParallelism
- operator parallelismprotected String getAlgorithmName()
GraphAlgorithmWrappingDataSet
getAlgorithmName
in class GraphAlgorithmWrappingDataSet<K extends Comparable<K> & org.apache.flink.types.CopyableValue<K>,VV,EV,TriangleListing.Result<K extends Comparable<K> & org.apache.flink.types.CopyableValue<K>>>
protected boolean mergeConfiguration(GraphAlgorithmWrappingDataSet other)
GraphAlgorithmWrappingDataSet
mergeConfiguration
in class GraphAlgorithmWrappingDataSet<K extends Comparable<K> & org.apache.flink.types.CopyableValue<K>,VV,EV,TriangleListing.Result<K extends Comparable<K> & org.apache.flink.types.CopyableValue<K>>>
other
- the algorithm with which to compare and mergepublic org.apache.flink.api.java.DataSet<TriangleListing.Result<K>> runInternal(Graph<K,VV,EV> input) throws Exception
GraphAlgorithmWrappingDataSet
GraphAlgorithm.run(Graph)
.runInternal
in class GraphAlgorithmWrappingDataSet<K extends Comparable<K> & org.apache.flink.types.CopyableValue<K>,VV,EV,TriangleListing.Result<K extends Comparable<K> & org.apache.flink.types.CopyableValue<K>>>
input
- the input graphException
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.