MarkedGraph.connectedComponentsList

MarkedGraph.connectedComponentsList()

connected components as a dict of sets

Returns:

dict of connected components (as sets of nodeIds) keyed by the index of the component.

Return type:

dict(int, set[int])

Example

import pyagrum as gum

g = gum.fastMarkedGraph("A->B;C<->D")
sorted(sorted(c) for c in g.connectedComponentsList().values())
# [[0, 1], [2, 3]]

Used by

MarkedGraph, PAG

Inheritance diagram of pyagrum.MarkedGraph, pyagrum.PAG