This algorithm takes two vertices, and returns 1 if they two vertices are in the same community, and returns 0 if they are not in the same community.
The algorithm assumes that community detection has already completed and that a community ID is stored in an integer attribute on each vertex.
Returns 1 if the two vertices are in the same community.
Returns 0 if the two vertices are not in the same community.
Suppose we have the following vertices:
Their community IDs were generated by running the weakly connected component algorithm on the graph. If we run the algorithm between Kevin and Jenny, we get 1 because the two vertices are in the same community as indicated by their community
attribute:
Name
Description
Data type
a
A vertex.
VERTEX
b
A vertex.
VERTEX
communityAttribute
The community attribute used to store a vertex’s community ID.
STRING