MPDAG.connectedComponents
- MPDAG.connectedComponents()
The connected components of the graph (of its skeleton).
- Returns:
each node id mapped to the id of the root of its component
- Return type:
dict[int,int]
Example
import pyagrum as gum
mpdag = gum.MPDAG.meekClosure(gum.fastPDAG("A-B->C;D-E"))
cc = mpdag.connectedComponents()
cc[0] == cc[2], cc[0] == cc[3]
# (True, False)
Class