UndiGraph.connectedComponentsCount

UndiGraph.connectedComponentsCount()

number of connected components

Returns:

the number of connected components in the graph.

Return type:

int

Example

import pyagrum as gum

g = gum.fastUndiGraph("A-B-C;D-E;F")
g.connectedComponentsCount()
# 3

Used by

UndiGraph, ChainGraph, CliqueGraph, MixedGraph, PDAG

Inheritance diagram of pyagrum.UndiGraph, pyagrum.ChainGraph, pyagrum.CliqueGraph, pyagrum.MixedGraph, pyagrum.PDAG