connComp function in the Factory

This function operates on directed graphs. For each node, it returns the corresponding subgroup.

The node is the parent or son value of the graph.

In other words, the connComp function defines which subgroups of nodes are interconnected.


connComp(parent, son, group)




The attribute containing the parent nodes of a directed graph. The parent parameter is mandatory.


The attribute containing the son nodes of a directed graph. The son parameter is mandatory.


The attribute by which you want to further group results.

The group parameter can also be defined as a list: connComp($"parent",$"son",($"group1", $"group2"))

Example - connComp(parent,son)

The following example uses the connComp dataset.



In this example, we want to retrieve the connected component of this graph.

We initially had two attributes which define the parent and son relation, we have created a new one the ConnComp attribute, and applied the connComp function to it by specifying which attribute is the parent, and which is the son.

So, the formula would be: connComp($"Parent",$"Son")

In the ConnComp attribute, the function has defined the subgroups, so we now know that there are 3 subgroups and to which group each node belong.