Class EnumTriangles
- java.lang.Object
-
- org.apache.flink.examples.java.graph.EnumTriangles
-
public class EnumTriangles extends Object
Triangle enumeration is a pre-processing step to find closely connected parts in graphs. A triangle consists of three edges that connect three vertices with each other.The algorithm works as follows: It groups all edges that share a common vertex and builds triads, i.e., triples of vertices that are connected by two edges. Finally, all triads are filtered for which no third edge exists that closes the triangle.
Input files are plain text files and must be formatted as follows:
- Edges are represented as pairs for vertex IDs which are separated by space characters.
Edges are separated by new-line characters.
For example"1 2\n2 12\n1 12\n42 63"gives four (undirected) edges (1)-(2), (2)-(12), (1)-(12), and (42)-(63) that include a triangle
(1) / \ (2)-(12)Usage:
EnumTriangleBasic --edges <path> --output <path>
If no parameters are provided, the program is run with default data fromEnumTrianglesData.This example shows how to use:
- Custom Java objects which extend Tuple
- Group Sorting
Note: All Flink DataSet APIs are deprecated since Flink 1.18 and will be removed in a future Flink major version. You can still build your application in DataSet, but you should move to either the DataStream and/or Table API. This class is retained for testing purposes.
- Edges are represented as pairs for vertex IDs which are separated by space characters.
Edges are separated by new-line characters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEnumTriangles.TupleEdgeConverterConverts a Tuple2 into an Edge.
-
Constructor Summary
Constructors Constructor Description EnumTriangles()
-