Algorithm - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

The algorithm of Triangle Count is as follows:

  1. Calculate the neighboring nodes of each node.
  2. Calculate the intersection for each edge and find the node whose id in the intersection is greater than the id of the first two nodes.
  3. For each node, count the total number of Triangles. Note that only the Triangle Counts that meet the calculation direction are counted.

Note: When calculating triangles, there must be a calculation direction (for example, starting node id <intermediate node id <destination node id).

Assume that node A and node B are neighbors. The set of neighbors of node A is {B, C, D, E}, the set of neighbors of node B is {A, C, E, F, G}, and their intersection is {C, E} . The nodes in the intersection are the common neighbors of node A and node B, so there are two triangles {A, B, C} and {A, B, E}.