MarkedGraph.connectedComponentsCount

MarkedGraph.connectedComponentsCount()

number of connected components

Returns:

the number of connected components in the graph.

Return type:

int

Example

import pyagrum as gum

g = gum.fastMarkedGraph("A->B;C<->D;E")
g.connectedComponentsCount()
# 3

Used by

MarkedGraph, PAG

Inheritance diagram of pyagrum.MarkedGraph, pyagrum.PAG