PDAG.boundary

PDAG.boundary(id)

Boundary of a node: neighbours (via edges), children, and parents.

Parameters:

id (int) – the id of the node

Returns:

the set of adjacent node ids

Return type:

set

Example

import pyagrum as gum

pdag = gum.fastPDAG("A->B-C;B->D")
pdag.boundary(1)  # parents, children and neighbours
# {0, 2, 3}

Used by

PDAG, ChainGraph

Inheritance diagram of pyagrum.PDAG, pyagrum.ChainGraph