BayesNet.existsArc

BayesNet.existsArc(*args)

Check if an arc exists

Parameters:
  • tail (int | str) – the name or id of the tail of the arc

  • head (int | str) – the name or the id of the head of the arc

Returns:

True if tail->head is an arc.

Return type:

bool

Example

import pyagrum as gum

bn = gum.fastBN("A->B")
bn.existsArc("A", "B")
# True
bn.existsArc("B", "A")
# False

Class

BayesNet