MarkedGraph.connectedComponents

MarkedGraph.connectedComponents()
Returns:

each node is mapped to the root of its connected component (in the skeleton)

Return type:

dict[int, int]

Example

import pyagrum as gum

g = gum.fastMarkedGraph("A->B;C<->D")
cc = g.connectedComponents()
cc[0] == cc[1], cc[0] == cc[2]
# (True, False)

Used by

MarkedGraph, PAG

Inheritance diagram of pyagrum.MarkedGraph, pyagrum.PAG