EssentialGraph.descendants
- EssentialGraph.descendants(*args)
give the set of nodeid of descendants of a node
- Parameters:
norid (
int | str) – the name or the id of the node- Returns:
the set of ids of the descendants of node
norid.- Return type:
set- Raises:
pyagrum.NotFound – if no node has this name (a graph may have no names)
Example
import pyagrum as gum
bn = gum.fastBN("A->B<-C;B->D")
eg = gum.EssentialGraph(bn)
eg.descendants(bn.idFromName("A"))
# {1, 3}
Class