MarkovRandomField.neighbours
- MarkovRandomField.neighbours(*args)
Return the set of neighbours of a node.
- Parameters:
norid (
int | str) – the name or the id of the node- Returns:
the set of neighbour node ids
- Return type:
set[int]
Example
import pyagrum as gum
mrf = gum.fastMRF("A--B;B--C")
mrf.neighbours("B")
# {0, 2}
Class