InfluenceDiagram.ancestors
- InfluenceDiagram.ancestors(*args)
give the set of nodeid of ancestors of a node
- Parameters:
norid (
int | str) – the name or the id of the node- Returns:
the set of ids of the ancestors of node
norid.- Return type:
set
Example
import pyagrum as gum
diag = gum.fastID("C->*D->$U<-C")
sorted(diag.ancestors("U"))
# [0, 1]
sorted(diag.ancestors("C"))
# []
Class